mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-13 01:08:45 +00:00
* src/frontends/controllers/ControlCitation.cpp:
- catch exception from boost::regex (bug 4421) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@22100 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
cc5246782d
commit
c84f22b5ca
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include "Buffer.h"
|
#include "Buffer.h"
|
||||||
#include "BufferParams.h"
|
#include "BufferParams.h"
|
||||||
#include "debug.h" // temporary
|
#include "debug.h"
|
||||||
|
|
||||||
#include "support/lstrings.h"
|
#include "support/lstrings.h"
|
||||||
|
|
||||||
@ -137,8 +137,16 @@ vector<string> ControlCitation::searchKeys(
|
|||||||
// it is treated as a simple string by boost::regex.
|
// it is treated as a simple string by boost::regex.
|
||||||
expr = escape_special_chars(expr);
|
expr = escape_special_chars(expr);
|
||||||
|
|
||||||
boost::regex reg_exp(to_utf8(expr), case_sensitive?
|
boost::regex reg_exp;
|
||||||
boost::regex_constants::normal : boost::regex_constants::icase);
|
try {
|
||||||
|
reg_exp.assign(to_utf8(expr), case_sensitive ?
|
||||||
|
boost::regex_constants::normal : boost::regex_constants::icase);
|
||||||
|
} catch (boost::regex_error & e) {
|
||||||
|
// boost::regex throws an exception if the regular expression is not
|
||||||
|
// valid.
|
||||||
|
LYXERR(Debug::GUI) << e.what() << std::endl;
|
||||||
|
return vector<string>();
|
||||||
|
}
|
||||||
|
|
||||||
vector<string>::const_iterator it = keys_to_search.begin();
|
vector<string>::const_iterator it = keys_to_search.begin();
|
||||||
vector<string>::const_iterator end = keys_to_search.end();
|
vector<string>::const_iterator end = keys_to_search.end();
|
||||||
@ -157,7 +165,8 @@ vector<string> ControlCitation::searchKeys(
|
|||||||
if (boost::regex_search(data, reg_exp))
|
if (boost::regex_search(data, reg_exp))
|
||||||
foundKeys.push_back(*it);
|
foundKeys.push_back(*it);
|
||||||
}
|
}
|
||||||
catch (boost::regex_error &) {
|
catch (boost::regex_error & e) {
|
||||||
|
LYXERR(Debug::GUI) << e.what() << std::endl;
|
||||||
return vector<string>();
|
return vector<string>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -157,6 +157,8 @@ What's new
|
|||||||
- Fix a crash when inserting a file in a tabular cell via
|
- Fix a crash when inserting a file in a tabular cell via
|
||||||
Insert->File->Plain Text...
|
Insert->File->Plain Text...
|
||||||
|
|
||||||
|
- Fix a crash when using the regex search of the citation dialog (bug 4421).
|
||||||
|
|
||||||
- Correctly adjust screen fonts after the zoom or dpi settings were changed in
|
- Correctly adjust screen fonts after the zoom or dpi settings were changed in
|
||||||
the preferences (Mac and Windows only) (bug 4268).
|
the preferences (Mac and Windows only) (bug 4268).
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user