@@ -14,11 +14,11 @@ class Workbook extends WriterPart
14
14
/**
15
15
* Write workbook to XML format.
16
16
*
17
- * @param bool $recalcRequired Indicate whether formulas should be recalculated before writing
17
+ * @param bool $preCalculateFormulas If true, formulas will be calculated before writing
18
18
*
19
19
* @return string XML Output
20
20
*/
21
- public function writeWorkbook (Spreadsheet $ spreadsheet , bool $ recalcRequired = false ): string
21
+ public function writeWorkbook (Spreadsheet $ spreadsheet , bool $ preCalculateFormulas = false ): string
22
22
{
23
23
// Create XML writer
24
24
if ($ this ->getParentWriter ()->getUseDiskCaching ()) {
@@ -57,7 +57,7 @@ public function writeWorkbook(Spreadsheet $spreadsheet, bool $recalcRequired = f
57
57
(new DefinedNamesWriter ($ objWriter , $ spreadsheet ))->write ();
58
58
59
59
// calcPr
60
- $ this ->writeCalcPr ($ objWriter , $ recalcRequired );
60
+ $ this ->writeCalcPr ($ objWriter , $ preCalculateFormulas );
61
61
62
62
$ objWriter ->endElement ();
63
63
@@ -146,9 +146,9 @@ private function writeWorkbookProtection(XMLWriter $objWriter, Spreadsheet $spre
146
146
/**
147
147
* Write calcPr.
148
148
*
149
- * @param bool $recalcRequired Indicate whether formulas should be recalculated before writing
149
+ * @param bool $preCalculateFormulas If true, formulas will be calculated before writing
150
150
*/
151
- private function writeCalcPr (XMLWriter $ objWriter , bool $ recalcRequired = true ): void
151
+ private function writeCalcPr (XMLWriter $ objWriter , bool $ preCalculateFormulas = true ): void
152
152
{
153
153
$ objWriter ->startElement ('calcPr ' );
154
154
@@ -157,10 +157,10 @@ private function writeCalcPr(XMLWriter $objWriter, bool $recalcRequired = true):
157
157
// because the file has changed
158
158
$ objWriter ->writeAttribute ('calcId ' , '999999 ' );
159
159
$ objWriter ->writeAttribute ('calcMode ' , 'auto ' );
160
- // fullCalcOnLoad isn't needed if we've recalculating for the save
161
- $ objWriter ->writeAttribute ('calcCompleted ' , ($ recalcRequired ) ? '1 ' : '0 ' );
162
- $ objWriter ->writeAttribute ('fullCalcOnLoad ' , ($ recalcRequired ) ? '0 ' : '1 ' );
163
- $ objWriter ->writeAttribute ('forceFullCalc ' , ($ recalcRequired ) ? '0 ' : '1 ' );
160
+ // fullCalcOnLoad isn't needed if we will calculate before writing
161
+ $ objWriter ->writeAttribute ('calcCompleted ' , ($ preCalculateFormulas ) ? '1 ' : '0 ' );
162
+ $ objWriter ->writeAttribute ('fullCalcOnLoad ' , ($ preCalculateFormulas ) ? '0 ' : '1 ' );
163
+ $ objWriter ->writeAttribute ('forceFullCalc ' , ($ preCalculateFormulas ) ? '0 ' : '1 ' );
164
164
165
165
$ objWriter ->endElement ();
166
166
}
0 commit comments