private function _moveRowSegments()
    {
        // Search all possible rows in the document
        $reg1 = "#<table:table-row[^>]*>(.*)</table:table-row>#smU";
        preg_match_all($reg1, $this->contentXml, $matches);
        for ($i = 0, $size = count($matches[0]); $i < $size; $i++) {
            // Check if the current row contains a segment row.*
            $reg2 = '#\[!--\sBEGIN\s(row.[\S]*)\s--\](.*)\[!--\sEND\s\\1\s--\]#smU';
            if (preg_match($reg2, $matches[0][$i], $matches2)) {
                $balise = str_replace('row.', '', $matches2[1]);
                // Move segment tags around the row
                $replace = array(
                    '[!-- BEGIN ' . $matches2[1] . ' --]'   => '',
                    '[!-- END ' . $matches2[1] . ' --]'     => '',
                    '<table:table-row'                          => '[!-- BEGIN ' . $balise . ' --]<table:table-row',
                    '</table:table-row>'                        => '</table:table-row>[!-- END ' . $balise . ' --]'
                );
                $replacedXML = str_replace(array_keys($replace), array_values($replace), $matches[0][$i]);
                $this->contentXml = str_replace($matches[0][$i], $replacedXML, $this->contentXml);
            }
        }
    }
private function _moveRowSegments()
    {
        // Search all possible rows in the document
        $reg1 = "#<table:table-row[^>]*>(.*)</table:table-row>#smU";
        preg_match_all($reg1, $this->contentXml, $matches);
        for ($i = 0, $size = count($matches[0]); $i < $size; $i++) {
            // Check if the current row contains a segment row.*
            $reg2 = '#\[!--\sBEGIN\s(row.[\S]*)\s--\](.*)\[!--\sEND\s\\1\s--\]#smU';
            if (preg_match($reg2, $matches[0][$i], $matches2)) {
                $balise = str_replace('row.', '', $matches2[1]);
                // Move segment tags around the row
                $replace = array(
                    '[!-- BEGIN ' . $matches2[1] . ' --]'   => '',
                    '[!-- END ' . $matches2[1] . ' --]'     => '',
                    '<table:table-row'                          => '[!-- BEGIN ' . $balise . ' --]<table:table-row',
                    '</table:table-row>'                        => '</table:table-row>[!-- END ' . $balise . ' --]'
                );
                $replacedXML = str_replace(array_keys($replace), array_values($replace), $matches[0][$i]);
                $this->contentXml = str_replace($matches[0][$i], $replacedXML, $this->contentXml);
            }
        }
    }
private function _moveRowSegments ( ) { // Search all possible rows in the document $ reg1 = "#<table:table-row[^>]*>(.*)</table:table-row>#smU" ; preg_match_all ( $ reg1 , $ this -> contentXml , $ matches ) ; for ( $ i = 0 , $ size = count ( $ matches [ 0 ] ) ; $ i < $ size ; $ i ++ ) { // Check if the current row contains a segment row.* $ reg2 = '#\[!--\sBEGIN\s(row.[\S]*)\s--\](.*)\[!--\sEND\s\\1\s--\]#smU' ; if ( preg_match ( $ reg2 , $ matches [ 0 ] [ $ i ] , $ matches2 ) ) { $ balise = str_replace ( 'row.' , '' , $ matches2 [ 1 ] ) ; // Move segment tags around the row $ replace = array ( '[!-- BEGIN ' . $ matches2 [ 1 ] . ' --]' => '' , '[!-- END ' . $ matches2 [ 1 ] . ' --]' => '' , '<table:table-row' => '[!-- BEGIN ' . $ balise . ' --]<table:table-row' , '</table:table-row>' => '</table:table-row>[!-- END ' . $ balise . ' --]' ) ; $ replacedXML = str_replace ( array_keys ( $ replace ) , array_values ( $ replace ) , $ matches [ 0 ] [ $ i ] ) ; $ this -> contentXml = str_replace ( $ matches [ 0 ] [ $ i ] , $ replacedXML , $ this -> contentXml ) ; } } }
Move segment tags for lines of tables
Called automatically within the constructor

@return void
Move segment tags for lines of tables Called automatically within the constructor