From: <nma...@us...> - 2006-03-29 11:01:19
|
Revision: 40 Author: nmarkgraf Date: 2006-03-29 03:01:01 -0800 (Wed, 29 Mar 2006) ViewCVS: http://svn.sourceforge.net/opendocumentphp/?rev=40&view=rev Log Message: ----------- Minor updates: - Fixed some bugs in the OpenDocumentSingle, Styles and FontFaceDeclaration classes. - PHing now removes "?><?php" lines when make solid file. TestOutput now works, but OpenOffice still does not take the document as it should be. This is a BUG that must be solved before 0.5.0 can be announced. Modified Paths: -------------- poc/build.xml poc/src/OpenDocumentSingle.php poc/src/samples/TestOutput.php poc/src/styles/FontFaceDeclaration.php poc/src/styles/Styles.php Modified: poc/build.xml =================================================================== --- poc/build.xml 2006-03-29 08:59:58 UTC (rev 39) +++ poc/build.xml 2006-03-29 11:01:01 UTC (rev 40) @@ -134,9 +134,15 @@ </copy> <!-- echo msg="${OpenDocumentPHPSolid}"/--> <!-- echo msg="${os.name}"/--> - <exec command="copy ..\etc\solid.txt + *.php + manifest\*.php + content\*.php + settings\*.php + styles\*.php tmp.tmp" dir="solid-production"/> + <exec command="copy ..\etc\solid.txt + *.php + manifest\*.php + content\*.php + settings\*.php + styles\*.php + meta\*.php tmp.tmp" dir="solid-production"/> <exec command="cat ../etc/solid.txt > ../tmp.tmp && cat *.php >> ../tmp.tmp && cat */*.php >> ../tmp.tmp" dir="solid-production" os="linux"/> - <copy file="solid-production/tmp.tmp" tofile="dist/${OpenDocumentPHPSolid}" overwrite="true"/> + <copy file="solid-production/tmp.tmp" tofile="dist/${OpenDocumentPHPSolid}" overwrite="true"> + <filterchain> + <replaceregexp> + <regexp pattern="\?>.\?php" replace=" " /> + </replaceregexp> + </filterchain> + </copy> <delete dir="solid-production"/> </target> Modified: poc/src/OpenDocumentSingle.php =================================================================== --- poc/src/OpenDocumentSingle.php 2006-03-29 08:59:58 UTC (rev 39) +++ poc/src/OpenDocumentSingle.php 2006-03-29 11:01:01 UTC (rev 40) @@ -109,8 +109,7 @@ * @since 0.3.0 */ public function addXMLDocument( $fullpath, $domFrag, $mimetype="text/xml" ) { - $this->logger->info( "OpenDocumentSingle->addXMLDocument(" . $fullpath . - ") with mimetype '" . $mimetype . "' to package '". $this->packagetmp . "'" ); + $this->logger->info( "OpenDocumentSingle->addXMLDocument(" . $fullpath . ") with mimetype '" . $mimetype . "' to package '". $this->packagetmp . "'" ); $this->dom->appendChild( $domFrag ); } Modified: poc/src/samples/TestOutput.php =================================================================== --- poc/src/samples/TestOutput.php 2006-03-29 08:59:58 UTC (rev 39) +++ poc/src/samples/TestOutput.php 2006-03-29 11:01:01 UTC (rev 40) @@ -65,10 +65,28 @@ function makeFontFaceDecl( $fontFaceDecl ) { $styleAttr = array(); - $styleAttr[ "font-family" ] ="Tahoma"; - $fontFaceDecl->addFontFace( "Test", $styleAttr ); + $svgAttr = array(); + + $styleAttr[ "font-pitch" ] = "variable"; + $svgAttr [ "font-family" ] = "'Arial Unicode MS'"; + $fontFaceDecl->addFontFace( "Arial Unicode MS", $styleAttr, $svgAttr ); + + $svgAttr [ "font-family" ] = "Tahoma"; + $fontFaceDecl->addFontFace( "Tahoma", $styleAttr, $svgAttr ); + + $svgAttr [ "font-family" ] = "'MS Mincho'"; + $fontFaceDecl->addFontFace( "MS Mincho", $styleAttr, $svgAttr ); + + $svgAttr [ "font-family" ] = "'Times New Roman'"; + $styleAttr[ "font-family-generic" ] = "roman"; + $fontFaceDecl->addFontFace( "Times New Roman", $styleAttr, $svgAttr ); + + $svgAttr [ "font-family" ] = "Arial"; + $styleAttr[ "font-family-generic" ] = "swiss"; + $fontFaceDecl->addFontFace( "Arial", $styleAttr, $svgAttr ); } + function makeAutomaticStyles( $automaticStyles ) { // return $automaticStyles; } @@ -77,7 +95,7 @@ // return $scripts; } - function makeStyle( $style ) { + function makeStyle( $style ) { // Set default style $style->addDefaultStyle( "paragraph" ); @@ -119,10 +137,21 @@ //Set a style $styleAttr = array( "family"=>"paragraph", "class"=>"text" ); + $style->addStyle( "Standard", $styleAttr ); + + //Set a style + $styleAttr = array( "family"=>"paragraph", "class"=>"text" ); + $styleAttr[ "display-name" ] = "Paragraph ODP"; + $styleAttr[ "parent-style-name" ] = "Standard"; $style->addStyle( "Paragraph", $styleAttr ); - //Set a style - $style->addStyle( "Heading", $styleAttr ); + //Set a style + $styleAttr[ "default-outline-level" ] = "1"; + $styleAttr[ "display-name" ] = "Heading ODP"; + $styleAttr[ "parent-style-name" ] = "Standard"; + $styleAttr[ "next-style-name" ] = "Standard"; + $foAttr[ "font-weight" ] = "bold"; + $style->addStyle( "Heading", $styleAttr, $foAttr ); unset( $styleAttr ); unset( $foAttr ); @@ -137,7 +166,7 @@ $styleAttr[ "font-name" ] = "Arial"; $styleAttr[ "font-name-asian" ] = "MS Mincho"; $styleAttr[ "font-size" ] = "20pt"; - $styleAttr[ "font-name-complex" ] = "Tahoma1"; + $styleAttr[ "font-name-complex" ] = "Tahoma"; $styleAttr[ "font-size-complex" ] = "20pt"; $style->addStyleTextProperties( "Heading", $styleAttr, $foAttr ); } Modified: poc/src/styles/FontFaceDeclaration.php =================================================================== --- poc/src/styles/FontFaceDeclaration.php 2006-03-29 08:59:58 UTC (rev 39) +++ poc/src/styles/FontFaceDeclaration.php 2006-03-29 11:01:01 UTC (rev 40) @@ -124,7 +124,7 @@ } } } - if (!empty($SVGAtrr)) { + if (!empty($SVGAttr)) { foreach( $SVGAttr as $key => $value ) { // ***FIX ME*** Here we should check if the keys are possible if ($this->checkSVG( $key, $value )) { Modified: poc/src/styles/Styles.php =================================================================== --- poc/src/styles/Styles.php 2006-03-29 08:59:58 UTC (rev 39) +++ poc/src/styles/Styles.php 2006-03-29 11:01:01 UTC (rev 40) @@ -120,7 +120,8 @@ $this->root->appendChild( $this->MasterStyles->get() ); $this->styles->appendChild( $this->root ); - $this->dom->normalize(); + $this->dom->normalize(); + $this->dom->normalize(); $this->isCommited = true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |