mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-13 17:20:55 +00:00
Avoid unnecessary exceptions.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@33517 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
a03f6c9964
commit
cff9254f1d
@ -1185,21 +1185,17 @@ void Buffer::writeLaTeXSource(odocstream & os,
|
||||
// We don't know the encoding of inputpath
|
||||
docstring const inputpath = from_utf8(latex_path(original_path));
|
||||
docstring uncodable_glyphs;
|
||||
for (size_t n = 0; n < inputpath.size(); ++n) {
|
||||
docstring const glyph = docstring(1, inputpath[n]);
|
||||
try {
|
||||
if (runparams.encoding
|
||||
&& runparams.encoding->latexChar(inputpath[n]) != glyph) {
|
||||
Encoding const * const enc = runparams.encoding;
|
||||
if (enc) {
|
||||
for (size_t n = 0; n < inputpath.size(); ++n) {
|
||||
docstring const glyph =
|
||||
docstring(1, inputpath[n]);
|
||||
if (enc->latexChar(inputpath[n], true) != glyph) {
|
||||
LYXERR0("Uncodable character '"
|
||||
<< glyph
|
||||
<< "' in input path!");
|
||||
uncodable_glyphs += glyph;
|
||||
}
|
||||
} catch (EncodingException & /* e */) {
|
||||
LYXERR0("Uncodable character '"
|
||||
<< glyph
|
||||
<< "' in input path!");
|
||||
uncodable_glyphs += glyph;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1215,9 +1211,9 @@ void Buffer::writeLaTeXSource(odocstream & os,
|
||||
"or change the path name."), inputpath, uncodable_glyphs));
|
||||
} else {
|
||||
os << "\\makeatletter\n"
|
||||
<< "\\def\\input@path{{"
|
||||
<< inputpath << "/}}\n"
|
||||
<< "\\makeatother\n";
|
||||
<< "\\def\\input@path{{"
|
||||
<< inputpath << "/}}\n"
|
||||
<< "\\makeatother\n";
|
||||
d->texrow.newline();
|
||||
d->texrow.newline();
|
||||
d->texrow.newline();
|
||||
|
@ -344,7 +344,7 @@ void Encoding::init() const
|
||||
}
|
||||
|
||||
|
||||
docstring Encoding::latexChar(char_type c, bool for_mathed) const
|
||||
docstring Encoding::latexChar(char_type c, bool no_commands) const
|
||||
{
|
||||
// assure the used encoding is properly initialized
|
||||
init();
|
||||
@ -355,7 +355,7 @@ docstring Encoding::latexChar(char_type c, bool for_mathed) const
|
||||
return docstring(1, c);
|
||||
if (encodable_.find(c) != encodable_.end())
|
||||
return docstring(1, c);
|
||||
if (for_mathed)
|
||||
if (no_commands)
|
||||
return docstring();
|
||||
|
||||
// c cannot (or should not) be encoded in this encoding
|
||||
|
@ -75,7 +75,7 @@ public:
|
||||
* LaTeX macro is known, a warning is given of lyxerr, and the
|
||||
* character is returned.
|
||||
*/
|
||||
docstring latexChar(char_type c, bool for_mathed = false) const;
|
||||
docstring latexChar(char_type c, bool no_commands = false) const;
|
||||
/// Which LaTeX package handles this encoding?
|
||||
Package package() const { return package_; }
|
||||
/// A list of all characters usable in this encoding
|
||||
|
Loading…
Reference in New Issue
Block a user