2626 * The Renderer
2727 */
2828class renderer_plugin_odt extends Doku_Renderer {
29+ /** @var helper_plugin_odt_stylefactory */
2930 var $ factory = null ;
3031 /** @var helper_plugin_odt_cssimport */
3132 var $ import = null ;
@@ -1195,7 +1196,7 @@ function doublequoteclosing() {
11951196 *
11961197 * @param string $text The PHP code
11971198 */
1198- function php ($ text, $ wrapper = ' dummy ' ) {
1199+ function php ($ text ) {
11991200 $ this ->monospace_open ();
12001201 $ this ->doc .= $ this ->_xmlEntities ($ text );
12011202 $ this ->monospace_close ();
@@ -1215,7 +1216,7 @@ function phpblock($text) {
12151216 *
12161217 * @param string $text The HTML
12171218 */
1218- function html ($ text, $ wrapper = ' dummy ' ) {
1219+ function html ($ text ) {
12191220 $ this ->monospace_open ();
12201221 $ this ->doc .= $ this ->_xmlEntities ($ text );
12211222 $ this ->monospace_close ();
@@ -1639,19 +1640,19 @@ function _getLinkTitle($title, $default, & $isImage, $id=null) {
16391640 global $ conf ;
16401641
16411642 $ isImage = false ;
1642- if ( is_null ($ title ) ) {
1643+ if (is_null ($ title ) || trim ( $ title ) == '' ) {
16431644 if ($ conf ['useheading ' ] && $ id ) {
16441645 $ heading = p_get_first_heading ($ id );
16451646 if ($ heading ) {
16461647 return $ this ->_xmlEntities ($ heading );
16471648 }
16481649 }
16491650 return $ this ->_xmlEntities ($ default );
1650- } else if ( is_string ($ title ) ) {
1651- return $ this ->_xmlEntities ($ title );
16521651 } else if ( is_array ($ title ) ) {
16531652 $ isImage = true ;
16541653 return $ title ;
1654+ } else {
1655+ return $ this ->_xmlEntities ($ title );
16551656 }
16561657 }
16571658
@@ -1707,6 +1708,7 @@ function rss ($url,$params){
17071708 $ feed ->feed_url ($ url );
17081709
17091710 //disable warning while fetching
1711+ $ elvl = null ;
17101712 if (!defined ('DOKU_E_LEVEL ' )) { $ elvl = error_reporting (E_ERROR ); }
17111713 $ rc = $ feed ->init ();
17121714 if (!defined ('DOKU_E_LEVEL ' )) { error_reporting ($ elvl ); }
@@ -1827,10 +1829,12 @@ function _addStringAsSVGImage($string, $width = NULL, $height = NULL, $align = N
18271829 * in the odt frame and image tag which can not be changed using the function _odtAddImage.
18281830 *
18291831 * @author LarsDW223
1832+ *
18301833 * @param string $src
18311834 * @return string
18321835 */
18331836 function _odtAddImageAsFileOnly ($ src ){
1837+ $ name = '' ;
18341838 if (file_exists ($ src )) {
18351839 list ($ ext ,$ mime ) = mimetype ($ src );
18361840 $ name = 'Pictures/ ' .md5 ($ src ).'. ' .$ ext ;
@@ -2106,6 +2110,8 @@ function _odtParagraphOpenUseCSSStyle($style, $baseURL = NULL){
21062110 * The paragraph must be closed by calling 'p_close'.
21072111 *
21082112 * @author LarsDW223
2113+ *
2114+ * @param array $properties
21092115 */
21102116 function _odtParagraphOpenUseProperties ($ properties ){
21112117 $ disabled = array ();
@@ -2154,6 +2160,7 @@ function _odtParagraphOpenUseProperties($properties){
21542160 * The div should be closed by calling '_odtDivCloseAsFrame'.
21552161 *
21562162 * @author LarsDW223
2163+ *
21572164 * @param helper_plugin_odt_cssimport $import
21582165 * @param $classes
21592166 * @param null $baseURL
@@ -2197,6 +2204,9 @@ function _odtDivOpenAsFrameUseCSS (helper_plugin_odt_cssimport $import, $classes
21972204
21982205 $ min_height = $ properties ['min-height ' ];
21992206
2207+ $ pic_link = '' ;
2208+ $ pic_width = '' ;
2209+ $ pic_height = '' ;
22002210 if ( !empty ($ picture ) ) {
22012211 // If a picture/background-image is set in the CSS, than we insert it manually here.
22022212 // This is a workaround because ODT does not support the background-image attribute in a span.
@@ -2744,6 +2754,10 @@ protected function _odtTableCellOpenUsePropertiesInternal ($properties, $inHeade
27442754 * Simple helper function for creating a style $name setting the specfied font size $size.
27452755 *
27462756 * @author LarsDW223
2757+ *
2758+ * @param string $name
2759+ * @param string $size
2760+ * @return string
27472761 */
27482762 protected function _odtBuildSizeStyle ($ name , $ size ) {
27492763 $ style = '<style:style style:name=" ' .$ name .'" style:display-name=" ' .$ name .'" style:family="text"><style:text-properties fo:font-size=" ' .$ size .'" style:font-size-asian=" ' .$ size .'" style:font-size-complex=" ' .$ size .'"/></style:style> ' ;
@@ -2766,7 +2780,7 @@ protected function _odtBuildSizeStyle ($name, $size) {
27662780 *
27672781 * @param array $properties
27682782 * @param array $disabled_props
2769- * @return null
2783+ * @return null|string
27702784 */
27712785 protected function _createTextStyle ($ properties , $ disabled_props = NULL ){
27722786 $ save = $ disabled_props ['font-size ' ];
@@ -2775,7 +2789,7 @@ protected function _createTextStyle($properties, $disabled_props = NULL){
27752789 if ( empty ($ disabled_props ['font-size ' ]) ) {
27762790 $ odt_fo_size = $ properties ['font-size ' ];
27772791 }
2778- unset ( $ parent) ;
2792+ $ parent = '' ;
27792793 $ length = strlen ($ odt_fo_size );
27802794 if ( $ length > 0 && $ odt_fo_size [$ length -1 ] == '% ' ) {
27812795 // A font-size in percent is only supported in common style definitions, not in automatic
@@ -2816,7 +2830,7 @@ protected function _createParagraphStyle($properties, $disabled_props = NULL){
28162830 if ( empty ($ disabled_props ['font-size ' ]) ) {
28172831 $ odt_fo_size = $ properties ['font-size ' ];
28182832 }
2819- unset ( $ parent) ;
2833+ $ parent = '' ;
28202834 $ length = strlen ($ odt_fo_size );
28212835 if ( $ length > 0 && $ odt_fo_size [$ length -1 ] == '% ' ) {
28222836 // A font-size in percent is only supported in common style definitions, not in automatic
@@ -2957,6 +2971,8 @@ function _odtCloseMultiColumnFrame () {
29572971 * The div should be closed by calling '_odtDivCloseAsFrame'.
29582972 *
29592973 * @author LarsDW223
2974+ *
2975+ * @param array $properties
29602976 */
29612977 function _odtOpenTextBoxUseProperties ($ properties ) {
29622978 $ this ->in_div_as_frame ++;
@@ -2990,6 +3006,9 @@ function _odtOpenTextBoxUseProperties ($properties) {
29903006 $ width = $ properties ['width ' ];
29913007 $ horiz_pos = $ properties ['float ' ];
29923008
3009+ $ pic_link = '' ;
3010+ $ pic_width = '' ;
3011+ $ pic_height = '' ;
29933012 if ( !empty ($ picture ) ) {
29943013 // If a picture/background-image is set in the CSS, than we insert it manually here.
29953014 // This is a workaround because ODT does not support the background-image attribute in a span.
@@ -3013,9 +3032,6 @@ function _odtOpenTextBoxUseProperties ($properties) {
30133032 $ min_height = '1pt ' ;
30143033 }
30153034
3016- // For safety, init width_abs with value for 100%
3017- $ width_abs = $ this ->_getAbsWidthMindMargins (100 );
3018-
30193035 // Different handling for relative and absolute size...
30203036 if ( $ width [strlen ($ width )-1 ] == '% ' ) {
30213037 // Convert percentage values to absolute size, respecting page margins
@@ -3184,7 +3200,7 @@ public function getCSSProperties (&$dest, $element, $classString, $inlineStyle)
31843200 }
31853201
31863202 /**
3187- * @param $dest
3203+ * @param array $dest
31883204 * @param $element
31893205 * @param $classString
31903206 * @param $inlineStyle
0 commit comments