diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2015-10-05 18:22:33 +0200 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2015-10-20 06:23:31 +0000 |
commit | 1d020c732782085c99c166bd3b4bd583360c277e (patch) | |
tree | c6409ce0cae262ac08e48de284cc5bf3825b232b | |
parent | 6f1d1f6212bff5576822e94de6f8d6e695e07377 (diff) |
tdf#93981 Attribute localize=(false|true) is deleted
The information localize='false' is tracked by adding _NOL10N to
the paragraph id. But some files exist, where the paragraph does not
have an id at all. In such cases an id is created, as an id is
a required attribute. This solves tdf#94612 partly, because a
missing id in a file would otherwise generate an empty id on import,
which is neither allowed.
Change-Id: Ib136493dee004fd09f8e7e14d05c99ea173865e0
Reviewed-on: https://gerrit.libreoffice.org/19166
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r-- | helpauthoring/filter/xmlhelp2soffice.xsl | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/helpauthoring/filter/xmlhelp2soffice.xsl b/helpauthoring/filter/xmlhelp2soffice.xsl index a8584edf..fdb3f433 100644 --- a/helpauthoring/filter/xmlhelp2soffice.xsl +++ b/helpauthoring/filter/xmlhelp2soffice.xsl @@ -938,15 +938,25 @@ PARAGRAPH </xsl:choose> </xsl:variable> + <xsl:variable name="idhdvalue"> + <xsl:choose> + <xsl:when test="@id and not(@id='')"> + <xsl:value-of select="@id"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat('hd_',generate-id())"/> <!-- there exists files with paragraphs without id --> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> <text:span text:style-name="{$tagstyle}"> <text:variable-set text:name="ID" text:value-type="string" text:display="value"> <xsl:choose> - <xsl:when test="@xml-lang"> - <xsl:value-of select="@id"/> + <xsl:when test="@localize='false'"> + <xsl:value-of select="concat($idhdvalue,'_NOL10N')"/> </xsl:when> <xsl:otherwise> - <xsl:value-of select="concat(@id,'_NOL10N')"/> + <xsl:value-of select="$idhdvalue"/> </xsl:otherwise> </xsl:choose> <!-- @@ -981,14 +991,25 @@ PARAGRAPH </xsl:choose> </xsl:variable> + <xsl:variable name="idparvalue"> + <xsl:choose> + <xsl:when test="@id and not(@id='')"> + <xsl:value-of select="@id"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat('par_',generate-id())"/> <!-- there exists files with paragraphs without id --> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <text:span text:style-name="{$tagstyle}"> <text:variable-set text:name="ID" text:value-type="string" text:display="value"> <xsl:choose> - <xsl:when test="@xml-lang"> - <xsl:value-of select="@id"/> + <xsl:when test="@localize='false'"> + <xsl:value-of select="concat($idparvalue,'_NOL10N')"/> </xsl:when> <xsl:otherwise> - <xsl:value-of select="concat(@id,'_NOL10N')"/> + <xsl:value-of select="$idparvalue"/> </xsl:otherwise> </xsl:choose> <!-- |