Index: include/wincontrol.inc
===================================================================
--- include/wincontrol.inc	(revision 20568)
+++ include/wincontrol.inc	(working copy)
@@ -98,18 +98,18 @@
     procedure AllocateTable(ColCount, RowCount: Integer);
     procedure SetTableControls(ListOfControls: TFPList;
                                ChildSizing: TControlChildSizing;
-                               BiDiMode: TBiDiMode);
+                               UseRightToLeftAlignment: Boolean);
     procedure SumTable;
     procedure ResizeTable(ChildSizing: TControlChildSizing;
                           TargetWidth, TargetHeight: integer);
     procedure AlignToRight(TargetWidth: integer);
     procedure ComputeTableControlBounds(ChildSizing: TControlChildSizing;
-                                        BiDiMode: TBiDiMode);
+                                        UseRightToLeftAlignment: Boolean);
     function SetTableControlBounds(ChildSizing: TControlChildSizing
                                    ): boolean;// true if changed
     function AlignControlsInTable(ListOfControls: TFPList;
                                   ChildSizing: TControlChildSizing;
-                                  BiDiMode: TBiDiMode;
+                                  UseRightToLeftAlignment: Boolean;
                                   TargetWidth, TargetHeight: integer;
                                   Apply: boolean): boolean;// true if changed
 
@@ -838,7 +838,7 @@
       ChildSizing.EnlargeVertical:=crsAnchorAligning;
       // compute static layout
       r:=WinControl.GetLogicalClientRect;
-      Box.AlignControlsInTable(AlignList,ChildSizing,WinControl.BiDiMode,
+      Box.AlignControlsInTable(AlignList,ChildSizing,WinControl.UseRightToLeftAlignment,
                                r.Right,r.Bottom,false);
       //Box.WriteDebugReport('TAutoSizeCtrlData.SetupNonAlignedChilds');
       // transfer the coords of the layout
@@ -1371,7 +1371,7 @@
 end;
 
 procedure TAutoSizeBox.SetTableControls(ListOfControls: TFPList;
-  ChildSizing: TControlChildSizing; BiDiMode: TBiDiMode);
+  ChildSizing: TControlChildSizing; UseRightToLeftAlignment: Boolean);
 var
   i: Integer;
   Row: LongInt;
@@ -1408,7 +1408,7 @@
         LineMax:=ChildCount[asboHorizontal];
         Row:=i div LineMax;
         Col:=i mod LineMax;
-        if (BiDiMode<>bdLeftToRight) then
+        if UseRightToLeftAlignment then
           Col:=LineMax-Col-1;
         ChildBox:=Childs[asboHorizontal][Col].Childs[asboVertical][Row];
         ChildBox.SetControl(ChildControl);
@@ -1419,7 +1419,7 @@
         LineMax:=ChildCount[asboVertical];
         Col:=i div LineMax;
         Row:=i mod LineMax;
-        if (BiDiMode<>bdLeftToRight) then
+        if UseRightToLeftAlignment then
           Col:=LineMax-Col-1;
         ChildBox:=Childs[asboVertical][Row].Childs[asboHorizontal][Col];
         ChildBox.SetControl(ChildControl);
@@ -2026,7 +2026,7 @@
 end;
 
 procedure TAutoSizeBox.ComputeTableControlBounds(
-  ChildSizing: TControlChildSizing; BiDiMode: TBiDiMode);
+  ChildSizing: TControlChildSizing; UseRightToLeftAlignment: Boolean);
 var
   y: Integer;
   RowBox: TAutoSizeBox;
@@ -2062,7 +2062,7 @@
         ccaFill:        NewWidth:=CellBounds.Right-CellBounds.Left;
         ccaLeftTop,ccaRightBottom:
                    if (CurControl.BorderSpacing.CellAlignHorizontal=ccaLeftTop)
-                     <>(BidiMode=bdLeftToRight)
+                     <>(not UseRightToLeftAlignment)
                    then
                      NewBounds.Left:=CellBounds.Right-NewWidth;
         ccaCenter:      NewBounds.Left:=NewBounds.Left
@@ -2132,21 +2132,21 @@
 end;
 
 function TAutoSizeBox.AlignControlsInTable(ListOfControls: TFPList;
-  ChildSizing: TControlChildSizing; BiDiMode: TBiDiMode;
+  ChildSizing: TControlChildSizing; UseRightToLeftAlignment: Boolean;
   TargetWidth, TargetHeight: integer;
   Apply: boolean): boolean;
 // true if a control was modified
 begin
-  SetTableControls(ListOfControls,ChildSizing,BiDiMode);
+  SetTableControls(ListOfControls,ChildSizing, UseRightToLeftAlignment);
   //WriteDebugReport('after SetTableControls');
   SumTable;
   //WriteDebugReport('after SumTable');
   ResizeTable(ChildSizing,TargetWidth,TargetHeight);
   //WriteDebugReport('after ResizeTable');
-  if BiDiMode<>bdLeftToRight then
+  if UseRightToLeftAlignment then
     AlignToRight(TargetWidth);
   //WriteDebugReport('after AlignToRight');
-  ComputeTableControlBounds(ChildSizing,BiDiMode);
+  ComputeTableControlBounds(ChildSizing, UseRightToLeftAlignment);
   //WriteDebugReport('after ComputeTableControlBounds');
   Result:=Apply and SetTableControlBounds(ChildSizing);
 end;
@@ -5702,7 +5702,7 @@
   Box:=TAutoSizeBox.Create;
   try
     r:=GetLogicalClientRect;
-    BoundsModified:=Box.AlignControlsInTable(ListOfControls,ChildSizing,BiDiMode,
+    BoundsModified:=Box.AlignControlsInTable(ListOfControls,ChildSizing, UseRightToLeftAlignment,
                                              r.Right,r.Bottom,true);
   finally
     Box.Free;
