Skip to content

Commit 928ae02

Browse files
Samuel Huylebroeckpavel-alay
authored andcommitted
Clear up todos
DEVSIX-1050 Autoported commit. Original commit hash: [60b8c500]
1 parent 1fcd761 commit 928ae02

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

itext/itext.html2pdf/itext/html2pdf/attach/impl/layout/PageContextProcessor.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ internal class PageContextProcessor {
100100

101101
private ProcessorContext context;
102102

103+
/// <summary>The logger.</summary>
104+
private static readonly ILog LOGGER = LogManager.GetLogger(typeof(iText.Html2pdf.Attach.Impl.Layout.PageContextProcessor
105+
));
106+
103107
/// <summary>Instantiates a new page context processor.</summary>
104108
/// <param name="properties">the page context properties</param>
105109
/// <param name="context">the processor context</param>
@@ -157,19 +161,18 @@ internal static float GetMaxContentWidth(PageMarginBoxContextNode pmbcNode, Proc
157161
strategy.NextGlyphs();
158162
PdfFont currentFont = strategy.GetCurrentFont();
159163
if (currentFont == null) {
160-
//TODO(DEVSIX-1050) Warn and use pdf default
164+
LOGGER.Warn(iText.Html2pdf.LogMessageConstant.UNABLE_TO_RETRIEVE_FONT);
161165
try {
162166
currentFont = PdfFontFactory.CreateFont();
163167
}
164168
catch (System.IO.IOException) {
169+
LOGGER.Error(iText.Html2pdf.LogMessageConstant.ERROR_LOADING_FONT);
165170
}
166171
}
167-
//TODO throw exception further?
168172
return currentFont.GetWidth(content, fontSize);
169173
}
170174

171175
internal static float GetMinContentWidth(PageMarginBoxContextNode node, ProcessorContext context) {
172-
//TODO(DEVSIX-1050): reread spec to be certain that min-content-size does in fact mean the same as max content
173176
return GetMaxContentWidth(node, context);
174177
}
175178

@@ -936,8 +939,7 @@ private float[] CalculateDistribution(float argA, float argC, float flexA, float
936939
float flexRatioA;
937940
float flexRatioC;
938941
float flexSpace;
939-
if (sum == 0) {
940-
//TODO(DEVSIX-1050) float comparison to zero, revisit
942+
if (CssUtils.CompareFloats(sum, 0f)) {
941943
flexRatioA = 1;
942944
flexRatioC = 1;
943945
}

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8b6489b1533a0c4e870f525c46eca8d1f5b08099
1+
60b8c500dd81f60ae066e4bc89320d5be7ed30ef

0 commit comments

Comments
 (0)