/usr/share/php/Horde/Mime/Viewer/Ooo/export/common/styles/style_mapping_css.xsl is in php-horde-mime-viewer 2.2.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | <?xml version="1.0" encoding="UTF-8"?>
<!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
Copyright 2000, 2010 Oracle and/or its affiliates.
OpenOffice.org - a multi-platform office productivity suite
This file is part of OpenOffice.org.
OpenOffice.org is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3
only, as published by the Free Software Foundation.
OpenOffice.org is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License version 3 for more details
(a copy is included in the LICENSE file that accompanied this code).
You should have received a copy of the GNU Lesser General Public License
version 3 along with OpenOffice.org. If not, see
<http://www.openoffice.org/license.html>
for a copy of the LGPLv3 License.
-->
<!--
For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="chart config dc dom dr3d draw fo form math meta number office ooo oooc ooow script style svg table text xforms xlink xsd xsi">
<!-- *** Properties with a 'fo:' prefix *** -->
<xsl:template match="@fo:background-color">
<xsl:text>background-color:</xsl:text>
<xsl:value-of select="."/>
<xsl:text>; </xsl:text>
</xsl:template>
<xsl:template match="@fo:border | @fo:border-top | @fo:border-bottom | @fo:border-left | @fo:border-right">
<xsl:variable name="borderType" select="substring-after(name(), ':')"/>
<xsl:choose>
<xsl:when test=". = 'none'">
<xsl:value-of select="$borderType"/>
<xsl:text>-style:none; </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="borderWidth" select="substring-before(., ' ')"/>
<xsl:variable name="borderStyle" select="substring-before(substring-after(., ' '), ' ')"/>
<xsl:variable name="borderColor" select="substring-after(substring-after(., ' '), ' ')"/>
<!-- More information at template 'round-up-border-width' -->
<xsl:variable name="borderWidthFixed">
<xsl:call-template name="round-up-border-width">
<xsl:with-param name="borderWidth" select="$borderWidth"/>
<xsl:with-param name="multiplier">
<xsl:choose>
<xsl:when test="$borderStyle = 'double'">3</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$borderType"/>
<xsl:text>-width:</xsl:text>
<xsl:value-of select="$borderWidthFixed"/>
<xsl:text>; </xsl:text>
<xsl:value-of select="$borderType"/>
<xsl:text>-style:</xsl:text>
<xsl:value-of select="$borderStyle"/>
<xsl:text>; </xsl:text>
<xsl:value-of select="$borderType"/>
<xsl:text>-color:</xsl:text>
<xsl:value-of select="$borderColor"/>
<xsl:text>; </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- NOTE: Still there have to be placed a <br clear='all' /> to disable the flow!!!!-->
<xsl:template match="@fo:clear">
<xsl:text>clear:both; </xsl:text>
</xsl:template>
<!-- text-shadow is a CSS2 feature and yet not common used in user-agents -->
<xsl:template match="@fo:color |@svg:font-family |@fo:font-size |@fo:font-style |@fo:font-weight |@fo:text-indent |@fo:text-shadow">
<xsl:value-of select="substring-after(name(), ':')"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="."/>
<xsl:text>; </xsl:text>
</xsl:template>
<!-- Maps fo:margin as well fo:margin-top, fo:margin-bottom, fo:padding-left, fo:margin-right -->
<!-- Maps fo:padding as well fo:padding-top, fo:padding-bottom, fo:padding-left, fo:padding-right -->
<xsl:template match="@fo:letter-spacing | @fo:line-height | @fo:width |@fo:margin | @fo:margin-top | @fo:margin-bottom | @fo:margin-left | @fo:margin-right | @fo:padding | @fo:padding-top | @fo:padding-bottom | @fo:padding-left | @fo:padding-right">
<xsl:value-of select="substring-after(name(), ':')"/>
<xsl:text>:</xsl:text>
<!-- Map once erroneusly used inch shortage 'inch' to CSS shortage 'in' -->
<xsl:choose>
<xsl:when test="contains(., 'inch')">
<xsl:value-of select="substring-before(.,'ch')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>; </xsl:text>
</xsl:template>
<xsl:template match="@fo:text-align">
<!-- 'important' is necessary as table cell value alignment is decided by runtime over the valuetype
Otherwise a table cell style-class would always be outnumbered by the run-time alignment value -->
<xsl:choose>
<xsl:when test="contains(., 'start')">
<xsl:choose>
<xsl:when test="parent::*/@style:writing-mode and contains(parent::*/@style:writing-mode, 'rl')">
<xsl:text>text-align:right ! important; </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>text-align:left ! important; </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="contains(., 'end')">
<xsl:choose>
<xsl:when test="parent::*/@style:writing-mode and contains(parent::*/@style:writing-mode, 'rl')">
<xsl:text>text-align:left ! important;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>text-align:right ! important; </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>text-align:</xsl:text>
<xsl:value-of select="."/>
<xsl:text> ! important; </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="@style:vertical-align">
<xsl:choose>
<xsl:when test="contains(., 'bottom')">
<xsl:text>vertical-align:bottom; </xsl:text>
</xsl:when>
<xsl:when test="contains(., 'middle')">
<xsl:text>vertical-align:middle; </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>vertical-align:top; </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- *** Properties with a 'style:' prefix *** -->
<!-- NOTE: Can 'inside' | 'from-inside' better be handled:
<!ATTLIST * style:horizontal-pos (from-left|left|center|right|from-inside|inside|outside)#IMPLIED>-->
<xsl:template match="@style:horizontal-pos">
<xsl:choose>
<xsl:when test=".='left'">
<xsl:text>text-align:left; </xsl:text>
</xsl:when>
<xsl:when test=". = 'right'">
<xsl:text>text-align:right; </xsl:text>
</xsl:when>
<xsl:when test=".='center'">
<xsl:text>text-align:center; </xsl:text>
</xsl:when>
<!-- NOTE: currently other values are not used.
If the property value is from-left or from-inside,
the svg:x attribute associated with the frame element specifies
the horizontal position of the frame.
Otherwise the svg:x attribute is ignored for text documents.
-->
</xsl:choose>
</xsl:template>
<xsl:template match="@style:column-width">
<xsl:text>width:</xsl:text>
<xsl:choose>
<!-- changing the distance measure: inch to in -->
<xsl:when test="contains(., 'inch')">
<xsl:value-of select="substring-before(.,'ch')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>; </xsl:text>
</xsl:template>
<xsl:template match="@style:text-underline-style">
<xsl:text>text-decoration:</xsl:text>
<xsl:choose>
<!-- changing the distance measure: inch to in -->
<xsl:when test=".='none'">
<xsl:text>none ! important</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>underline</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:text>; </xsl:text>
</xsl:template>
<xsl:template match="@style:font-name">
<xsl:param name="globalData" />
<xsl:text>font-family:</xsl:text>
<xsl:variable name="content" select="."/>
<xsl:variable name="quote">'</xsl:variable>
<xsl:variable name="fontName" select="$globalData/office:font-face-decls/style:font-face[@style:name=$content]/@svg:font-family" />
<xsl:value-of select="translate($fontName, $quote, '')"/>
<xsl:text>; </xsl:text>
</xsl:template>
<xsl:template match="@style:row-height">
<xsl:text>height:</xsl:text>
<xsl:choose>
<!-- changing the distance measure: inch to in -->
<xsl:when test="contains(., 'inch')">
<xsl:value-of select="substring-before(.,'ch')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>; </xsl:text>
</xsl:template>
<xsl:template match="@svg:strikethrough-position">
<xsl:if test="not(.='none')">
<xsl:text>text-decoration:line-through; </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="@style:text-position">
<xsl:if test="contains(., 'sub')">
<xsl:text>vertical-align:sub; </xsl:text>
<xsl:if test="contains(., '%')">
<xsl:text>font-size:</xsl:text>
<xsl:value-of select="substring-after(., 'sub ')"/>
<xsl:text>;</xsl:text>
</xsl:if>
</xsl:if>
<xsl:if test="contains(., 'super')">
<xsl:text>vertical-align:super; </xsl:text>
<xsl:if test="contains(., '%')">
<xsl:text>font-size:</xsl:text>
<xsl:value-of select="substring-after(., 'super ')"/>
<xsl:text>;</xsl:text>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="@style:vertical-pos">
<xsl:choose>
<xsl:when test=".='from-top'">
<xsl:text>vertical-align:top; </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>vertical-align:</xsl:text>
<xsl:value-of select="."/>
<xsl:text>; </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="@style:width">
<xsl:text>width:</xsl:text>
<xsl:choose>
<!-- changing the distance measure: inch to in -->
<xsl:when test="contains(., 'inch')">
<xsl:value-of select="substring-before(.,'ch')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>; </xsl:text>
</xsl:template>
<xsl:template match="@style:wrap">
<xsl:choose>
<xsl:when test=".='left'">
<xsl:text>float:right; </xsl:text>
</xsl:when>
<xsl:when test=".='right'">
<xsl:text>float:left; </xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="@style:writing-mode">
<xsl:text>writing-mode:</xsl:text>
<xsl:value-of select="."/>
<xsl:text>; </xsl:text>
</xsl:template>
<!-- *** Properties with a no 'fo:' or 'style:' prefix *** -->
<xsl:template match="@table:align">
<xsl:choose>
<xsl:when test=".='left'">
<!-- Note: problems with meeting minutes example
<xsl:text>float:right; </xsl:text> --></xsl:when>
<xsl:when test=".='right'">
<!-- Note: problems with meeting minutes example
<xsl:text>float:left; </xsl:text> --></xsl:when>
<xsl:otherwise>
<xsl:text>float:none; </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="style:background-image">
<xsl:text>background-image:url(</xsl:text>
<xsl:value-of select="@xlink:href"/>
<xsl:text>); </xsl:text>
<xsl:choose>
<xsl:when test="@style:repeat = 'repeat'">
<xsl:text>background-repeat:repeat; </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>background-repeat:no-repeat; </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Changing border width measure to cm and enlarging border-width to the Mozilla browser(1.7)
visible minimum width
- 0.0133cm for solid style
- 0.0399cm for double style
as there are three border lines painted -->
<xsl:template name="round-up-border-width">
<xsl:param name="borderWidth"/>
<xsl:param name="multiplier"/>
<xsl:variable name="borderWidthByCentimeter">
<xsl:call-template name="convert2cm">
<xsl:with-param name="value" select="$borderWidth"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="minimalBorderWidth" select="0.0133 * $multiplier"/>
<xsl:choose>
<xsl:when test="number($borderWidthByCentimeter) < $minimalBorderWidth">
<xsl:value-of select="$minimalBorderWidth"/>
<xsl:text>cm</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$borderWidthByCentimeter"/>
<xsl:text>cm</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
|