[LyX master] validate encodable characters in href inset (#8357)
The branch, master, has been updated. - Log - commit 5801ee2f9a0f6536c6753567b191302960b3bf4f Author: Juergen Spitzmueller sp...@lyx.org Date: Fri Sep 28 09:27:39 2012 +0200 validate encodable characters in href inset (#8357) diff --git a/src/insets/InsetHyperlink.cpp b/src/insets/InsetHyperlink.cpp index 442b839..37692af 100644 --- a/src/insets/InsetHyperlink.cpp +++ b/src/insets/InsetHyperlink.cpp @@ -15,6 +15,7 @@ #include Buffer.h #include DispatchResult.h +#include Encoding.h #include Format.h #include FuncRequest.h #include FuncStatus.h @@ -28,6 +29,8 @@ #include support/gettext.h #include support/lstrings.h +#include frontends/alert.h + using namespace std; using namespace lyx::support; @@ -185,7 +188,17 @@ void InsetHyperlink::latex(otexstream os, (pos = name.find('~', i)) != string::npos; i = pos + 1) name.replace(pos, 1, sim); - + pairdocstring, docstring name_latexed = + runparams.encoding-latexString(name, runparams.dryrun); + name = name_latexed.first; + if (!name_latexed.second.empty()) { + // issue a warning about omitted characters + // FIXME: should be passed to the error dialog + frontend::Alert::warning(_(Uncodable characters), + bformat(_(The following characters that are used in the href inset are not\n + representable in the current encoding and therefore have been omitted:\n%1$s.), + name_latexed.second)); + } } // end if (!name.empty()) if (runparams.moving_arg) --- Summary of changes: src/insets/InsetHyperlink.cpp | 15 ++- 1 files changed, 14 insertions(+), 1 deletions(-) hooks/post-receive -- The LyX Source Repository
[LyX master] de.po: update
The branch, master, has been updated. - Log - commit 3c5409b4cdd9922303f391c2ceb4e91f82410210 Author: Juergen Spitzmueller sp...@lyx.org Date: Fri Sep 28 10:03:20 2012 +0200 de.po: update diff --git a/po/de.po b/po/de.po index 5c7fd38..6b9ee14 100644 --- a/po/de.po +++ b/po/de.po @@ -95,8 +95,8 @@ msgid msgstr Project-Id-Version: LyX 2.1\n Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n -POT-Creation-Date: 2012-09-23 18:39+0200\n -PO-Revision-Date: 2012-09-23 18:47+0200\n +POT-Creation-Date: 2012-09-28 10:00+0200\n +PO-Revision-Date: 2012-09-28 10:03+0200\n Last-Translator: Jürgen Spitzmüller sp...@lyx.org\n Language-Team: German lyx-d...@lists.lyx.org\n Language: de\n @@ -458,8 +458,8 @@ msgstr Neue Einfügung #: src/frontends/qt4/ui/ListingsUi.ui:549 #: src/frontends/qt4/ui/DocumentUi.ui:77 #: src/frontends/qt4/ui/CharacterUi.ui:367 src/frontends/qt4/ui/RefUi.ui:330 -#: src/frontends/qt4/ui/SendtoUi.ui:85 src/frontends/qt4/GuiDocument.cpp:2139 -#: src/frontends/qt4/GuiDocument.cpp:3454 +#: src/frontends/qt4/ui/SendtoUi.ui:85 src/frontends/qt4/GuiDocument.cpp:2142 +#: src/frontends/qt4/GuiDocument.cpp:3453 msgid Apply msgstr Ãbernehmen @@ -620,7 +620,7 @@ msgstr Wählen Sie, welches Sprachpaket LyX verwenden soll #: src/frontends/qt4/ui/PrefLanguageUi.ui:55 #: src/frontends/qt4/GuiDocument.cpp:1081 -#: src/frontends/qt4/GuiDocument.cpp:1940 +#: src/frontends/qt4/GuiDocument.cpp:1943 msgid Automatic msgstr Automatisch @@ -1236,16 +1236,16 @@ msgstr Zeilenabstand #: src/frontends/qt4/GuiDocument.cpp:910 #: src/frontends/qt4/GuiDocument.cpp:1079 #: src/frontends/qt4/GuiDocument.cpp:1165 -#: src/frontends/qt4/GuiDocument.cpp:1824 +#: src/frontends/qt4/GuiDocument.cpp:1822 +#: src/frontends/qt4/GuiDocument.cpp:1900 +#: src/frontends/qt4/GuiDocument.cpp:1901 #: src/frontends/qt4/GuiDocument.cpp:1902 -#: src/frontends/qt4/GuiDocument.cpp:1903 -#: src/frontends/qt4/GuiDocument.cpp:1904 -#: src/frontends/qt4/GuiDocument.cpp:1919 -#: src/frontends/qt4/GuiDocument.cpp:1926 -#: src/frontends/qt4/GuiDocument.cpp:1933 -#: src/frontends/qt4/GuiDocument.cpp:2018 -#: src/frontends/qt4/GuiDocument.cpp:2448 -#: src/frontends/qt4/GuiDocument.cpp:3511 src/frontends/qt4/GuiExternal.cpp:76 +#: src/frontends/qt4/GuiDocument.cpp:1922 +#: src/frontends/qt4/GuiDocument.cpp:1929 +#: src/frontends/qt4/GuiDocument.cpp:1936 +#: src/frontends/qt4/GuiDocument.cpp:2021 +#: src/frontends/qt4/GuiDocument.cpp:2451 +#: src/frontends/qt4/GuiDocument.cpp:3510 src/frontends/qt4/GuiExternal.cpp:76 #: src/frontends/qt4/GuiGraphics.cpp:71 src/frontends/qt4/GuiIndices.cpp:57 #: src/frontends/qt4/GuiListings.cpp:152 src/frontends/qt4/GuiListings.cpp:159 #: src/frontends/qt4/GuiPrefs.cpp:2290 src/frontends/qt4/GuiPrefs.cpp:2549 @@ -1754,7 +1754,7 @@ msgstr Alle hinzufügen #: src/Buffer.cpp:2476 src/Buffer.cpp:3982 src/Buffer.cpp:4045 #: src/LyXVC.cpp:89 src/LyXVC.cpp:224 src/frontends/qt4/GuiBranches.cpp:219 #: src/frontends/qt4/GuiClipboard.cpp:242 -#: src/frontends/qt4/GuiDocument.cpp:2063 +#: src/frontends/qt4/GuiDocument.cpp:2066 #: src/frontends/qt4/GuiParagraph.cpp:69 #: src/frontends/qt4/GuiParagraph.cpp:159 src/frontends/qt4/GuiView.cpp:2150 #: src/frontends/qt4/GuiView.cpp:2301 src/frontends/qt4/GuiView.cpp:2316 @@ -1931,9 +1931,8 @@ msgstr Blocksatz msgid Center msgstr Zentriert -#: src/frontends/qt4/ui/TabularUi.ui:409 src/frontends/qt4/GuiTabular.cpp:214 -#: src/frontends/qt4/GuiTabular.cpp:215 src/frontends/qt4/GuiTabular.cpp:217 -#: src/frontends/qt4/GuiTabular.cpp:218 src/frontends/qt4/GuiTabular.cpp:837 +#: src/frontends/qt4/ui/TabularUi.ui:409 src/frontends/qt4/GuiTabular.cpp:218 +#: src/frontends/qt4/GuiTabular.cpp:837 msgid At Decimal Separator msgstr Am Dezimaltrenner @@ -7175,7 +7174,7 @@ msgstr Institut msgid E-Mail msgstr E-Mail -#: lib/layouts/aa.layout:414 src/insets/InsetHyperlink.cpp:261 +#: lib/layouts/aa.layout:414 src/insets/InsetHyperlink.cpp:274 msgid email msgstr E-Mail @@ -8298,10 +8297,10 @@ msgstr Schlagwörter: msgid [Acknowledgements] msgstr [Danksagungen] -#: lib/layouts/aastex.layout:404 src/frontends/qt4/GuiDocument.cpp:2257 -#: src/frontends/qt4/GuiDocument.cpp:2269 -#: src/frontends/qt4/GuiDocument.cpp:2368 -#: src/frontends/qt4/GuiDocument.cpp:2387 +#: lib/layouts/aastex.layout:404 src/frontends/qt4/GuiDocument.cpp:2260 +#: src/frontends/qt4/GuiDocument.cpp:2272 +#: src/frontends/qt4/GuiDocument.cpp:2371 +#: src/frontends/qt4/GuiDocument.cpp:2390 msgid and msgstr und @@ -12065,74 +12064,78 @@ msgid Bera Sans msgstr Bera Sans #: lib/latexfonts:396 +msgid Biolinum +msgstr Biolinum + +#: lib/latexfonts:404 msgid CM Bright msgstr CM Bright -#: lib/latexfonts:403 +#: lib/latexfonts:411 msgid Computer Modern Sans msgstr Computer Modern Sans -#: lib/latexfonts:409 +#: lib/latexfonts:417 msgid Helvetica msgstr Helvetica -#: lib/latexfonts:417 +#:
[LyX 2.0.x] validate encodable characters in href inset (#8357) (cherry picked from commit 5801ee2f9a0f6536c6753567b191302960b3bf4f)
The branch, 2.0.x, has been updated. - Log - commit 1ea66bb65fe110991c0abe2e0cea9143d08b6912 Author: Juergen Spitzmueller sp...@lyx.org Date: Fri Sep 28 09:27:39 2012 +0200 validate encodable characters in href inset (#8357) (cherry picked from commit 5801ee2f9a0f6536c6753567b191302960b3bf4f) diff --git a/src/insets/InsetHyperlink.cpp b/src/insets/InsetHyperlink.cpp index e87103a..c883a82 100644 --- a/src/insets/InsetHyperlink.cpp +++ b/src/insets/InsetHyperlink.cpp @@ -15,6 +15,7 @@ #include Buffer.h #include DispatchResult.h +#include Encoding.h #include Format.h #include FuncRequest.h #include FuncStatus.h @@ -28,6 +29,8 @@ #include support/gettext.h #include support/lstrings.h +#include frontends/alert.h + using namespace std; using namespace lyx::support; @@ -185,7 +188,17 @@ void InsetHyperlink::latex(otexstream os, (pos = name.find('~', i)) != string::npos; i = pos + 1) name.replace(pos, 1, sim); - + pairdocstring, docstring name_latexed = + runparams.encoding-latexString(name, runparams.dryrun); + name = name_latexed.first; + if (!name_latexed.second.empty()) { + // issue a warning about omitted characters + // FIXME: should be passed to the error dialog + frontend::Alert::warning(_(Uncodable characters), + bformat(_(The following characters that are used in the href inset are not\n + representable in the current encoding and therefore have been omitted:\n%1$s.), + name_latexed.second)); + } } // end if (!name.empty()) if (runparams.moving_arg) diff --git a/status.20x b/status.20x index 739846f..b1a669c 100644 --- a/status.20x +++ b/status.20x @@ -89,6 +89,8 @@ What's new - Fix bug that Elsevier documents became uncompilable when using refstyle for cross-references. +- Fix encoding problems in hyperlink name field (bug 8357). + - Fixed the layout file for scientific articles published by the American Psychological Association (APA) (bug 8187). --- Summary of changes: src/insets/InsetHyperlink.cpp | 15 ++- status.20x|2 ++ 2 files changed, 16 insertions(+), 1 deletions(-) hooks/post-receive -- The LyX Source Repository
[LyX 2.0.x] Revert validate encodable characters in href inset (#8357)
The branch, 2.0.x, has been updated. - Log - commit c5d56d260b6674693c0f79ea6d20ec90721b3f3d Author: Juergen Spitzmueller sp...@lyx.org Date: Fri Sep 28 15:44:11 2012 +0200 Revert validate encodable characters in href inset (#8357) This reverts commit 1ea66bb65fe110991c0abe2e0cea9143d08b6912. The method latexString does not exits in branch. diff --git a/src/insets/InsetHyperlink.cpp b/src/insets/InsetHyperlink.cpp index c883a82..e87103a 100644 --- a/src/insets/InsetHyperlink.cpp +++ b/src/insets/InsetHyperlink.cpp @@ -15,7 +15,6 @@ #include Buffer.h #include DispatchResult.h -#include Encoding.h #include Format.h #include FuncRequest.h #include FuncStatus.h @@ -29,8 +28,6 @@ #include support/gettext.h #include support/lstrings.h -#include frontends/alert.h - using namespace std; using namespace lyx::support; @@ -188,17 +185,7 @@ void InsetHyperlink::latex(otexstream os, (pos = name.find('~', i)) != string::npos; i = pos + 1) name.replace(pos, 1, sim); - pairdocstring, docstring name_latexed = - runparams.encoding-latexString(name, runparams.dryrun); - name = name_latexed.first; - if (!name_latexed.second.empty()) { - // issue a warning about omitted characters - // FIXME: should be passed to the error dialog - frontend::Alert::warning(_(Uncodable characters), - bformat(_(The following characters that are used in the href inset are not\n - representable in the current encoding and therefore have been omitted:\n%1$s.), - name_latexed.second)); - } + } // end if (!name.empty()) if (runparams.moving_arg) diff --git a/status.20x b/status.20x index b1a669c..739846f 100644 --- a/status.20x +++ b/status.20x @@ -89,8 +89,6 @@ What's new - Fix bug that Elsevier documents became uncompilable when using refstyle for cross-references. -- Fix encoding problems in hyperlink name field (bug 8357). - - Fixed the layout file for scientific articles published by the American Psychological Association (APA) (bug 8187). --- Summary of changes: src/insets/InsetHyperlink.cpp | 15 +-- status.20x|2 -- 2 files changed, 1 insertions(+), 16 deletions(-) hooks/post-receive -- The LyX Source Repository
[LyX 2.0.x] Working attempt at fixing #8357 in branch
The branch, 2.0.x, has been updated. - Log - commit 1d63d7838261922a03ef21ba42ce94cc2311d101 Author: Juergen Spitzmueller sp...@lyx.org Date: Fri Sep 28 16:04:04 2012 +0200 Working attempt at fixing #8357 in branch diff --git a/src/insets/InsetHyperlink.cpp b/src/insets/InsetHyperlink.cpp index e87103a..daaa870 100644 --- a/src/insets/InsetHyperlink.cpp +++ b/src/insets/InsetHyperlink.cpp @@ -15,6 +15,7 @@ #include Buffer.h #include DispatchResult.h +#include Encoding.h #include Format.h #include FuncRequest.h #include FuncStatus.h @@ -22,12 +23,15 @@ #include OutputParams.h #include output_xhtml.h +#include support/debug.h #include support/docstream.h #include support/FileName.h #include support/filetools.h #include support/gettext.h #include support/lstrings.h +#include frontends/alert.h + using namespace std; using namespace lyx::support; @@ -185,7 +189,40 @@ void InsetHyperlink::latex(otexstream os, (pos = name.find('~', i)) != string::npos; i = pos + 1) name.replace(pos, 1, sim); - + docstring name_latex; + docstring uncodable; + // validate encoding + for (size_t n = 0; n name.size(); ++n) { + try { + char_type const c = name[n]; + docstring const latex = runparams.encoding-latexChar(c); + name_latex += latex; + if (latex.length() 1 latex[latex.length() - 1] != '}') { + // Prevent eating of a following + // space or command corruption by + // following characters + name_latex += {}; + } + } catch (EncodingException /* e */) { + LYXERR0(Uncodable character in href inset!); + if (runparams.dryrun) { + name_latex += + _(LyX Warning: ) + + _(uncodable character) + '; + name_latex += docstring(1, name[n]); + name_latex += '; + } else + uncodable += name[n]; + } + } + if (!uncodable.empty()) { + // issue a warning about omitted characters + // FIXME: should be passed to the error dialog + frontend::Alert::warning(_(Uncodable characters), + bformat(_(The following characters that are used in the href inset are not\n + representable in the current encoding and therefore have been omitted:\n%1$s.), + uncodable)); + } + name = name_latex; } // end if (!name.empty()) if (runparams.moving_arg) diff --git a/status.20x b/status.20x index 739846f..6e60d8d 100644 --- a/status.20x +++ b/status.20x @@ -86,6 +86,8 @@ What's new - Export correct language change commands if document contains different CJK languages (bug 8215). +- Fix encoding problems in hyperlink name field (bug 8357). + - Fix bug that Elsevier documents became uncompilable when using refstyle for cross-references. --- Summary of changes: src/insets/InsetHyperlink.cpp | 39 ++- status.20x|2 ++ 2 files changed, 40 insertions(+), 1 deletions(-) hooks/post-receive -- The LyX Source Repository
[LyX 2.0.x] de.po: update
The branch, 2.0.x, has been updated. - Log - commit 863e0a0bc9ebac8a8643f0b0642671866e913fcd Author: Juergen Spitzmueller sp...@lyx.org Date: Fri Sep 28 16:08:58 2012 +0200 de.po: update diff --git a/po/de.po b/po/de.po index 33b63bb..c3eed1c 100644 --- a/po/de.po +++ b/po/de.po @@ -95,8 +95,8 @@ msgid msgstr Project-Id-Version: LyX 2.0\n Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n -POT-Creation-Date: 2012-09-24 18:19+0200\n -PO-Revision-Date: 2012-09-24 18:22+0200\n +POT-Creation-Date: 2012-09-28 16:07+0200\n +PO-Revision-Date: 2012-09-28 16:08+0200\n Last-Translator: Jürgen Spitzmüller sp...@lyx.org\n Language-Team: German lyx-d...@lists.lyx.org\n Language: de\n @@ -6295,7 +6295,7 @@ msgstr E-Mail msgid Email msgstr E-Mail -#: lib/layouts/aa.layout:414 src/insets/InsetHyperlink.cpp:261 +#: lib/layouts/aa.layout:414 src/insets/InsetHyperlink.cpp:298 msgid email msgstr E-Mail @@ -17785,16 +17785,17 @@ msgstr #: src/Changes.cpp:363 src/Paragraph.cpp:2523 #: src/frontends/qt4/LaTeXHighlighter.cpp:108 src/insets/InsetBibitem.cpp:300 -#: src/insets/InsetCommandParams.cpp:390 src/insets/InsetListings.cpp:182 -#: src/insets/InsetListings.cpp:190 src/insets/InsetListings.cpp:212 -#: src/insets/InsetNomencl.cpp:285 src/mathed/InsetMathString.cpp:161 +#: src/insets/InsetCommandParams.cpp:390 src/insets/InsetHyperlink.cpp:209 +#: src/insets/InsetListings.cpp:182 src/insets/InsetListings.cpp:190 +#: src/insets/InsetListings.cpp:212 src/insets/InsetNomencl.cpp:285 +#: src/mathed/InsetMathString.cpp:161 msgid LyX Warning: msgstr LyX-Warnung: #: src/Changes.cpp:364 src/Paragraph.cpp:2524 src/insets/InsetBibitem.cpp:301 -#: src/insets/InsetCommandParams.cpp:391 src/insets/InsetListings.cpp:183 -#: src/insets/InsetListings.cpp:191 src/insets/InsetNomencl.cpp:286 -#: src/mathed/InsetMathString.cpp:162 +#: src/insets/InsetCommandParams.cpp:391 src/insets/InsetHyperlink.cpp:210 +#: src/insets/InsetListings.cpp:183 src/insets/InsetListings.cpp:191 +#: src/insets/InsetNomencl.cpp:286 src/mathed/InsetMathString.cpp:162 msgid uncodable character msgstr unkodierbares Zeichen @@ -23290,7 +23291,7 @@ msgstr Unbekannter Argumentname: msgid Missing \\end_inset at this point: msgstr Fehlendes \\end_inset an dieser Stelle: -#: src/insets/InsetCommandParams.cpp:401 +#: src/insets/InsetCommandParams.cpp:401 src/insets/InsetHyperlink.cpp:220 msgid Uncodable characters msgstr unkodierbare Zeichen @@ -23366,15 +23367,28 @@ msgstr Es ist keine Konvertierung von %1$s notwendig msgid Graphics file: %1$s msgstr Grafikdatei: %1$s -#: src/insets/InsetHyperlink.cpp:259 +#: src/insets/InsetHyperlink.cpp:221 +#, c-format +msgid +The following characters that are used in the href inset are not\n +representable in the current encoding and therefore have been omitted:\n +%1$s. +msgstr +Die folgenden Zeichen, die in der Hyperlink-Einfügung verwendet werden, sind +in +der\n +aktuellen Zeichenkodierung nicht darstellbar und wurden daher weggelassen:\n +%1$s. + +#: src/insets/InsetHyperlink.cpp:296 msgid www msgstr www -#: src/insets/InsetHyperlink.cpp:263 +#: src/insets/InsetHyperlink.cpp:300 msgid file msgstr Datei -#: src/insets/InsetHyperlink.cpp:264 +#: src/insets/InsetHyperlink.cpp:301 #, c-format msgid Hyperlink (%1$s) to %2$s msgstr Hyperlink (%1$s) to %2$s --- Summary of changes: po/de.po | 40 +++- 1 files changed, 27 insertions(+), 13 deletions(-) hooks/post-receive -- The LyX Source Repository
[LyX 2.0.x] * sk.po
The branch, 2.0.x, has been updated. - Log - commit 4e6b5c6837aae4b9c3e93d8d1207a9588a096412 Author: Kornel Benko kor...@lyx.org Date: Fri Sep 28 16:33:31 2012 +0200 * sk.po diff --git a/po/sk.po b/po/sk.po index 3ca1d1e..f55da3d 100644 --- a/po/sk.po +++ b/po/sk.po @@ -8,7 +8,7 @@ msgid msgstr Project-Id-Version: LyX-2.1\n Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n -POT-Creation-Date: 2012-09-24 18:04+0200\n +POT-Creation-Date: 2012-09-28 16:28+0200\n PO-Revision-Date: 2012-04-08 11:27+0100\n Last-Translator: Kornel Benko kor...@lyx.org\n Language-Team: Slovak lyx-d...@lists.lyx.org\n @@ -23073,6 +23073,17 @@ msgstr Konverziu %1$s netreba msgid Graphics file: %1$s msgstr Grafický súbor: %1$s +#: src/insets/InsetHyperlink.cpp:221 +#, c-format +msgid +The following characters that are used in the href inset are not\n +representable in the current encoding and therefore have been omitted:\n +%1$s. +msgstr +Nasledujúce znaky použité vo vložke href sú nereprezentovateľné\n +v aktuálnom kódovanà a boli vynechané:\n +%1$s. + #: src/insets/InsetHyperlink.cpp:259 msgid www msgstr www --- Summary of changes: po/sk.po | 13 - 1 files changed, 12 insertions(+), 1 deletions(-) hooks/post-receive -- The LyX Source Repository
[LyX master] * sk.po
The branch, master, has been updated. - Log - commit d708710c47572d8c1075bb50f725a4aa3af073b3 Author: Kornel Benko kor...@lyx.org Date: Fri Sep 28 16:34:08 2012 +0200 * sk.po diff --git a/po/sk.po b/po/sk.po index 66a35d4..b5c746b 100644 --- a/po/sk.po +++ b/po/sk.po @@ -8,7 +8,7 @@ msgid msgstr Project-Id-Version: LyX-2.1\n Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n -POT-Creation-Date: 2012-09-25 12:13+0200\n +POT-Creation-Date: 2012-09-28 15:56+0200\n PO-Revision-Date: 2012-04-08 11:27+0100\n Last-Translator: Kornel Benko kor...@lyx.org\n Language-Team: Slovak lyx-d...@lists.lyx.org\n @@ -24446,6 +24446,17 @@ msgstr Konverziu %1$s netreba msgid Graphics file: %1$s msgstr Grafický súbor: %1$s +#: src/insets/InsetHyperlink.cpp:198 +#, c-format +msgid +The following characters that are used in the href inset are not\n +representable in the current encoding and therefore have been omitted:\n +%1$s. +msgstr +Nasledujúce znaky použité vo vložke href sú nereprezentovateľné\n +v aktuálnom kódovanà a boli vynechané:\n +%1$s. + #: src/insets/InsetHyperlink.cpp:259 msgid www msgstr www --- Summary of changes: po/sk.po | 13 - 1 files changed, 12 insertions(+), 1 deletions(-) hooks/post-receive -- The LyX Source Repository
[LyX master] validate encodable characters in href inset (#8357)
The branch, master, has been updated. - Log - commit 5801ee2f9a0f6536c6753567b191302960b3bf4f Author: Juergen SpitzmuellerDate: Fri Sep 28 09:27:39 2012 +0200 validate encodable characters in href inset (#8357) diff --git a/src/insets/InsetHyperlink.cpp b/src/insets/InsetHyperlink.cpp index 442b839..37692af 100644 --- a/src/insets/InsetHyperlink.cpp +++ b/src/insets/InsetHyperlink.cpp @@ -15,6 +15,7 @@ #include "Buffer.h" #include "DispatchResult.h" +#include "Encoding.h" #include "Format.h" #include "FuncRequest.h" #include "FuncStatus.h" @@ -28,6 +29,8 @@ #include "support/gettext.h" #include "support/lstrings.h" +#include "frontends/alert.h" + using namespace std; using namespace lyx::support; @@ -185,7 +188,17 @@ void InsetHyperlink::latex(otexstream & os, (pos = name.find('~', i)) != string::npos; i = pos + 1) name.replace(pos, 1, sim); - + pair name_latexed = + runparams.encoding->latexString(name, runparams.dryrun); + name = name_latexed.first; + if (!name_latexed.second.empty()) { + // issue a warning about omitted characters + // FIXME: should be passed to the error dialog + frontend::Alert::warning(_("Uncodable characters"), + bformat(_("The following characters that are used in the href inset are not\n" + "representable in the current encoding and therefore have been omitted:\n%1$s."), + name_latexed.second)); + } } // end if (!name.empty()) if (runparams.moving_arg) --- Summary of changes: src/insets/InsetHyperlink.cpp | 15 ++- 1 files changed, 14 insertions(+), 1 deletions(-) hooks/post-receive -- The LyX Source Repository
[LyX master] de.po: update
The branch, master, has been updated. - Log - commit 3c5409b4cdd9922303f391c2ceb4e91f82410210 Author: Juergen SpitzmuellerDate: Fri Sep 28 10:03:20 2012 +0200 de.po: update diff --git a/po/de.po b/po/de.po index 5c7fd38..6b9ee14 100644 --- a/po/de.po +++ b/po/de.po @@ -95,8 +95,8 @@ msgid "" msgstr "" "Project-Id-Version: LyX 2.1\n" "Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n" -"POT-Creation-Date: 2012-09-23 18:39+0200\n" -"PO-Revision-Date: 2012-09-23 18:47+0200\n" +"POT-Creation-Date: 2012-09-28 10:00+0200\n" +"PO-Revision-Date: 2012-09-28 10:03+0200\n" "Last-Translator: Jürgen Spitzmüller \n" "Language-Team: German \n" "Language: de\n" @@ -458,8 +458,8 @@ msgstr "Neue Einfügung" #: src/frontends/qt4/ui/ListingsUi.ui:549 #: src/frontends/qt4/ui/DocumentUi.ui:77 #: src/frontends/qt4/ui/CharacterUi.ui:367 src/frontends/qt4/ui/RefUi.ui:330 -#: src/frontends/qt4/ui/SendtoUi.ui:85 src/frontends/qt4/GuiDocument.cpp:2139 -#: src/frontends/qt4/GuiDocument.cpp:3454 +#: src/frontends/qt4/ui/SendtoUi.ui:85 src/frontends/qt4/GuiDocument.cpp:2142 +#: src/frontends/qt4/GuiDocument.cpp:3453 msgid "" msgstr "&Ãbernehmen" @@ -620,7 +620,7 @@ msgstr "Wählen Sie, welches Sprachpaket LyX verwenden soll" #: src/frontends/qt4/ui/PrefLanguageUi.ui:55 #: src/frontends/qt4/GuiDocument.cpp:1081 -#: src/frontends/qt4/GuiDocument.cpp:1940 +#: src/frontends/qt4/GuiDocument.cpp:1943 msgid "Automatic" msgstr "Automatisch" @@ -1236,16 +1236,16 @@ msgstr "Zeilen" #: src/frontends/qt4/GuiDocument.cpp:910 #: src/frontends/qt4/GuiDocument.cpp:1079 #: src/frontends/qt4/GuiDocument.cpp:1165 -#: src/frontends/qt4/GuiDocument.cpp:1824 +#: src/frontends/qt4/GuiDocument.cpp:1822 +#: src/frontends/qt4/GuiDocument.cpp:1900 +#: src/frontends/qt4/GuiDocument.cpp:1901 #: src/frontends/qt4/GuiDocument.cpp:1902 -#: src/frontends/qt4/GuiDocument.cpp:1903 -#: src/frontends/qt4/GuiDocument.cpp:1904 -#: src/frontends/qt4/GuiDocument.cpp:1919 -#: src/frontends/qt4/GuiDocument.cpp:1926 -#: src/frontends/qt4/GuiDocument.cpp:1933 -#: src/frontends/qt4/GuiDocument.cpp:2018 -#: src/frontends/qt4/GuiDocument.cpp:2448 -#: src/frontends/qt4/GuiDocument.cpp:3511 src/frontends/qt4/GuiExternal.cpp:76 +#: src/frontends/qt4/GuiDocument.cpp:1922 +#: src/frontends/qt4/GuiDocument.cpp:1929 +#: src/frontends/qt4/GuiDocument.cpp:1936 +#: src/frontends/qt4/GuiDocument.cpp:2021 +#: src/frontends/qt4/GuiDocument.cpp:2451 +#: src/frontends/qt4/GuiDocument.cpp:3510 src/frontends/qt4/GuiExternal.cpp:76 #: src/frontends/qt4/GuiGraphics.cpp:71 src/frontends/qt4/GuiIndices.cpp:57 #: src/frontends/qt4/GuiListings.cpp:152 src/frontends/qt4/GuiListings.cpp:159 #: src/frontends/qt4/GuiPrefs.cpp:2290 src/frontends/qt4/GuiPrefs.cpp:2549 @@ -1754,7 +1754,7 @@ msgstr "A hinzufügen" #: src/Buffer.cpp:2476 src/Buffer.cpp:3982 src/Buffer.cpp:4045 #: src/LyXVC.cpp:89 src/LyXVC.cpp:224 src/frontends/qt4/GuiBranches.cpp:219 #: src/frontends/qt4/GuiClipboard.cpp:242 -#: src/frontends/qt4/GuiDocument.cpp:2063 +#: src/frontends/qt4/GuiDocument.cpp:2066 #: src/frontends/qt4/GuiParagraph.cpp:69 #: src/frontends/qt4/GuiParagraph.cpp:159 src/frontends/qt4/GuiView.cpp:2150 #: src/frontends/qt4/GuiView.cpp:2301 src/frontends/qt4/GuiView.cpp:2316 @@ -1931,9 +1931,8 @@ msgstr "Blocksatz" msgid "Center" msgstr "Zentriert" -#: src/frontends/qt4/ui/TabularUi.ui:409 src/frontends/qt4/GuiTabular.cpp:214 -#: src/frontends/qt4/GuiTabular.cpp:215 src/frontends/qt4/GuiTabular.cpp:217 -#: src/frontends/qt4/GuiTabular.cpp:218 src/frontends/qt4/GuiTabular.cpp:837 +#: src/frontends/qt4/ui/TabularUi.ui:409 src/frontends/qt4/GuiTabular.cpp:218 +#: src/frontends/qt4/GuiTabular.cpp:837 msgid "At Decimal Separator" msgstr "Am Dezimaltrenner" @@ -7175,7 +7174,7 @@ msgstr "Institut" msgid "E-Mail" msgstr "E-Mail" -#: lib/layouts/aa.layout:414 src/insets/InsetHyperlink.cpp:261 +#: lib/layouts/aa.layout:414 src/insets/InsetHyperlink.cpp:274 msgid "email" msgstr "E-Mail" @@ -8298,10 +8297,10 @@ msgstr "Schlagwörter:" msgid "[Acknowledgements]" msgstr "[Danksagungen]" -#: lib/layouts/aastex.layout:404 src/frontends/qt4/GuiDocument.cpp:2257 -#: src/frontends/qt4/GuiDocument.cpp:2269 -#: src/frontends/qt4/GuiDocument.cpp:2368 -#: src/frontends/qt4/GuiDocument.cpp:2387 +#: lib/layouts/aastex.layout:404 src/frontends/qt4/GuiDocument.cpp:2260 +#: src/frontends/qt4/GuiDocument.cpp:2272 +#: src/frontends/qt4/GuiDocument.cpp:2371 +#: src/frontends/qt4/GuiDocument.cpp:2390 msgid "and" msgstr "und" @@ -12065,74 +12064,78 @@ msgid "Bera Sans" msgstr "Bera Sans" #: lib/latexfonts:396 +msgid "Biolinum" +msgstr "Biolinum" + +#: lib/latexfonts:404 msgid "CM Bright" msgstr "CM Bright" -#: lib/latexfonts:403 +#: lib/latexfonts:411 msgid "Computer Modern Sans" msgstr "Computer Modern Sans" -#: lib/latexfonts:409 +#: lib/latexfonts:417
[LyX 2.0.x] validate encodable characters in href inset (#8357) (cherry picked from commit 5801ee2f9a0f6536c6753567b191302960b3bf4f)
The branch, 2.0.x, has been updated. - Log - commit 1ea66bb65fe110991c0abe2e0cea9143d08b6912 Author: Juergen SpitzmuellerDate: Fri Sep 28 09:27:39 2012 +0200 validate encodable characters in href inset (#8357) (cherry picked from commit 5801ee2f9a0f6536c6753567b191302960b3bf4f) diff --git a/src/insets/InsetHyperlink.cpp b/src/insets/InsetHyperlink.cpp index e87103a..c883a82 100644 --- a/src/insets/InsetHyperlink.cpp +++ b/src/insets/InsetHyperlink.cpp @@ -15,6 +15,7 @@ #include "Buffer.h" #include "DispatchResult.h" +#include "Encoding.h" #include "Format.h" #include "FuncRequest.h" #include "FuncStatus.h" @@ -28,6 +29,8 @@ #include "support/gettext.h" #include "support/lstrings.h" +#include "frontends/alert.h" + using namespace std; using namespace lyx::support; @@ -185,7 +188,17 @@ void InsetHyperlink::latex(otexstream & os, (pos = name.find('~', i)) != string::npos; i = pos + 1) name.replace(pos, 1, sim); - + pair name_latexed = + runparams.encoding->latexString(name, runparams.dryrun); + name = name_latexed.first; + if (!name_latexed.second.empty()) { + // issue a warning about omitted characters + // FIXME: should be passed to the error dialog + frontend::Alert::warning(_("Uncodable characters"), + bformat(_("The following characters that are used in the href inset are not\n" + "representable in the current encoding and therefore have been omitted:\n%1$s."), + name_latexed.second)); + } } // end if (!name.empty()) if (runparams.moving_arg) diff --git a/status.20x b/status.20x index 739846f..b1a669c 100644 --- a/status.20x +++ b/status.20x @@ -89,6 +89,8 @@ What's new - Fix bug that Elsevier documents became uncompilable when using refstyle for cross-references. +- Fix encoding problems in hyperlink name field (bug 8357). + - Fixed the layout file for scientific articles published by the American Psychological Association (APA) (bug 8187). --- Summary of changes: src/insets/InsetHyperlink.cpp | 15 ++- status.20x|2 ++ 2 files changed, 16 insertions(+), 1 deletions(-) hooks/post-receive -- The LyX Source Repository
[LyX 2.0.x] Revert "validate encodable characters in href inset (#8357)"
The branch, 2.0.x, has been updated. - Log - commit c5d56d260b6674693c0f79ea6d20ec90721b3f3d Author: Juergen SpitzmuellerDate: Fri Sep 28 15:44:11 2012 +0200 Revert "validate encodable characters in href inset (#8357)" This reverts commit 1ea66bb65fe110991c0abe2e0cea9143d08b6912. The method latexString does not exits in branch. diff --git a/src/insets/InsetHyperlink.cpp b/src/insets/InsetHyperlink.cpp index c883a82..e87103a 100644 --- a/src/insets/InsetHyperlink.cpp +++ b/src/insets/InsetHyperlink.cpp @@ -15,7 +15,6 @@ #include "Buffer.h" #include "DispatchResult.h" -#include "Encoding.h" #include "Format.h" #include "FuncRequest.h" #include "FuncStatus.h" @@ -29,8 +28,6 @@ #include "support/gettext.h" #include "support/lstrings.h" -#include "frontends/alert.h" - using namespace std; using namespace lyx::support; @@ -188,17 +185,7 @@ void InsetHyperlink::latex(otexstream & os, (pos = name.find('~', i)) != string::npos; i = pos + 1) name.replace(pos, 1, sim); - pair name_latexed = - runparams.encoding->latexString(name, runparams.dryrun); - name = name_latexed.first; - if (!name_latexed.second.empty()) { - // issue a warning about omitted characters - // FIXME: should be passed to the error dialog - frontend::Alert::warning(_("Uncodable characters"), - bformat(_("The following characters that are used in the href inset are not\n" - "representable in the current encoding and therefore have been omitted:\n%1$s."), - name_latexed.second)); - } + } // end if (!name.empty()) if (runparams.moving_arg) diff --git a/status.20x b/status.20x index b1a669c..739846f 100644 --- a/status.20x +++ b/status.20x @@ -89,8 +89,6 @@ What's new - Fix bug that Elsevier documents became uncompilable when using refstyle for cross-references. -- Fix encoding problems in hyperlink name field (bug 8357). - - Fixed the layout file for scientific articles published by the American Psychological Association (APA) (bug 8187). --- Summary of changes: src/insets/InsetHyperlink.cpp | 15 +-- status.20x|2 -- 2 files changed, 1 insertions(+), 16 deletions(-) hooks/post-receive -- The LyX Source Repository
[LyX 2.0.x] Working attempt at fixing #8357 in branch
The branch, 2.0.x, has been updated. - Log - commit 1d63d7838261922a03ef21ba42ce94cc2311d101 Author: Juergen SpitzmuellerDate: Fri Sep 28 16:04:04 2012 +0200 Working attempt at fixing #8357 in branch diff --git a/src/insets/InsetHyperlink.cpp b/src/insets/InsetHyperlink.cpp index e87103a..daaa870 100644 --- a/src/insets/InsetHyperlink.cpp +++ b/src/insets/InsetHyperlink.cpp @@ -15,6 +15,7 @@ #include "Buffer.h" #include "DispatchResult.h" +#include "Encoding.h" #include "Format.h" #include "FuncRequest.h" #include "FuncStatus.h" @@ -22,12 +23,15 @@ #include "OutputParams.h" #include "output_xhtml.h" +#include "support/debug.h" #include "support/docstream.h" #include "support/FileName.h" #include "support/filetools.h" #include "support/gettext.h" #include "support/lstrings.h" +#include "frontends/alert.h" + using namespace std; using namespace lyx::support; @@ -185,7 +189,40 @@ void InsetHyperlink::latex(otexstream & os, (pos = name.find('~', i)) != string::npos; i = pos + 1) name.replace(pos, 1, sim); - + docstring name_latex; + docstring uncodable; + // validate encoding + for (size_t n = 0; n < name.size(); ++n) { + try { + char_type const c = name[n]; + docstring const latex = runparams.encoding->latexChar(c); + name_latex += latex; + if (latex.length() > 1 && latex[latex.length() - 1] != '}') { + // Prevent eating of a following + // space or command corruption by + // following characters + name_latex += "{}"; + } + } catch (EncodingException & /* e */) { + LYXERR0("Uncodable character in href inset!"); + if (runparams.dryrun) { + name_latex += "<" + _("LyX Warning: ") + + _("uncodable character") + " '"; + name_latex += docstring(1, name[n]); + name_latex += "'>"; + } else + uncodable += name[n]; + } + } + if (!uncodable.empty()) { + // issue a warning about omitted characters + // FIXME: should be passed to the error dialog + frontend::Alert::warning(_("Uncodable characters"), + bformat(_("The following characters that are used in the href inset are not\n" + "representable in the current encoding and therefore have been omitted:\n%1$s."), + uncodable)); + } + name = name_latex; } // end if (!name.empty()) if (runparams.moving_arg) diff --git a/status.20x b/status.20x index 739846f..6e60d8d 100644 --- a/status.20x +++ b/status.20x @@ -86,6 +86,8 @@ What's new - Export correct language change commands if document contains different CJK languages (bug 8215). +- Fix encoding problems in hyperlink name field (bug 8357). + - Fix bug that Elsevier documents became uncompilable when using refstyle for cross-references. --- Summary of changes: src/insets/InsetHyperlink.cpp | 39 ++- status.20x|2 ++ 2 files changed, 40 insertions(+), 1 deletions(-) hooks/post-receive -- The LyX Source Repository
[LyX 2.0.x] de.po: update
The branch, 2.0.x, has been updated. - Log - commit 863e0a0bc9ebac8a8643f0b0642671866e913fcd Author: Juergen SpitzmuellerDate: Fri Sep 28 16:08:58 2012 +0200 de.po: update diff --git a/po/de.po b/po/de.po index 33b63bb..c3eed1c 100644 --- a/po/de.po +++ b/po/de.po @@ -95,8 +95,8 @@ msgid "" msgstr "" "Project-Id-Version: LyX 2.0\n" "Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n" -"POT-Creation-Date: 2012-09-24 18:19+0200\n" -"PO-Revision-Date: 2012-09-24 18:22+0200\n" +"POT-Creation-Date: 2012-09-28 16:07+0200\n" +"PO-Revision-Date: 2012-09-28 16:08+0200\n" "Last-Translator: Jürgen Spitzmüller \n" "Language-Team: German \n" "Language: de\n" @@ -6295,7 +6295,7 @@ msgstr "E-Mail" msgid "Email" msgstr "E-Mail" -#: lib/layouts/aa.layout:414 src/insets/InsetHyperlink.cpp:261 +#: lib/layouts/aa.layout:414 src/insets/InsetHyperlink.cpp:298 msgid "email" msgstr "E-Mail" @@ -17785,16 +17785,17 @@ msgstr "" #: src/Changes.cpp:363 src/Paragraph.cpp:2523 #: src/frontends/qt4/LaTeXHighlighter.cpp:108 src/insets/InsetBibitem.cpp:300 -#: src/insets/InsetCommandParams.cpp:390 src/insets/InsetListings.cpp:182 -#: src/insets/InsetListings.cpp:190 src/insets/InsetListings.cpp:212 -#: src/insets/InsetNomencl.cpp:285 src/mathed/InsetMathString.cpp:161 +#: src/insets/InsetCommandParams.cpp:390 src/insets/InsetHyperlink.cpp:209 +#: src/insets/InsetListings.cpp:182 src/insets/InsetListings.cpp:190 +#: src/insets/InsetListings.cpp:212 src/insets/InsetNomencl.cpp:285 +#: src/mathed/InsetMathString.cpp:161 msgid "LyX Warning: " msgstr "LyX-Warnung: " #: src/Changes.cpp:364 src/Paragraph.cpp:2524 src/insets/InsetBibitem.cpp:301 -#: src/insets/InsetCommandParams.cpp:391 src/insets/InsetListings.cpp:183 -#: src/insets/InsetListings.cpp:191 src/insets/InsetNomencl.cpp:286 -#: src/mathed/InsetMathString.cpp:162 +#: src/insets/InsetCommandParams.cpp:391 src/insets/InsetHyperlink.cpp:210 +#: src/insets/InsetListings.cpp:183 src/insets/InsetListings.cpp:191 +#: src/insets/InsetNomencl.cpp:286 src/mathed/InsetMathString.cpp:162 msgid "uncodable character" msgstr "unkodierbares Zeichen" @@ -23290,7 +23291,7 @@ msgstr "Unbekannter Argumentname: " msgid "Missing \\end_inset at this point: " msgstr "Fehlendes \\end_inset an dieser Stelle:" -#: src/insets/InsetCommandParams.cpp:401 +#: src/insets/InsetCommandParams.cpp:401 src/insets/InsetHyperlink.cpp:220 msgid "Uncodable characters" msgstr "unkodierbare Zeichen" @@ -23366,15 +23367,28 @@ msgstr "Es ist keine Konvertierung von %1$s notwendig" msgid "Graphics file: %1$s" msgstr "Grafikdatei: %1$s" -#: src/insets/InsetHyperlink.cpp:259 +#: src/insets/InsetHyperlink.cpp:221 +#, c-format +msgid "" +"The following characters that are used in the href inset are not\n" +"representable in the current encoding and therefore have been omitted:\n" +"%1$s." +msgstr "" +"Die folgenden Zeichen, die in der Hyperlink-Einfügung verwendet werden, sind " +"in " +"der\n" +"aktuellen Zeichenkodierung nicht darstellbar und wurden daher weggelassen:\n" +"%1$s." + +#: src/insets/InsetHyperlink.cpp:296 msgid "www" msgstr "www" -#: src/insets/InsetHyperlink.cpp:263 +#: src/insets/InsetHyperlink.cpp:300 msgid "file" msgstr "Datei" -#: src/insets/InsetHyperlink.cpp:264 +#: src/insets/InsetHyperlink.cpp:301 #, c-format msgid "Hyperlink (%1$s) to %2$s" msgstr "Hyperlink (%1$s) to %2$s" --- Summary of changes: po/de.po | 40 +++- 1 files changed, 27 insertions(+), 13 deletions(-) hooks/post-receive -- The LyX Source Repository
[LyX 2.0.x] * sk.po
The branch, 2.0.x, has been updated. - Log - commit 4e6b5c6837aae4b9c3e93d8d1207a9588a096412 Author: Kornel BenkoDate: Fri Sep 28 16:33:31 2012 +0200 * sk.po diff --git a/po/sk.po b/po/sk.po index 3ca1d1e..f55da3d 100644 --- a/po/sk.po +++ b/po/sk.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: LyX-2.1\n" "Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n" -"POT-Creation-Date: 2012-09-24 18:04+0200\n" +"POT-Creation-Date: 2012-09-28 16:28+0200\n" "PO-Revision-Date: 2012-04-08 11:27+0100\n" "Last-Translator: Kornel Benko \n" "Language-Team: Slovak \n" @@ -23073,6 +23073,17 @@ msgstr "Konverziu %1$s netreba" msgid "Graphics file: %1$s" msgstr "Grafický súbor: %1$s" +#: src/insets/InsetHyperlink.cpp:221 +#, c-format +msgid "" +"The following characters that are used in the href inset are not\n" +"representable in the current encoding and therefore have been omitted:\n" +"%1$s." +msgstr "" +"Nasledujúce znaky použité vo vložke href sú nereprezentovateľné\n" +"v aktuálnom kódovanà a boli vynechané:\n" +"%1$s." + #: src/insets/InsetHyperlink.cpp:259 msgid "www" msgstr "www" --- Summary of changes: po/sk.po | 13 - 1 files changed, 12 insertions(+), 1 deletions(-) hooks/post-receive -- The LyX Source Repository
[LyX master] * sk.po
The branch, master, has been updated. - Log - commit d708710c47572d8c1075bb50f725a4aa3af073b3 Author: Kornel BenkoDate: Fri Sep 28 16:34:08 2012 +0200 * sk.po diff --git a/po/sk.po b/po/sk.po index 66a35d4..b5c746b 100644 --- a/po/sk.po +++ b/po/sk.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: LyX-2.1\n" "Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n" -"POT-Creation-Date: 2012-09-25 12:13+0200\n" +"POT-Creation-Date: 2012-09-28 15:56+0200\n" "PO-Revision-Date: 2012-04-08 11:27+0100\n" "Last-Translator: Kornel Benko \n" "Language-Team: Slovak \n" @@ -24446,6 +24446,17 @@ msgstr "Konverziu %1$s netreba" msgid "Graphics file: %1$s" msgstr "Grafický súbor: %1$s" +#: src/insets/InsetHyperlink.cpp:198 +#, c-format +msgid "" +"The following characters that are used in the href inset are not\n" +"representable in the current encoding and therefore have been omitted:\n" +"%1$s." +msgstr "" +"Nasledujúce znaky použité vo vložke href sú nereprezentovateľné\n" +"v aktuálnom kódovanà a boli vynechané:\n" +"%1$s." + #: src/insets/InsetHyperlink.cpp:259 msgid "www" msgstr "www" --- Summary of changes: po/sk.po | 13 - 1 files changed, 12 insertions(+), 1 deletions(-) hooks/post-receive -- The LyX Source Repository