iliaal / php_excel

PHP Extension interface to the Excel writing/reading library
http://ilia.ws
533 stars 131 forks source link

updateNamedRanges changes since LibXL 3.8.8 #265

Closed Jan-E closed 3 years ago

Jan-E commented 3 years ago

From the changelog:

Version 3.8.8 (2019-11-28)

In the C functions there is no third parameter anymore. But in the C++ functions we can see that the default for updateNamedRanges = true. The documentation says the same:

bool insertRow(int rowFirst, int rowLast, bool updateNamedRanges = true)
bool insertCol(int colFirst, int colLast, bool updateNamedRanges = true)
bool removeRow(int rowFirst, int rowLast, bool updateNamedRanges = true)
bool removeCol(int colFirst, int colLast, bool updateNamedRanges = true)

This should be reflected in the extension. Something like

  1. Allow three parameters in Sheet::insertCol etc
  2. If the third = true call xlSheetInsertColAndKeepRanges etc
  3. If the third = false or 0 call xlSheetInsertCol etc (?)
  4. If the third argument is omitted, use the default (true) ans call xlSheetInsertColAndKeepRanges etc
Jan-E commented 3 years ago

This should be it: https://github.com/Jan-E/php_excel/commit/b0b1219cd28b57759d5592c182ccff11b90c9ba5

Jan-E commented 3 years ago

Propably it is the other way around:

  1. Allow three parameters in Sheet::insertCol etc
  2. If the third = true call xlSheetInsertCol etc
  3. If the third = false or 0 call xlSheetInsertColAndKeepRanges etc
  4. If the third argument is omitted, use the default (true) ans call xlSheetInsertCol etc

AndKeepRanges seems to be the opposite of updateNamedRanges, but the documentation is really thin. New patch: https://github.com/Jan-E/php_excel/commit/da2fb8218aee5b4100329e77ba95e6357adeb858