From d4860299651b9f5f7e2afbe8516541072a0d382a Mon Sep 17 00:00:00 2001 From: FastReports-bot Date: Thu, 22 Feb 2024 17:04:06 +0300 Subject: [PATCH] * sync 2/22/2024 version: 2024.1.7 --- Extras/Core/FastReport.Data/WPF.props | 4 +- FastReport.Base/Barcode/Barcode2of5.cs | 58 ++++++++++++++++------- FastReport.Base/Functions/StdFunctions.cs | 2 +- FastReport.Base/ReportPage.cs | 3 ++ FastReport.Base/Table/TableHelper.cs | 2 +- FastReport/Resources/en.xml | 1 + Localization/Russian.frl | 1 + 7 files changed, 51 insertions(+), 20 deletions(-) diff --git a/Extras/Core/FastReport.Data/WPF.props b/Extras/Core/FastReport.Data/WPF.props index 6bb29b99..02fa6b4f 100644 --- a/Extras/Core/FastReport.Data/WPF.props +++ b/Extras/Core/FastReport.Data/WPF.props @@ -9,10 +9,10 @@ - ..\..\..\..\FastReport.WPF\FastReport.WPF.csproj + ..\..\..\FastReport.WPF\FastReport.WPF.csproj FastReport.WPF.Demo - ..\..\..\..\FastReport.Forms.WPF\src\FastReport.Forms.WPF.csproj + ..\..\..\FastReport.Forms.WPF\src\FastReport.Forms.WPF.csproj FastReport.Forms.WPF.Demo diff --git a/FastReport.Base/Barcode/Barcode2of5.cs b/FastReport.Base/Barcode/Barcode2of5.cs index 1e5840b6..85cec86b 100644 --- a/FastReport.Base/Barcode/Barcode2of5.cs +++ b/FastReport.Base/Barcode/Barcode2of5.cs @@ -421,26 +421,52 @@ public override void Assign(BarcodeBase source) public override void DrawBarcode(IGraphics g, RectangleF displayRect) { base.DrawBarcode(g, displayRect); - float bearerWidth = WideBarRatio * 2 * zoom; - using (Pen pen = new Pen(Color, bearerWidth)) + IGraphicsState state = g.Save(); + try { - float x0 = displayRect.Left + (displayRect.Width - barArea.Width * zoom) / 2; - float x01 = displayRect.Left + bearerWidth / 2 + (displayRect.Width - barArea.Width * zoom) / 2; - float y0 = displayRect.Top; - float y01 = displayRect.Top + bearerWidth / 2; - float x1 = displayRect.Left + displayRect.Width - (displayRect.Width - barArea.Width * zoom) / 2; - float x11 = displayRect.Left + displayRect.Width - bearerWidth / 2 - (displayRect.Width - barArea.Width * zoom) / 2; - float y1 = displayRect.Top + barArea.Bottom * zoom; - float y11 = displayRect.Top + barArea.Bottom * zoom - bearerWidth / 2; - - g.DrawLine(pen, x0, y01 - 0.5F, x1, y01 - 0.5F); - g.DrawLine(pen, x0, y11, x1, y11); - if (this.drawVerticalBearerBars) + // rotate + g.TranslateTransform(displayRect.Left, displayRect.Top); + g.RotateTransform(angle); + switch (angle) { - g.DrawLine(pen, x01 - 0.5F, y0, x01 - 0.5F, y1); - g.DrawLine(pen, x11, y0, x11, y1); + case 90: + g.TranslateTransform(0, -displayRect.Width); + break; + case 180: + g.TranslateTransform(-displayRect.Width, -displayRect.Height); + break; + case 270: + g.TranslateTransform(-displayRect.Height, 0); + break; } + g.TranslateTransform(barArea.Left * zoom, 0); + + float bearerWidth = WideBarRatio * 2 * zoom; + using (Pen pen = new Pen(Color, bearerWidth)) + { + float x0 = 0; + float x01 = bearerWidth / 2; + float y0 = 0; + float y01 = bearerWidth / 2; + float x1 = barArea.Width * zoom; + float x11 = barArea.Width * zoom - bearerWidth / 2; + float y1 = barArea.Bottom * zoom; + float y11 = barArea.Bottom * zoom - bearerWidth / 2; + + g.DrawLine(pen, x0, y01 - 0.5F, x1, y01 - 0.5F); + g.DrawLine(pen, x0, y11, x1, y11); + if (this.drawVerticalBearerBars) + { + g.DrawLine(pen, x01 - 0.5F, y0, x01 - 0.5F, y1); + g.DrawLine(pen, x11, y0, x11, y1); + } + } + } + finally + { + g.Restore(state); } + } #endregion diff --git a/FastReport.Base/Functions/StdFunctions.cs b/FastReport.Base/Functions/StdFunctions.cs index a0eb683b..ddf71048 100644 --- a/FastReport.Base/Functions/StdFunctions.cs +++ b/FastReport.Base/Functions/StdFunctions.cs @@ -1187,7 +1187,7 @@ public static object Switch(params object[] expressions) /// Checks if the specified object is null. /// /// The report instance. - /// Either a name of DB column, or a parameter name, or a total name to check. + /// Either a name of DB column, or a parameter name, or a total name to check. The name must be enclosed in double quotes, for example, [IsNull("Parameter")]. /// true if the object's value is null. public static bool IsNull(Report thisReport, string name) { diff --git a/FastReport.Base/ReportPage.cs b/FastReport.Base/ReportPage.cs index 7d314159..0f4c9f09 100644 --- a/FastReport.Base/ReportPage.cs +++ b/FastReport.Base/ReportPage.cs @@ -1067,6 +1067,8 @@ public override void Draw(FRPaintEventArgs e) pageRect.Width - (LeftMargin + RightMargin) * Units.Millimeters, pageRect.Height - (TopMargin + BottomMargin) * Units.Millimeters); } + IGraphicsState state = g.Save(); + e.Graphics.SetClip(new RectangleF(pageRect.X * e.ScaleX, pageRect.Y * e.ScaleY, pageRect.Width * e.ScaleX, pageRect.Height * e.ScaleY)); Border.Draw(e, printableRect); if (Watermark.Enabled) @@ -1121,6 +1123,7 @@ public override void Draw(FRPaintEventArgs e) if (Watermark.ShowTextOnTop) Watermark.DrawText(e, pageRect, Report, IsPrinting); } + g.Restore(state); } internal void InitializeComponents() diff --git a/FastReport.Base/Table/TableHelper.cs b/FastReport.Base/Table/TableHelper.cs index 5f6fbedd..33e14297 100644 --- a/FastReport.Base/Table/TableHelper.cs +++ b/FastReport.Base/Table/TableHelper.cs @@ -345,7 +345,7 @@ private void CopyCells(int originalColumnIndex, int originalRowIndex, if (resultColumnIndex >= spanData.resultCellOrigin.X && resultColumnIndex <= spanData.resultCellOrigin.X + spanData.resultCell.ColSpan - 1 && resultRowIndex >= spanData.resultCellOrigin.Y && - resultRowIndex <= spanData.resultCellOrigin.Y + spanData.resultCell.RowSpan) + resultRowIndex <= spanData.resultCellOrigin.Y + spanData.resultCell.RowSpan - 1) { needData = false; break; diff --git a/FastReport/Resources/en.xml b/FastReport/Resources/en.xml index ab47bf95..8e90021f 100644 --- a/FastReport/Resources/en.xml +++ b/FastReport/Resources/en.xml @@ -1889,6 +1889,7 @@ + diff --git a/Localization/Russian.frl b/Localization/Russian.frl index 033d87b7..f1400884 100644 --- a/Localization/Russian.frl +++ b/Localization/Russian.frl @@ -1704,6 +1704,7 @@ +