Skip to content

Commit b96e8e4

Browse files
Snipxitext-teamcity
authored andcommitted
Refactor log messages with non-initialized occupied area
The message has been changed to a generic one and explanations are added in-place whenever needed DEVSIX-1381 Autoported commit. Original commit hash: [9eb8df0ae]
1 parent c0d89c1 commit b96e8e4

File tree

9 files changed

+20
-12
lines changed

9 files changed

+20
-12
lines changed

itext/itext.io/itext/io/LogMessageConstant.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public sealed class LogMessageConstant {
126126

127127
public const String POPUP_ENTRY_IS_NOT_POPUP_ANNOTATION = "Popup entry in the markup annotations refers not to the annotation with Popup subtype.";
128128

129-
public const String OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED = "Occupied area hasn't been initialized. Drawing won't be performed";
129+
public const String OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED = "Occupied area has not been initialized. {0}";
130130

131131
public const String OCSP_STATUS_IS_REVOKED = "OCSP status is revoked.";
132132

itext/itext.layout/itext/layout/renderer/AbstractRenderer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,8 @@ protected internal virtual void AlignChildHorizontally(IRenderer childRenderer,
10601060
}
10611061
catch (ArgumentNullException) {
10621062
ILogger logger = LoggerFactory.GetLogger(typeof(iText.Layout.Renderer.AbstractRenderer));
1063-
logger.Error(iText.IO.LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED);
1063+
logger.Error(String.Format(iText.IO.LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED, "Some of the children might not end up aligned horizontally."
1064+
));
10641065
}
10651066
}
10661067
}

itext/itext.layout/itext/layout/renderer/BlockRenderer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,8 @@ protected internal virtual AbstractRenderer CreateOverflowRenderer(int layoutRes
449449
public override void Draw(DrawContext drawContext) {
450450
if (occupiedArea == null) {
451451
ILogger logger = LoggerFactory.GetLogger(typeof(iText.Layout.Renderer.BlockRenderer));
452-
logger.Error(iText.IO.LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED);
452+
logger.Error(String.Format(iText.IO.LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED, "Drawing won't be performed."
453+
));
453454
return;
454455
}
455456
PdfDocument document = drawContext.GetDocument();

itext/itext.layout/itext/layout/renderer/ImageRenderer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ public override LayoutResult Layout(LayoutContext layoutContext) {
255255
public override void Draw(DrawContext drawContext) {
256256
if (occupiedArea == null) {
257257
ILogger logger = LoggerFactory.GetLogger(typeof(iText.Layout.Renderer.ImageRenderer));
258-
logger.Error(iText.IO.LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED);
258+
logger.Error(String.Format(iText.IO.LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED, "Drawing won't be performed."
259+
));
259260
return;
260261
}
261262
ApplyMargins(occupiedArea.GetBBox(), false);

itext/itext.layout/itext/layout/renderer/LinkRenderer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ public LinkRenderer(Link linkElement, String text)
7676
public override void Draw(DrawContext drawContext) {
7777
if (occupiedArea == null) {
7878
ILogger logger = LoggerFactory.GetLogger(typeof(iText.Layout.Renderer.LinkRenderer));
79-
logger.Error(iText.IO.LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED);
79+
logger.Error(String.Format(iText.IO.LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED, "Drawing won't be performed."
80+
));
8081
return;
8182
}
8283
base.Draw(drawContext);

itext/itext.layout/itext/layout/renderer/ListItemRenderer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ public override LayoutResult Layout(LayoutContext layoutContext) {
9292
public override void Draw(DrawContext drawContext) {
9393
if (occupiedArea == null) {
9494
ILogger logger = LoggerFactory.GetLogger(typeof(iText.Layout.Renderer.ListItemRenderer));
95-
logger.Error(iText.IO.LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED);
95+
logger.Error(String.Format(iText.IO.LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED, "Drawing won't be performed."
96+
));
9697
return;
9798
}
9899
bool isTagged = drawContext.IsTaggingEnabled() && GetModelElement() is IAccessibleElement;

itext/itext.layout/itext/layout/renderer/TabRenderer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ source product.
4141
For more information, please contact iText Software Corp. at this
4242
4343
*/
44+
using System;
4445
using iText.IO.Log;
4546
using iText.Kernel.Geom;
4647
using iText.Kernel.Pdf.Canvas;
@@ -73,7 +74,8 @@ public override LayoutResult Layout(LayoutContext layoutContext) {
7374
public override void Draw(DrawContext drawContext) {
7475
if (occupiedArea == null) {
7576
ILogger logger = LoggerFactory.GetLogger(typeof(iText.Layout.Renderer.TabRenderer));
76-
logger.Error(iText.IO.LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED);
77+
logger.Error(String.Format(iText.IO.LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED, "Drawing won't be performed."
78+
));
7779
return;
7880
}
7981
ILineDrawer leader = this.GetProperty<ILineDrawer>(Property.TAB_LEADER);

itext/itext.layout/itext/layout/renderer/TextRenderer.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,8 @@ public virtual void ApplyOtf() {
516516
public override void Draw(DrawContext drawContext) {
517517
if (occupiedArea == null) {
518518
ILogger logger = LoggerFactory.GetLogger(typeof(iText.Layout.Renderer.TextRenderer));
519-
logger.Error(iText.IO.LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED);
519+
logger.Error(String.Format(iText.IO.LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED, "Drawing won't be performed."
520+
));
520521
return;
521522
}
522523
// Set up marked content before super.draw so that annotations are placed within marked content
@@ -647,7 +648,7 @@ public override void Draw(DrawContext drawContext) {
647648
if (horizontalScaling != null && horizontalScaling != 1) {
648649
canvas.SetHorizontalScaling((float)horizontalScaling * 100);
649650
}
650-
GlyphLine.IGlyphLineFilter filter = new _IGlyphLineFilter_682();
651+
GlyphLine.IGlyphLineFilter filter = new _IGlyphLineFilter_683();
651652
bool appearanceStreamLayout = true.Equals(GetPropertyAsBoolean(Property.APPEARANCE_STREAM_LAYOUT));
652653
if (GetReversedRanges() != null) {
653654
bool writeReversedChars = !appearanceStreamLayout;
@@ -711,8 +712,8 @@ public override void Draw(DrawContext drawContext) {
711712
}
712713
}
713714

714-
private sealed class _IGlyphLineFilter_682 : GlyphLine.IGlyphLineFilter {
715-
public _IGlyphLineFilter_682() {
715+
private sealed class _IGlyphLineFilter_683 : GlyphLine.IGlyphLineFilter {
716+
public _IGlyphLineFilter_683() {
716717
}
717718

718719
public bool Accept(Glyph glyph) {

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1dfb78f8b8cc2378676c51546a852c0d87ee3075
1+
9eb8df0ae7a39a045bb73755f965a691197ba838

0 commit comments

Comments
 (0)