Browse Source

Improved validation for table configuration

Marcin Ziąbek 2 years ago
parent
commit
87797a7afd

+ 6 - 0
Source/QuestPDF/Elements/Table/TableLayoutValidator.cs

@@ -25,6 +25,12 @@ namespace QuestPDF.Elements.Table
                 if (cell.Row < 1)
                 if (cell.Row < 1)
                     throw new DocumentComposeException($"{prefix} A cell row position should be greater or equal to 1. Got {cell.Row}.");
                     throw new DocumentComposeException($"{prefix} A cell row position should be greater or equal to 1. Got {cell.Row}.");
                 
                 
+                if (cell.ColumnSpan < 1)
+                    throw new DocumentComposeException($"{prefix} A cell must span at least one column. Got {cell.ColumnSpan}.");
+                
+                if (cell.RowSpan < 1)
+                    throw new DocumentComposeException($"{prefix} A cell must span at least one row. Got {cell.RowSpan}.");
+                
                 if (cell.Column > columnsCount)
                 if (cell.Column > columnsCount)
                     throw new DocumentComposeException($"{prefix} Cell starts at column that does not exist. Cell details: {GetCellDetails(cell)}.");
                     throw new DocumentComposeException($"{prefix} Cell starts at column that does not exist. Cell details: {GetCellDetails(cell)}.");
                 
                 

+ 19 - 0
Source/QuestPDF/Resources/Documentation.xml

@@ -95,6 +95,25 @@
             </para>
             </para>
         </remarks>
         </remarks>
     </doc>
     </doc>
+
+    <doc for="text.returns.spanDescriptor">
+        <returns>Handler that allows to customize style of the text span, e.g. color, size, text color, background, etc.</returns>
+    </doc>
+
+    <doc for="text.returns.pageNumberDescriptor">
+        <returns>
+            <para>Handler that allows to customize style of the text span, e.g. color, size, text color, background, etc.</para>
+            <para>It also allows to change text formatting, e.g. represent page number as a roman numeral</para>
+        </returns>
+    </doc>
+
+    <doc for="param.sectionName">
+        <param name="sectionName">The text key corresponding to the value used when defining the <see cref="ElementExtensions.Section">Section</see> element.</param>
+    </doc>
+
+    <doc for="param.url">
+        <param name="url">The URL of the webpage to which the user will be redirected.</param>
+    </doc>
     
     
     <!-- TEXT ATTRIBUTES -->
     <!-- TEXT ATTRIBUTES -->