The branch, master has been updated
via 25b78bef1b0595ef37c2855d0f070563d8e80116 (commit)
via cd294e5b97c723fa85e29d2b2c43eaa48e60c60a (commit)
from 6c608b808ca44e6b504ef099f451a2b1df46e653 (commit)
- Log -----------------------------------------------------------------
commit 25b78bef1b0595ef37c2855d0f070563d8e80116
Merge: 6c608b8 cd294e5
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sat Dec 24 21:33:35 2011 +0530
Merge branch 'QA_3_4'
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 1 +
libraries/import/ods.php | 38 ++++++++++++++++++++++----------------
2 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index daf4cb4..b5e712a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -70,6 +70,7 @@ phpMyAdmin - ChangeLog
3.4.10.0 (not yet released)
- bug #3460090 [interface] TextareaAutoSelect feature broken
- patch #3375984 [export] PHP Array export might generate invalid php code
+- bug #3049209 [import] Import from ODS ignores cell that is the same as cell before
3.4.9.0 (2011-12-21)
- bug #3442028 [edit] Inline editing enum fields with null shows no dropdown
diff --git a/libraries/import/ods.php b/libraries/import/ods.php
index 8af40f4..c9ede1c 100644
--- a/libraries/import/ods.php
+++ b/libraries/import/ods.php
@@ -117,25 +117,31 @@ foreach ($sheets as $sheet) {
$cell_attrs = $cell->attributes('office', true);
if (count($text) != 0) {
- if (! $col_names_in_first_row) {
- if ($_REQUEST['ods_recognize_percentages'] &&
!strcmp('percentage', $cell_attrs['value-type'])) {
- $tempRow[] = (double)$cell_attrs['value'];
- } elseif ($_REQUEST['ods_recognize_currency'] &&
!strcmp('currency', $cell_attrs['value-type'])) {
- $tempRow[] = (double)$cell_attrs['value'];
- } else {
- $tempRow[] = (string)$text;
- }
- } else {
- if ($_REQUEST['ods_recognize_percentages'] &&
!strcmp('percentage', $cell_attrs['value-type'])) {
- $col_names[] = (double)$cell_attrs['value'];
- } else if ($_REQUEST['ods_recognize_currency'] &&
!strcmp('currency', $cell_attrs['value-type'])) {
- $col_names[] = (double)$cell_attrs['value'];
+ $attr = $cell->attributes('table', true);
+ $num_repeat = (int) $attr['number-columns-repeated'];
+ $num_iterations = $num_repeat ? $num_repeat : 1;
+
+ for ($k = 0; $k < $num_iterations; $k++) {
+ if (! $col_names_in_first_row) {
+ if ($_REQUEST['ods_recognize_percentages'] &&
!strcmp('percentage', $cell_attrs['value-type'])) {
+ $tempRow[] = (double)$cell_attrs['value'];
+ } elseif ($_REQUEST['ods_recognize_currency']
&& !strcmp('currency', $cell_attrs['value-type'])) {
+ $tempRow[] = (double)$cell_attrs['value'];
+ } else {
+ $tempRow[] = (string)$text;
+ }
} else {
- $col_names[] = (string)$text;
+ if ($_REQUEST['ods_recognize_percentages'] &&
!strcmp('percentage', $cell_attrs['value-type'])) {
+ $col_names[] = (double)$cell_attrs['value'];
+ } else if ($_REQUEST['ods_recognize_currency']
&& !strcmp('currency', $cell_attrs['value-type'])) {
+ $col_names[] = (double)$cell_attrs['value'];
+ } else {
+ $col_names[] = (string)$text;
+ }
}
- }
- ++$col_count;
+ ++$col_count;
+ }
} else {
/* Number of blank columns repeated */
if ($col_count < count($row->children('table', true)) -
1) {
hooks/post-receive
--
phpMyAdmin