Summary: | Having square brackets in the names of data objects, scalars, etc. can bork parsing. | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Duncan Hanson <duncan.hanson> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | arwalker |
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Duncan Hanson
2007-01-28 20:08:05 UTC
You should be able to escape them with \ -- George Staikos KDE Developer http://www.kde.org/ Staikos Computing Services Inc. http://www.staikos.net/ ... or just as easily I could rename my objects not to include [ ]-- the problem is really for people who are less familiar with Kst and can't figure out why their labels don't work. Duncan. On 28 Jan 2007 19:20:19 -0000, George Staikos <staikos@kde.org> wrote: [bugs.kde.org quoted mail] ... if the brackets can be escaped, what else can be done? The square bracket is a reserved character. -- George Staikos KDE Developer http://www.kde.org/ Staikos Computing Services Inc. http://www.staikos.net/ SVN commit 648296 by netterfield: CCBUG: 140788 Improve tool tip documentation for [], but [ in tag names still doesn't work in labels (at least I can't get it to....) M +1 -1 viewlabelwidget.ui.h --- trunk/extragear/graphics/kst/src/libkstapp/viewlabelwidget.ui.h #648295:648296 @@ -25,7 +25,7 @@ connect(_strings, SIGNAL(selectionChanged(const QString &)), this, SLOT(insertStringInText(const QString &))); - QWhatsThis::add(_text, i18n("<qt>The syntax for labels is a derivative of a subset of LaTeX. Supported syntax is: <b>\\[greeklettername]</b> and <b>\\[Greeklettername]</b>, <b>\\approx</b>, <b>\\cdot</b>, <b>\\ge</b>, <b>\\geq</b>, <b>\\inf</b>, <b>\\int</b>, <b>\\le</b>, <b>\\leq</b>, <b>\\ne</b>, <b>\\n</b>, <b>\\partial</b>, <b>\\prod</b>, <b>\\pm</b>, <b>\\textcolor{color name}{colored text}</b>, <b>\\textbf{bold text}</b>, <b>\\textit{italicized text}</b>, <b>\\t</b>, <b>\\sum</b>, <b>\\sqrt</b>, <b>\\underline{underlined text}</b>, <b>x^y</b>, <b>x_y</b>. Data references and embedded expressions should be enclosed in square brackets. Example: <i>[=[MyScalar]/2]</i>")); + QWhatsThis::add(_text, i18n("<qt>The syntax for labels is a derivative of a subset of LaTeX. Supported syntax is: <b>\\[greeklettername]</b> and <b>\\[Greeklettername]</b>, <b>\\approx</b>, <b>\\cdot</b>, <b>\\ge</b>, <b>\\geq</b>, <b>\\inf</b>, <b>\\int</b>, <b>\\le</b>, <b>\\leq</b>, <b>\\ne</b>, <b>\\n</b>, <b>\\partial</b>, <b>\\prod</b>, <b>\\pm</b>, <b>\\textcolor{color name}{colored text}</b>, <b>\\textbf{bold text}</b>, <b>\\textit{italicized text}</b>, <b>\\t</b>, <b>\\sum</b>, <b>\\sqrt</b>, <b>\\underline{underlined text}</b>, <b>x^y</b>, <b>x_y</b>. Scalars, equations, and vector elements can be embedded. Scalar: <i>[V1/Mean]</i>. Vector Element: <i>[V1[4]]</i>. Equation: <i>[=[V1/Mean]^2]</i>. A [ character can be inserted as <i>\\[</i>.")); } The problem is that the code handling the embedded data objects fails when there are square brackets in the name. The square brackets cannot be escaped (as suggested by George) as the code does not recognise the escape character within the name - which is why Barth cannot get tag names with [ to work in labels. The solution is to write a more intelligent parser for embedded data objects or to disallow [] in the names. The latter seems simpler and we can continue to support existing data object names with [] (but they won't work in labels just as at present). The relevant section of code is at case '[': in parseInternal(...) in labelparser.cpp The square brackets are now removed from vector and scalar names prior to their creation. Due to the need for backward compatibility this is not a complete solution, but helps to solve the problem for newly created sessions. This is probably as far as it can go. Files changed (the new version of the SVN server no longer appears to be accepting BUG and CCBUG): kstvectordialog_i.cpp scalarselector.ui.h |