Skip to content

Commit

Permalink
Merge pull request #74 from FastReports/sync_branch_636893680915912359
Browse files Browse the repository at this point in the history
* sync 3/28/2019
  • Loading branch information
Detrav authored Mar 28, 2019
2 parents 9d8f7c2 + d243baa commit da11368
Show file tree
Hide file tree
Showing 54 changed files with 965 additions and 227 deletions.
4 changes: 2 additions & 2 deletions FastReport.Base/BandColumns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public enum ColumnLayout
/// <summary>
/// This class holds the band columns settings. It is used in the <see cref="DataBand.Columns"/> property.
/// </summary>
[TypeConverterAttribute("FastReport.TypeConverters.FRExpandableObjectConverter, FastReport")]
[TypeConverter(typeof(FastReport.TypeConverters.FRExpandableObjectConverter))]
public class BandColumns
{
private int count;
Expand Down Expand Up @@ -54,7 +54,7 @@ public int Count
/// The column width, in pixels.
/// </summary>
[DefaultValue(0f)]
[TypeConverterAttribute("FastReport.TypeConverters.UnitsConverter, FastReport")]
[TypeConverter("FastReport.TypeConverters.UnitsConverter, FastReport")]
public float Width
{
get { return width; }
Expand Down
2 changes: 1 addition & 1 deletion FastReport.Base/Barcode/Barcode2DBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal virtual void Draw2DBarcode(IGraphicsRenderer g, float kx, float ky)
{
}

internal override void DrawBarcode(IGraphicsRenderer g, RectangleF displayRect)
public override void DrawBarcode(IGraphicsRenderer g, RectangleF displayRect)
{
float width = angle == 90 || angle == 270 ? displayRect.Height : displayRect.Width;
float height = angle == 90 || angle == 270 ? displayRect.Width : displayRect.Height;
Expand Down
7 changes: 4 additions & 3 deletions FastReport.Base/Barcode/BarcodeAztec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,17 @@ internal override SizeF CalcBounds()
internal override void Draw2DBarcode(IGraphicsRenderer g, float kx, float ky)
{
Brush light = Brushes.White;
Brush dark = new SolidBrush(Color);
Brush dark = new SolidBrush(Color);

for (int y = 0; y < matrix.Height; y++)
{
for (int x = 0; x < matrix.Width; x++)
{
bool b = matrix.getRow(y, null)[x];

Brush brush = b == true ? dark : light;
g.FillRectangle(brush, x * PIXEL_SIZE * kx, y * PIXEL_SIZE * ky,
Brush brush = /*b == true ?*/ dark /*: light*/;
if (b == true)
g.FillRectangle(brush, x * PIXEL_SIZE * kx, y * PIXEL_SIZE * ky,
PIXEL_SIZE * kx, PIXEL_SIZE * ky);
}
}
Expand Down
4 changes: 2 additions & 2 deletions FastReport.Base/Barcode/BarcodeBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace FastReport.Barcode
/// <summary>
/// The base class for all barcodes.
/// </summary>
[TypeConverter("FastReport.TypeConverters.BarcodeConverter, FastReport")]
[TypeConverter(typeof(FastReport.TypeConverters.BarcodeConverter))]
public abstract class BarcodeBase
{
#region Fields
Expand Down Expand Up @@ -86,7 +86,7 @@ internal virtual string StripControlCodes(string data)
return data;
}

internal virtual void DrawBarcode(IGraphicsRenderer g, RectangleF displayRect)
public virtual void DrawBarcode(IGraphicsRenderer g, RectangleF displayRect)
{
}
#endregion
Expand Down
7 changes: 4 additions & 3 deletions FastReport.Base/Barcode/BarcodeDatamatrix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ internal override void Draw2DBarcode(IGraphicsRenderer g, float kx, float ky)
Brush light = Brushes.White;
Brush dark = new SolidBrush(Color);
int stride = (width + 7) / 8;

for (int k = 0; k < height; ++k)
{
int p = k * stride;
Expand All @@ -986,8 +986,9 @@ internal override void Draw2DBarcode(IGraphicsRenderer g, float kx, float ky)
int b = image[p + (j / 8)] & 0xff;
b <<= j % 8;

Brush brush = (b & 0x80) == 0 ? light : dark;
g.FillRectangle(brush, j * PixelSize * kx, k * PixelSize * ky,
Brush brush = /*(b & 0x80) == 0 ? light :*/ dark;
if ((b & 0x80) != 0)
g.FillRectangle(brush, j * PixelSize * kx, k * PixelSize * ky,
PixelSize * kx, PixelSize * ky);
}
}
Expand Down
8 changes: 5 additions & 3 deletions FastReport.Base/Barcode/BarcodeObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,11 @@ private void DrawBarcode(FRPaintEventArgs e)
}
}

private void UpdateAutoSize()
#endregion

#region Public Methods

public void UpdateAutoSize()
{
SetBarcodeProperties();
SizeF size = Barcode.CalcBounds();
Expand All @@ -360,9 +364,7 @@ private void UpdateAutoSize()
}
}
}
#endregion

#region Public Methods
/// <inheritdoc/>
public override void Assign(Base source)
{
Expand Down
6 changes: 4 additions & 2 deletions FastReport.Base/Barcode/BarcodePDF417.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1517,15 +1517,17 @@ internal override void Draw2DBarcode(IGraphicsRenderer g, float kx, float ky)
Brush light = Brushes.White;
Brush dark = new SolidBrush(Color);
int stride = (bitColumns + 7) / 8;

for (int k = 0; k < codeRows; ++k)
{
int p = k * stride;
for (int j = 0; j < bitColumns; ++j)
{
int b = outBits[p + (j / 8)] & 0xff;
b <<= j % 8;
Brush brush = (b & 0x80) == 0 ? light : dark;
g.FillRectangle(brush, j * PixelSize.Width * kx, k * PixelSize.Height * ky,
Brush brush = /*(b & 0x80) == 0 ? light :*/ dark;
if ((b & 0x80) != 0)
g.FillRectangle(brush, j * PixelSize.Width * kx, k * PixelSize.Height * ky,
PixelSize.Width * kx, PixelSize.Height * ky);
}
}
Expand Down
3 changes: 1 addition & 2 deletions FastReport.Base/Barcode/BarcodeQR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,14 @@ internal override void Draw2DBarcode(IGraphicsRenderer g, float kx, float ky)
Brush light = Brushes.White;
Brush dark = new SolidBrush(Color);
GraphicsPath path = new GraphicsPath();
g.FillRectangle(light, 0, 0, matrix.Width * PixelSize * kx, matrix.Height * PixelSize * kx);

for (int y = 0; y < matrix.Height; y++)
{
for (int x = 0; x < matrix.Width; x++)
{
if (matrix.get_Renamed(x, y) == 0)
{
path.AddRectangle(new RectangleF(
g.PathAddRectangle(path, new RectangleF(
x * PixelSize * kx,
y * PixelSize * ky,
PixelSize * kx,
Expand Down
2 changes: 1 addition & 1 deletion FastReport.Base/Barcode/LinearBarcodeBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ internal override SizeF CalcBounds()
return new SizeF(drawArea.Width * 1.25f, 0);
}

internal override void DrawBarcode(IGraphicsRenderer g, RectangleF displayRect)
public override void DrawBarcode(IGraphicsRenderer g, RectangleF displayRect)
{
float originalWidth = CalcBounds().Width / 1.25f;
float width = angle == 90 || angle == 270 ? displayRect.Height : displayRect.Width;
Expand Down
6 changes: 3 additions & 3 deletions FastReport.Base/Border.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public enum BorderLines
/// <summary>
/// Represents a single border line.
/// </summary>
[TypeConverterAttribute("FastReport.TypeConverters.FRExpandableObjectConverter, FastReport")]
[TypeConverter(typeof(FastReport.TypeConverters.FRExpandableObjectConverter))]
public class BorderLine
{
#region Fields
Expand Down Expand Up @@ -259,8 +259,8 @@ internal BorderLine()
/// To turn on and off the lines, use the <see cref="Lines"/> property. To set the same color, style or width
/// for each line, use <see cref="Color"/>, <see cref="Style"/>, <see cref="Width"/> properties of the <b>Border</b>.
/// </remarks>
[TypeConverterAttribute("FastReport.TypeConverters.FRExpandableObjectConverter, FastReport")]
[EditorAttribute("FastReport.TypeEditors.BorderEditor, FastReport", typeof(UITypeEditor))]
[TypeConverter(typeof(FastReport.TypeConverters.FRExpandableObjectConverter))]
[Editor("FastReport.TypeEditors.BorderEditor, FastReport", typeof(UITypeEditor))]
public class Border
{
#region Fields
Expand Down
4 changes: 2 additions & 2 deletions FastReport.Base/BreakableComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public bool CanBreak
/// text that not fit in this object.
/// </summary>
[Category("Behavior")]
[TypeConverterAttribute("FastReport.TypeConverters.ComponentRefConverter, FastReport")]
[EditorAttribute("FastReport.TypeEditors.BandComponentRefEditor, FastReport", typeof(UITypeEditor))]
[TypeConverter(typeof(FastReport.TypeConverters.ComponentRefConverter))]
[Editor("FastReport.TypeEditors.BandComponentRefEditor, FastReport", typeof(UITypeEditor))]
public BreakableComponent BreakTo
{
get { return breakTo; }
Expand Down
2 changes: 1 addition & 1 deletion FastReport.Base/CapSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public enum CapStyle
/// <summary>
/// Specifies a start and end line caps.
/// </summary>
[TypeConverterAttribute("FastReport.TypeConverters.FRExpandableObjectConverter, FastReport")]
[TypeConverter(typeof(FastReport.TypeConverters.FRExpandableObjectConverter))]
public class CapSettings
{
private float width;
Expand Down
10 changes: 5 additions & 5 deletions FastReport.Base/CellularTextObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public partial class CellularTextObject : TextObject
/// automatically based on its font.
/// </remarks>
[Category("Appearance")]
[TypeConverterAttribute("FastReport.TypeConverters.UnitsConverter, FastReport")]
[TypeConverter("FastReport.TypeConverters.UnitsConverter, FastReport")]
public float CellWidth
{
get { return cellWidth; }
Expand All @@ -51,7 +51,7 @@ public float CellWidth
/// automatically based on its font.
/// </remarks>
[Category("Appearance")]
[TypeConverterAttribute("FastReport.TypeConverters.UnitsConverter, FastReport")]
[TypeConverter("FastReport.TypeConverters.UnitsConverter, FastReport")]
public float CellHeight
{
get { return cellHeight; }
Expand All @@ -62,7 +62,7 @@ public float CellHeight
/// Gets or sets the horizontal spacing between cells, in pixels.
/// </summary>
[Category("Appearance")]
[TypeConverterAttribute("FastReport.TypeConverters.UnitsConverter, FastReport")]
[TypeConverter("FastReport.TypeConverters.UnitsConverter, FastReport")]
public float HorzSpacing
{
get { return horzSpacing; }
Expand All @@ -73,7 +73,7 @@ public float HorzSpacing
/// Gets or sets the vertical spacing between cells, in pixels.
/// </summary>
[Category("Appearance")]
[TypeConverterAttribute("FastReport.TypeConverters.UnitsConverter, FastReport")]
[TypeConverter("FastReport.TypeConverters.UnitsConverter, FastReport")]
public float VertSpacing
{
get { return vertSpacing; }
Expand Down Expand Up @@ -264,7 +264,7 @@ public override void Draw(FRPaintEventArgs e)
}
}

internal TableObject GetTable()
public TableObject GetTable()
{
return GetTable(false);
}
Expand Down
2 changes: 1 addition & 1 deletion FastReport.Base/Data/Column.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public PropertyDescriptor PropDescriptor
/// <summary>
/// Gets or sets the type of data supplied by this column.
/// </summary>
[TypeConverter("FastReport.TypeConverters.DataTypeConverter, FastReport")]
[TypeConverter(typeof(FastReport.TypeConverters.DataTypeConverter))]
[Category("Data")]
[Editor("FastReport.TypeEditors.DataTypeEditor, FastReport", typeof(UITypeEditor))]
public Type DataType
Expand Down
2 changes: 1 addition & 1 deletion FastReport.Base/Data/CommandParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private enum ParamValue { Uninitialized }
/// <summary>
/// Gets or sets the parameter's data type.
/// </summary>
[TypeConverter("FastReport.TypeConverters.ParameterDataTypeConverter, FastReport")]
[TypeConverter(typeof(FastReport.TypeConverters.ParameterDataTypeConverter))]
[Category("Data")]
[Editor("FastReport.TypeEditors.ParameterDataTypeEditor, FastReport", typeof(UITypeEditor))]
public int DataType
Expand Down
4 changes: 2 additions & 2 deletions FastReport.Base/Data/CubeSourceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace FastReport.Data
/// <summary>
/// Base class for all CubeSources such as <see cref="SliceCubeSource"/>.
/// </summary>
[TypeConverter("FastReport.TypeConverters.CubeSourceConverter, FastReport")]
[EditorAttribute("FastReport.TypeEditors.CubeSourceEditor, FastReport", typeof(UITypeEditor))]
[TypeConverter(typeof(FastReport.TypeConverters.CubeSourceConverter))]
[Editor("FastReport.TypeEditors.CubeSourceEditor, FastReport", typeof(UITypeEditor))]
public abstract class CubeSourceBase : DataComponentBase
{
#region Fields
Expand Down
4 changes: 2 additions & 2 deletions FastReport.Base/Data/DataSourceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace FastReport.Data
/// <summary>
/// Base class for all datasources such as <see cref="TableDataSource"/>.
/// </summary>
[TypeConverter("FastReport.TypeConverters.DataSourceConverter, FastReport")]
[EditorAttribute("FastReport.TypeEditors.DataSourceEditor, FastReport", typeof(UITypeEditor))]
[TypeConverter(typeof(FastReport.TypeConverters.DataSourceConverter))]
[Editor("FastReport.TypeEditors.DataSourceEditor, FastReport", typeof(UITypeEditor))]
public abstract class DataSourceBase : Column
{
#region Fields
Expand Down
2 changes: 1 addition & 1 deletion FastReport.Base/Data/Parameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class Parameter : Base, IParent
/// <summary>
/// Gets or sets the type of parameter.
/// </summary>
[TypeConverter("FastReport.TypeConverters.DataTypeConverter, FastReport")]
[TypeConverter(typeof(FastReport.TypeConverters.DataTypeConverter))]
[Category("Data")]
[Editor("FastReport.TypeEditors.DataTypeEditor, FastReport", typeof(UITypeEditor))]
public Type DataType
Expand Down
2 changes: 1 addition & 1 deletion FastReport.Base/Data/Relation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace FastReport.Data
/// </code>
/// </example>
/// </remarks>
[TypeConverter("FastReport.TypeConverters.RelationConverter, FastReport")]
[TypeConverter(typeof(FastReport.TypeConverters.RelationConverter))]
public partial class Relation : DataComponentBase
{
#region Fields
Expand Down
2 changes: 1 addition & 1 deletion FastReport.Base/DataBand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public string ParentIdColumn
/// </remarks>
[DefaultValue(37.8f)]
[Category("Hierarchy")]
[TypeConverterAttribute("FastReport.TypeConverters.UnitsConverter, FastReport")]
[TypeConverter("FastReport.TypeConverters.UnitsConverter, FastReport")]
public float Indent
{
get { return indent; }
Expand Down
4 changes: 2 additions & 2 deletions FastReport.Base/Export/ExportBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,8 @@ internal void ExportPageNew(int pageNo)
try
{
page = ppage.StartGetPage(pageNo);
page.Width = ppage.PageSize.Width;
page.Height = ppage.PageSize.Height;
page.Width = ppage.PageSize.Width;
page.Height = ppage.PageSize.Height;
ExportPageBegin(page);
float topShift = 0;
foreach (Base obj in ppage.GetPageItems(page, false))
Expand Down
2 changes: 1 addition & 1 deletion FastReport.Base/Export/ExportUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static float GetPageHeight(ReportPage page)
return page.PaperHeight;
}

internal static string FloatToString(double value)
public static string FloatToString(double value)
{
NumberFormatInfo provider = new NumberFormatInfo();
provider.NumberGroupSeparator = String.Empty;
Expand Down
Loading

0 comments on commit da11368

Please sign in to comment.