]> git.lyx.org Git - lyx.git/blobdiff - lib/reLyX/RelyxTable.pm
reverting previous, accidental commit
[lyx.git] / lib / reLyX / RelyxTable.pm
index 3bf797be59817d765b6b2651a7ae9cda28cfc779..72b8837c4ceef97b87f418a18525666eeac5ea9f 100644 (file)
@@ -457,7 +457,13 @@ package RelyxTable::Row;
        $i++;
 
        # What if it was a multicolumn?
-       $i++ while ${$row->{"cells"}}[$i]->{"multicolumn"} eq "part";
+       # $rcells holds a reference to the array of cells
+       my $rcells = \@{$row->{"cells"}};
+       # Paranoia check that we're not attempting to access beyond the
+       # end of the array in case reLyX failed to parse the number of
+       # columns correctly.
+       $i++ while ($i < @{$rcells} &&
+                   ${$rcells}[$i]->{"multicolumn"} eq "part");
 
        $row->{"curr_col"} = $i;
     } # end of sub nextcol