Bug 49268 - <switchinline> tags don't work in Help tooltips
Summary: <switchinline> tags don't work in Help tooltips
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
3.5.3 release
Hardware: All All
: medium normal
Assignee: barteka13
URL:
Whiteboard: target:3.7.0 target:3.6.1
Keywords: difficultyBeginner, easyHack, skillCpp
Depends on:
Blocks:
 
Reported: 2012-04-29 03:31 UTC by Mihkel Tõnnov
Modified: 2016-02-05 11:10 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mihkel Tõnnov 2012-04-29 03:31:19 UTC
For example a string like this:
"<ahelp hid="SC:LISTBOX:RID_SCPAGE_SORT_OPTIONS:LB_SORT_USER"> Select the custom sort order that you want to apply. To define a custom sort order, choose <switchinline select="sys"><caseinline select="MAC">%PRODUCTNAME - Preferences</caseinline><defaultinline>Tools - Options</defaultinline></switchinline> - <link href="text/shared/optionen/01060400.xhp" name="%PRODUCTNAME Calc - Sort Lists">%PRODUCTNAME Calc - Sort Lists</link> .</ahelp>"
gets shown in extended help tooltip like this:
"Select the custom sort order that you want to apply. To define a custom sort order, choose LibreOffice - PreferencesTools - Options - LibreOffice Calc - Sort Lists ."
but it is shown as expected in Help window:
"Select the custom sort order that you want to apply. To define a custom sort order, choose Tools - Options - LibreOffice Calc - Sort Lists ."

So apparently the "<switchinline select="sys"><caseinline select="MAC">%PRODUCTNAME - Preferences</caseinline><defaultinline>Tools - Options</defaultinline></switchinline>" part doesn't work in tooltips for some reason.

Tested with LibO 3.5.3 on Debian Lenny (x86) and 3.5.0 on Windows XP.
Comment 1 Andras Timar 2012-06-18 12:34:35 UTC
There are quite a few occurences of this problem, I quickly grepped the source form them using xml_grep from Perl XML::Twig package.

timar@timar-corei7:~/libreoffice-master/helpcontent2/source/text> for i in `find . -name \*.xhp`;do xml_grep 'ahelp' $i;done  | grep ahelp | grep switchinline

The problem is that the ahelp content is simply dumped into a string, i.e. all xml tags are removed. See: http://opengrok.libreoffice.org/xref/core/l10ntools/source/help/HelpCompiler.cxx#384
Instead of dump(), help compiler should look for switchinline tag, because all information is available in compile time. We know the target platform and we even know the target application, because there are separate target .ht files for each application (swriter.ht, sdraw.ht etc.). So it is an easy hack to write a dumpht() function, that can parse switchinline tag.
Comment 2 Not Assigned 2012-08-06 19:22:12 UTC
Andras Bartek committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=aba13e8a4a91c715a2a2b13792c2f7d48654e009

fixing conditional text in ahelp tags fdo#49268
Comment 3 Not Assigned 2012-08-10 19:54:18 UTC
Andras Bartek committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=98277b849424b9b4f486b8deb00db0c47487267e&g=libreoffice-3-6

fixing conditional text in ahelp tags fdo#49268


It will be available in LibreOffice 3.6.1.
Comment 4 Robinson Tryon (qubit) 2015-12-15 23:22:16 UTC
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyEasy SkillCpp)
[NinjaEdit]
Comment 5 Björn Michaelsen 2016-02-05 11:10:47 UTC
difficultyEasy -> difficultyBeginner. The former never really existed and only makes the EasyHack not appear on the wiki.