Skip to content

Commit da11368

Browse files
authored
Merge pull request #74 from FastReports/sync_branch_636893680915912359
* sync 3/28/2019
2 parents 9d8f7c2 + d243baa commit da11368

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+965
-227
lines changed

FastReport.Base/BandColumns.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public enum ColumnLayout
2323
/// <summary>
2424
/// This class holds the band columns settings. It is used in the <see cref="DataBand.Columns"/> property.
2525
/// </summary>
26-
[TypeConverterAttribute("FastReport.TypeConverters.FRExpandableObjectConverter, FastReport")]
26+
[TypeConverter(typeof(FastReport.TypeConverters.FRExpandableObjectConverter))]
2727
public class BandColumns
2828
{
2929
private int count;
@@ -54,7 +54,7 @@ public int Count
5454
/// The column width, in pixels.
5555
/// </summary>
5656
[DefaultValue(0f)]
57-
[TypeConverterAttribute("FastReport.TypeConverters.UnitsConverter, FastReport")]
57+
[TypeConverter("FastReport.TypeConverters.UnitsConverter, FastReport")]
5858
public float Width
5959
{
6060
get { return width; }

FastReport.Base/Barcode/Barcode2DBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ internal virtual void Draw2DBarcode(IGraphicsRenderer g, float kx, float ky)
4040
{
4141
}
4242

43-
internal override void DrawBarcode(IGraphicsRenderer g, RectangleF displayRect)
43+
public override void DrawBarcode(IGraphicsRenderer g, RectangleF displayRect)
4444
{
4545
float width = angle == 90 || angle == 270 ? displayRect.Height : displayRect.Width;
4646
float height = angle == 90 || angle == 270 ? displayRect.Width : displayRect.Height;

FastReport.Base/Barcode/BarcodeAztec.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,17 @@ internal override SizeF CalcBounds()
5151
internal override void Draw2DBarcode(IGraphicsRenderer g, float kx, float ky)
5252
{
5353
Brush light = Brushes.White;
54-
Brush dark = new SolidBrush(Color);
54+
Brush dark = new SolidBrush(Color);
5555

5656
for (int y = 0; y < matrix.Height; y++)
5757
{
5858
for (int x = 0; x < matrix.Width; x++)
5959
{
6060
bool b = matrix.getRow(y, null)[x];
6161

62-
Brush brush = b == true ? dark : light;
63-
g.FillRectangle(brush, x * PIXEL_SIZE * kx, y * PIXEL_SIZE * ky,
62+
Brush brush = /*b == true ?*/ dark /*: light*/;
63+
if (b == true)
64+
g.FillRectangle(brush, x * PIXEL_SIZE * kx, y * PIXEL_SIZE * ky,
6465
PIXEL_SIZE * kx, PIXEL_SIZE * ky);
6566
}
6667
}

FastReport.Base/Barcode/BarcodeBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace FastReport.Barcode
88
/// <summary>
99
/// The base class for all barcodes.
1010
/// </summary>
11-
[TypeConverter("FastReport.TypeConverters.BarcodeConverter, FastReport")]
11+
[TypeConverter(typeof(FastReport.TypeConverters.BarcodeConverter))]
1212
public abstract class BarcodeBase
1313
{
1414
#region Fields
@@ -86,7 +86,7 @@ internal virtual string StripControlCodes(string data)
8686
return data;
8787
}
8888

89-
internal virtual void DrawBarcode(IGraphicsRenderer g, RectangleF displayRect)
89+
public virtual void DrawBarcode(IGraphicsRenderer g, RectangleF displayRect)
9090
{
9191
}
9292
#endregion

FastReport.Base/Barcode/BarcodeDatamatrix.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ internal override void Draw2DBarcode(IGraphicsRenderer g, float kx, float ky)
977977
Brush light = Brushes.White;
978978
Brush dark = new SolidBrush(Color);
979979
int stride = (width + 7) / 8;
980-
980+
981981
for (int k = 0; k < height; ++k)
982982
{
983983
int p = k * stride;
@@ -986,8 +986,9 @@ internal override void Draw2DBarcode(IGraphicsRenderer g, float kx, float ky)
986986
int b = image[p + (j / 8)] & 0xff;
987987
b <<= j % 8;
988988

989-
Brush brush = (b & 0x80) == 0 ? light : dark;
990-
g.FillRectangle(brush, j * PixelSize * kx, k * PixelSize * ky,
989+
Brush brush = /*(b & 0x80) == 0 ? light :*/ dark;
990+
if ((b & 0x80) != 0)
991+
g.FillRectangle(brush, j * PixelSize * kx, k * PixelSize * ky,
991992
PixelSize * kx, PixelSize * ky);
992993
}
993994
}

FastReport.Base/Barcode/BarcodeObject.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,11 @@ private void DrawBarcode(FRPaintEventArgs e)
338338
}
339339
}
340340

341-
private void UpdateAutoSize()
341+
#endregion
342+
343+
#region Public Methods
344+
345+
public void UpdateAutoSize()
342346
{
343347
SetBarcodeProperties();
344348
SizeF size = Barcode.CalcBounds();
@@ -360,9 +364,7 @@ private void UpdateAutoSize()
360364
}
361365
}
362366
}
363-
#endregion
364367

365-
#region Public Methods
366368
/// <inheritdoc/>
367369
public override void Assign(Base source)
368370
{

FastReport.Base/Barcode/BarcodePDF417.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,15 +1517,17 @@ internal override void Draw2DBarcode(IGraphicsRenderer g, float kx, float ky)
15171517
Brush light = Brushes.White;
15181518
Brush dark = new SolidBrush(Color);
15191519
int stride = (bitColumns + 7) / 8;
1520+
15201521
for (int k = 0; k < codeRows; ++k)
15211522
{
15221523
int p = k * stride;
15231524
for (int j = 0; j < bitColumns; ++j)
15241525
{
15251526
int b = outBits[p + (j / 8)] & 0xff;
15261527
b <<= j % 8;
1527-
Brush brush = (b & 0x80) == 0 ? light : dark;
1528-
g.FillRectangle(brush, j * PixelSize.Width * kx, k * PixelSize.Height * ky,
1528+
Brush brush = /*(b & 0x80) == 0 ? light :*/ dark;
1529+
if ((b & 0x80) != 0)
1530+
g.FillRectangle(brush, j * PixelSize.Width * kx, k * PixelSize.Height * ky,
15291531
PixelSize.Width * kx, PixelSize.Height * ky);
15301532
}
15311533
}

FastReport.Base/Barcode/BarcodeQR.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,14 @@ internal override void Draw2DBarcode(IGraphicsRenderer g, float kx, float ky)
195195
Brush light = Brushes.White;
196196
Brush dark = new SolidBrush(Color);
197197
GraphicsPath path = new GraphicsPath();
198-
g.FillRectangle(light, 0, 0, matrix.Width * PixelSize * kx, matrix.Height * PixelSize * kx);
199198

200199
for (int y = 0; y < matrix.Height; y++)
201200
{
202201
for (int x = 0; x < matrix.Width; x++)
203202
{
204203
if (matrix.get_Renamed(x, y) == 0)
205204
{
206-
path.AddRectangle(new RectangleF(
205+
g.PathAddRectangle(path, new RectangleF(
207206
x * PixelSize * kx,
208207
y * PixelSize * ky,
209208
PixelSize * kx,

FastReport.Base/Barcode/LinearBarcodeBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ internal override SizeF CalcBounds()
438438
return new SizeF(drawArea.Width * 1.25f, 0);
439439
}
440440

441-
internal override void DrawBarcode(IGraphicsRenderer g, RectangleF displayRect)
441+
public override void DrawBarcode(IGraphicsRenderer g, RectangleF displayRect)
442442
{
443443
float originalWidth = CalcBounds().Width / 1.25f;
444444
float width = angle == 90 || angle == 270 ? displayRect.Height : displayRect.Width;

FastReport.Base/Border.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public enum BorderLines
8383
/// <summary>
8484
/// Represents a single border line.
8585
/// </summary>
86-
[TypeConverterAttribute("FastReport.TypeConverters.FRExpandableObjectConverter, FastReport")]
86+
[TypeConverter(typeof(FastReport.TypeConverters.FRExpandableObjectConverter))]
8787
public class BorderLine
8888
{
8989
#region Fields
@@ -259,8 +259,8 @@ internal BorderLine()
259259
/// To turn on and off the lines, use the <see cref="Lines"/> property. To set the same color, style or width
260260
/// for each line, use <see cref="Color"/>, <see cref="Style"/>, <see cref="Width"/> properties of the <b>Border</b>.
261261
/// </remarks>
262-
[TypeConverterAttribute("FastReport.TypeConverters.FRExpandableObjectConverter, FastReport")]
263-
[EditorAttribute("FastReport.TypeEditors.BorderEditor, FastReport", typeof(UITypeEditor))]
262+
[TypeConverter(typeof(FastReport.TypeConverters.FRExpandableObjectConverter))]
263+
[Editor("FastReport.TypeEditors.BorderEditor, FastReport", typeof(UITypeEditor))]
264264
public class Border
265265
{
266266
#region Fields

0 commit comments

Comments
 (0)