Jelajahi Sumber

Fixed issue with TableCell ColSpan values outside the bounds of a table
Fixed "Cancel" behaviour when closing modified reports

frogsoftware 1 tahun lalu
induk
melakukan
9f10f90fc6

+ 2 - 2
fastreports.wpf/FastReport.Base/Table/TableBase.cs

@@ -895,11 +895,11 @@ namespace FastReport.Table
                         float columnsWidth = 0;
                         for (int i = 0; i < cell.ColSpan; i++)
                         {
-                            columnsWidth += Columns[x + i].Width;
+                            columnsWidth += Columns[Math.Min(Columns.Count-1,x + i)].Width;
                         }
 
                         // if cell is bigger than sum of column width, increase the last column width
-                        TableColumn lastColumn = Columns[x + cell.ColSpan - 1];
+                        TableColumn lastColumn = Columns[Math.Min(Columns.Count-1,x + cell.ColSpan - 1)];
                         if (columnsWidth < cellWidth && lastColumn.AutoSize)
                             lastColumn.Width += cellWidth - columnsWidth;
                     }

+ 2 - 0
fastreports.wpf/FastReport.WPF/Design/WpfDesignerControl.cs

@@ -190,6 +190,8 @@ namespace FastReport.Design
         /// </remarks>
         public void ParentWindowClosing(CancelEventArgs e)
         {
+            if (e.Cancel)
+                return;
             var args = new System.Windows.Forms.FormClosingEventArgs(System.Windows.Forms.CloseReason.UserClosing, false);
             InnerDesigner.ParentFormClosing(args);
             e.Cancel = args.Cancel;