The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 5801ee2f9a0f6536c6753567b191302960b3bf4f
Author: Juergen Spitzmueller <[email protected]>
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);
-
+               pair<docstring, 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

Reply via email to