A few fixs

Apr 16, 2010 at 5:14 AM
Edited Apr 16, 2010 at 5:17 AM

Hello: I'm starting to use this library and I did some changes because I got some errors.

1) In PHPWord.php I replace PHPWORD_BASE_PATH line for this

if (!defined('PHPWORD_BASE_PATH')) 
define('PHPWORD_BASE_PATH', dirname(__FILE__) . '/');

because before changing it I got errors.

2) The option spaceAfter and spaceBefore is not set for PreservedText. That's why, in the file PHPWord/writer/Word2007/Base.php I added to the method _writePreserveText the next piece of code, after the if of align

$spaceBefore = $style->getSpaceBefore();
$spaceAfter = $style->getSpaceAfter(); 

if(!is_null($spaceBefore) || !is_null($spaceAfter)) 
             $objWriter->writeAttribute('w:before', $spaceBefore); 
             $objWriter->writeAttribute('w:after', $spaceAfter);

I hope have been clear enough .... sorry for my english.... is not good...



Apr 16, 2010 at 2:54 PM

Thanks for the editing.

I will apply your changes to the next release.