Skip to content

Commit 18edc13

Browse files
vitali.prudnikovichiText-CI
authored andcommitted
Fix copy constructor of ConverterProperties to copy immediateFlush
DEVSIX-6984 Autoported commit. Original commit hash: [2983a77a0]
1 parent 2099dde commit 18edc13

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

itext.tests/itext.html2pdf.tests/itext/html2pdf/ConverterPropertiesTest.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ public virtual void SetEventMetaInfoAndGetTest() {
6363
NUnit.Framework.Assert.AreSame(testMetaInfo, metaInfo);
6464
}
6565

66+
[NUnit.Framework.Test]
67+
public virtual void CheckDefaultsTest() {
68+
ConverterProperties properties = new ConverterProperties();
69+
NUnit.Framework.Assert.IsTrue(properties.IsImmediateFlush());
70+
NUnit.Framework.Assert.IsFalse(properties.IsCreateAcroForm());
71+
NUnit.Framework.Assert.AreEqual(10, properties.GetLimitOfLayouts());
72+
properties.SetImmediateFlush(false);
73+
properties.SetCreateAcroForm(true);
74+
properties.SetLimitOfLayouts(20);
75+
ConverterProperties propertiesCopied = new ConverterProperties(properties);
76+
NUnit.Framework.Assert.IsFalse(propertiesCopied.IsImmediateFlush());
77+
NUnit.Framework.Assert.IsTrue(propertiesCopied.IsCreateAcroForm());
78+
NUnit.Framework.Assert.AreEqual(20, propertiesCopied.GetLimitOfLayouts());
79+
}
80+
6681
private class TestMetaInfo : IMetaInfo {
6782
}
6883
}

itext/itext.html2pdf/itext/html2pdf/ConverterProperties.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ public ConverterProperties(iText.Html2pdf.ConverterProperties other) {
127127
this.charset = other.charset;
128128
this.metaInfo = other.metaInfo;
129129
this.limitOfLayouts = other.limitOfLayouts;
130+
this.immediateFlush = other.immediateFlush;
130131
}
131132

132133
/// <summary>Gets the media device description.</summary>

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1cc41674ed2a869bccb7c1de44071f34de81bb34
1+
2983a77a0c2a4e28db08c84f6ceb1dfa3359b024

0 commit comments

Comments
 (0)