Skip to content

Commit

Permalink
Merge pull request #678 from FastReports/sync_branch_2024.1.7
Browse files Browse the repository at this point in the history
FastReport.OpenSource 2024.1.7
  • Loading branch information
0legK authored Feb 22, 2024
2 parents 4fbb7c9 + d486029 commit da717e3
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Extras/Core/FastReport.Data/WPF.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<Import Project="..\..\..\UsedPackages.version" />

<PropertyGroup>
<FastReportWPFProj>..\..\..\..\FastReport.WPF\FastReport.WPF.csproj</FastReportWPFProj>
<FastReportWPFProj>..\..\..\FastReport.WPF\FastReport.WPF.csproj</FastReportWPFProj>
<FastReportWPFPackage>FastReport.WPF.Demo</FastReportWPFPackage>

<FastReportFormsWPFProj>..\..\..\..\FastReport.Forms.WPF\src\FastReport.Forms.WPF.csproj</FastReportFormsWPFProj>
<FastReportFormsWPFProj>..\..\..\FastReport.Forms.WPF\src\FastReport.Forms.WPF.csproj</FastReportFormsWPFProj>
<FastReportFormsWPFPackage>FastReport.Forms.WPF.Demo</FastReportFormsWPFPackage>
</PropertyGroup>

Expand Down
58 changes: 42 additions & 16 deletions FastReport.Base/Barcode/Barcode2of5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion FastReport.Base/Functions/StdFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ public static object Switch(params object[] expressions)
/// Checks if the specified object is null.
/// </summary>
/// <param name="thisReport">The report instance.</param>
/// <param name="name">Either a name of DB column, or a parameter name, or a total name to check.</param>
/// <param name="name">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")].</param>
/// <returns><b>true</b> if the object's value is null.</returns>
public static bool IsNull(Report thisReport, string name)
{
Expand Down
3 changes: 3 additions & 0 deletions FastReport.Base/ReportPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion FastReport.Base/Table/TableHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions FastReport/Resources/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1889,6 +1889,7 @@
<AddParameter Text="Add Parameter"/>
<Delete Text="Delete"/>
<DuplicateName Text="Item with such name already exists."/>
<DuplicateParamName Text="The query contains multiple occurrences of one or more parameters ({0}). Please ensure that each use of the parameter matches your expectations and does not cause a conflict during query execution."/>
</QueryWizard>
<RelationEditor Text="Edit Relation">
<ParentTable Text="Parent table:"/>
Expand Down
1 change: 1 addition & 0 deletions Localization/Russian.frl
Original file line number Diff line number Diff line change
Expand Up @@ -1704,6 +1704,7 @@
<AddParameter Text="Добавить параметр"/>
<Delete Text="Удалить"/>
<DuplicateName Text="Элемент с таким именем уже существует."/>
<DuplicateParamName Text="В запросе обнаружено несколько вхождений одного или нескольких параметров ({0}). Пожалуйста, убедитесь, что каждое использование параметра соответствует Вашим ожиданиям и не вызовет конфликта при выполнении запроса."/>
</QueryWizard>
<RelationEditor Text="Редактор связи">
<ParentTable Text="Главная таблица:"/>
Expand Down

0 comments on commit da717e3

Please sign in to comment.