Skip to content

Commit 96313c1

Browse files
authored
Merge pull request #39 from dotnet-campus/t/bot/fix-codeformatting
[Bot] Automated PR to fix formatting errors
2 parents 98b9b0f + b0c9450 commit 96313c1

5 files changed

Lines changed: 37 additions & 37 deletions

File tree

demo/DocumentFormat.OpenXml.Flatten.Demo/MAUI/MauiPptxViewerCore/PptxDocument.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public PptxDocument(DocumentModel documentModel)
2727
{
2828
// 获取页面内容
2929
Debug.Assert(slideId.RelationshipId != null, "slideId.RelationshipId != null");
30-
SlidePart slidePart = (SlidePart) presentationPart.GetPartById(slideId.RelationshipId!);
30+
SlidePart slidePart = (SlidePart)presentationPart.GetPartById(slideId.RelationshipId!);
3131

3232
Debug.Assert(slideId.Id is not null, "slideId.Id != null");
3333
var pptxSlide = new PptxSlide(slideId.Id!.Value, slidePart, documentModel);

demo/DocumentFormat.OpenXml.Flatten.Demo/WPF/MauiForWpf/Matrix3x2Extensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static Vector2 GetScale(this in Matrix3x2 matrix)
5252

5353
public static float GetRotation(this in Matrix3x2 matrix)
5454
{
55-
return (float) Math.Atan2(matrix.M12, matrix.M11);
55+
return (float)Math.Atan2(matrix.M12, matrix.M11);
5656
}
5757

5858
public static Vector2 GetTranslation(this in Matrix3x2 matrix)
@@ -135,7 +135,7 @@ public static float GetLengthScale(this in Matrix3x2 matrix)
135135
{
136136
var determinant = matrix.GetDeterminant();
137137
var areaScale = Math.Abs(determinant);
138-
return (float) Math.Sqrt(areaScale);
138+
return (float)Math.Sqrt(areaScale);
139139
}
140140

141141
public static void CopyTo(this in Matrix3x2 matrix, float[] dst, int offset = 0, int count = 6)
@@ -163,7 +163,7 @@ public static Vector2 Transform(this Matrix3x2 target, float x, float y)
163163
public static void DeconstructScales(this in Matrix3x2 value, out float scale, out float scalex, out float scaley)
164164
{
165165
var det = value.GetDeterminant();
166-
scale = (float) Math.Sqrt(Math.Abs(det));
166+
scale = (float)Math.Sqrt(Math.Abs(det));
167167
scalex = value.M12 == 0 ? Math.Abs(value.M11) : new Vector2(value.M11, value.M12).Length();
168168
scaley = value.M21 == 0 ? Math.Abs(value.M22) : new Vector2(value.M21, value.M22).Length();
169169
if (det < 0) scaley = -scaley;

demo/DocumentFormat.OpenXml.Flatten.Demo/WPF/MauiForWpf/XamlCanvas.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ protected override void PlatformRotate(float degrees, float radians, float x, fl
283283
protected override void PlatformDrawPath(PathF path)
284284
{
285285
var item = GetOrCreateItem(ItemType.DrawPath);
286-
var element = (Path) item.Element;
286+
var element = (Path)item.Element;
287287
var transformedPath = path;
288288
if (!CurrentState.Transform.IsIdentity)
289289
{
@@ -309,7 +309,7 @@ protected override void PlatformDrawPath(PathF path)
309309
protected override void PlatformDrawEllipse(float x, float y, float width, float height)
310310
{
311311
var item = GetOrCreateItem(ItemType.DrawEllipse);
312-
var element = (Ellipse) item.Element;
312+
var element = (Ellipse)item.Element;
313313

314314
CreateStrokeRect(x, y, width, height);
315315

@@ -334,7 +334,7 @@ protected override void PlatformDrawEllipse(float x, float y, float width, float
334334
protected override void PlatformDrawRoundedRectangle(float x, float y, float width, float height, float cornerRadius)
335335
{
336336
var item = GetOrCreateItem(ItemType.DrawRoundedRectangle);
337-
var element = (global::System.Windows.Shapes.Rectangle) item.Element;
337+
var element = (global::System.Windows.Shapes.Rectangle)item.Element;
338338

339339
CreateStrokeRoundedRect(x, y, width, height, cornerRadius);
340340

@@ -361,7 +361,7 @@ protected override void PlatformDrawRoundedRectangle(float x, float y, float wid
361361
protected override void PlatformDrawRectangle(float x, float y, float width, float height)
362362
{
363363
var item = GetOrCreateItem(ItemType.DrawRectangle);
364-
var element = (global::System.Windows.Shapes.Rectangle) item.Element;
364+
var element = (global::System.Windows.Shapes.Rectangle)item.Element;
365365

366366
CreateStrokeRect(x, y, width, height);
367367

@@ -398,13 +398,13 @@ protected override void PlatformDrawArc(float x, float y, float width, float hei
398398
}
399399

400400
var item = GetOrCreateItem(ItemType.DrawArc);
401-
var element = (Path) item.Element;
401+
var element = (Path)item.Element;
402402

403403
CreateArcStrokeRect(x, y, width, height);
404404

405-
var geometry = (PathGeometry) element.Data;
405+
var geometry = (PathGeometry)element.Data;
406406
var figure = geometry.Figures[0];
407-
var arcSegment = (ArcSegment) figure.Segments[0];
407+
var arcSegment = (ArcSegment)figure.Segments[0];
408408

409409
var sweep = GeometryUtil.GetSweep(startAngle, endAngle, clockwise);
410410
var absSweep = Math.Abs(sweep);
@@ -429,7 +429,7 @@ protected override void PlatformDrawArc(float x, float y, float width, float hei
429429
}
430430
else
431431
{
432-
lineSegment = (LineSegment) figure.Segments[1];
432+
lineSegment = (LineSegment)figure.Segments[1];
433433
}
434434

435435
lineSegment.Point = new global::System.Windows.Point(startPoint.X, startPoint.Y);
@@ -461,7 +461,7 @@ protected override void PlatformDrawArc(float x, float y, float width, float hei
461461
protected override void PlatformDrawLine(float x1, float y1, float x2, float y2)
462462
{
463463
var item = GetOrCreateItem(ItemType.DrawLine);
464-
var element = (Line) item.Element;
464+
var element = (Line)item.Element;
465465

466466
var p1 = CurrentState.Transform.Transform(x1, y1);
467467
var p2 = CurrentState.Transform.Transform(x2, y2);
@@ -555,8 +555,8 @@ public override void DrawString(
555555
CreateFillRect(x, y, width, height);
556556

557557
var item = GetOrCreateItem(ItemType.DrawTextInRect);
558-
var element = (Border) item.Element;
559-
var block = (TextBlock) element.Child;
558+
var element = (Border)item.Element;
559+
var block = (TextBlock)element.Child;
560560

561561
block.Text = value;
562562

@@ -610,7 +610,7 @@ public override void DrawString(
610610
public override void DrawString(string value, float x, float y, HorizontalAlignment horizontalAlignment)
611611
{
612612
var item = GetOrCreateItem(ItemType.DrawText);
613-
var element = (TextBlock) item.Element;
613+
var element = (TextBlock)item.Element;
614614
element.Text = value;
615615

616616
switch (horizontalAlignment)
@@ -650,7 +650,7 @@ public override void DrawText(IAttributedText value, float x, float y, float wid
650650
public override void FillEllipse(float x, float y, float width, float height)
651651
{
652652
var item = GetOrCreateItem(ItemType.FillEllipse);
653-
var element = (Ellipse) item.Element;
653+
var element = (Ellipse)item.Element;
654654

655655
CreateFillRect(x, y, width, height);
656656

@@ -668,7 +668,7 @@ public override void FillEllipse(float x, float y, float width, float height)
668668
public override void FillRoundedRectangle(float x, float y, float width, float height, float cornerRadius)
669669
{
670670
var item = GetOrCreateItem(ItemType.FillRoundedRectangle);
671-
var element = (global::System.Windows.Shapes.Rectangle) item.Element;
671+
var element = (global::System.Windows.Shapes.Rectangle)item.Element;
672672

673673
CreateFillRect(x, y, width, height);
674674

@@ -700,7 +700,7 @@ public override void FillRoundedRectangle(float x, float y, float width, float h
700700
public override void FillRectangle(float x, float y, float width, float height)
701701
{
702702
var item = GetOrCreateItem(ItemType.FillRectangle);
703-
var element = (global::System.Windows.Shapes.Rectangle) item.Element;
703+
var element = (global::System.Windows.Shapes.Rectangle)item.Element;
704704

705705
CreateFillRect(x, y, width, height);
706706

@@ -783,7 +783,7 @@ public override IFont Font
783783
public override void FillPath(PathF path, WindingMode windingMode)
784784
{
785785
var item = GetOrCreateItem(ItemType.FillPath);
786-
var element = (Path) item.Element;
786+
var element = (Path)item.Element;
787787

788788
var transformedPath = path;
789789
if (!CurrentState.Transform.IsIdentity)
@@ -826,13 +826,13 @@ public override void FillArc(float x, float y, float width, float height, float
826826
}
827827

828828
var item = GetOrCreateItem(ItemType.FillArc);
829-
var element = (Path) item.Element;
829+
var element = (Path)item.Element;
830830

831831
CreateFillRect(x, y, width, height);
832832

833-
var geometry = (PathGeometry) element.Data;
833+
var geometry = (PathGeometry)element.Data;
834834
var figure = geometry.Figures[0];
835-
var arcSegment = (ArcSegment) figure.Segments[0];
835+
var arcSegment = (ArcSegment)figure.Segments[0];
836836

837837
var sweep = GeometryUtil.GetSweep(startAngle, endAngle, clockwise);
838838
var absSweep = Math.Abs(sweep);

demo/DocumentFormat.OpenXml.Flatten.Demo/WPF/MauiForWpf/XamlCanvasState.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ public Brush XamlFillBrush
7474

7575
if (_fillPaint is LinearGradientPaint linearGradientPaint)
7676
{
77-
float x1 = (float) (linearGradientPaint.StartPoint.X * _fillRectangle.Width);
78-
float y1 = (float) (linearGradientPaint.StartPoint.Y * _fillRectangle.Height);
77+
float x1 = (float)(linearGradientPaint.StartPoint.X * _fillRectangle.Width);
78+
float y1 = (float)(linearGradientPaint.StartPoint.Y * _fillRectangle.Height);
7979

80-
float x2 = (float) (linearGradientPaint.EndPoint.X * _fillRectangle.Width);
81-
float y2 = (float) (linearGradientPaint.EndPoint.Y * _fillRectangle.Height);
80+
float x2 = (float)(linearGradientPaint.EndPoint.X * _fillRectangle.Width);
81+
float y2 = (float)(linearGradientPaint.EndPoint.Y * _fillRectangle.Height);
8282

8383
var brush = new LinearGradientBrush
8484
{
@@ -95,9 +95,9 @@ public Brush XamlFillBrush
9595

9696
if (_fillPaint is RadialGradientPaint radialGradientPaint)
9797
{
98-
float centerX = (float) (radialGradientPaint.Center.X * _fillRectangle.Width);
99-
float centerY = (float) (radialGradientPaint.Center.Y * _fillRectangle.Height);
100-
float radius = (float) radialGradientPaint.Radius * Math.Max(_fillRectangle.Height, _fillRectangle.Width);
98+
float centerX = (float)(radialGradientPaint.Center.X * _fillRectangle.Width);
99+
float centerY = (float)(radialGradientPaint.Center.Y * _fillRectangle.Height);
100+
float radius = (float)radialGradientPaint.Radius * Math.Max(_fillRectangle.Height, _fillRectangle.Width);
101101

102102
if (radius == 0)
103103
radius = GeometryUtil.GetDistance(_fillRectangle.Left, _fillRectangle.Top, _fillRectangle.Right, _fillRectangle.Bottom);
@@ -389,7 +389,7 @@ private TransformGroup CreateCopy(TransformGroup prototype)
389389
public void XamlScale(float sx, float sy)
390390
{
391391
InitGroup();
392-
var transform = new ScaleTransform((double) sx, (double) sy);
392+
var transform = new ScaleTransform((double)sx, (double)sy);
393393
_transformGroup.Children.Add(transform);
394394
}
395395

demo/DocumentFormat.OpenXml.Flatten.Demo/WPF/MauiForWpf/XamlGraphicsExtensions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ public static System.Windows.Media.Color AsWpfColor(this Color target)
1111
{
1212
return System.Windows.Media.Color.FromArgb
1313
(
14-
(byte) (255 * target.Alpha),
15-
(byte) (255 * target.Red),
16-
(byte) (255 * target.Green),
17-
(byte) (255 * target.Blue)
14+
(byte)(255 * target.Alpha),
15+
(byte)(255 * target.Red),
16+
(byte)(255 * target.Green),
17+
(byte)(255 * target.Blue)
1818
);
1919
}
2020

2121
public static PointF AsPointF(this global::System.Windows.Point point)
2222
{
23-
return new PointF((float) point.X, (float) point.Y);
23+
return new PointF((float)point.X, (float)point.Y);
2424
}
2525

2626
public static global::System.Windows.Point AsPoint(this PointF target)
@@ -134,7 +134,7 @@ public static PathGeometry AsPathGeometry(this PathF target, float scale = 1)
134134
}
135135
else
136136
{
137-
137+
138138
}
139139
}
140140

0 commit comments

Comments
 (0)