mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Don't make copies!
This commit is contained in:
parent
47973dc2b4
commit
ce33715d2b
@ -126,7 +126,7 @@ void setAscentFractions(vector<double> & ascent_fractions,
|
|||||||
|
|
||||||
std::function <bool (SnippetPair const &)> FindFirst(string const & comp)
|
std::function <bool (SnippetPair const &)> FindFirst(string const & comp)
|
||||||
{
|
{
|
||||||
return [comp](SnippetPair const & sp) { return sp.first == comp; };
|
return [&comp](SnippetPair const & sp) { return sp.first == comp; };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -321,7 +321,7 @@ namespace {
|
|||||||
std::function<SnippetPair (string const &)> IncrementedFileName
|
std::function<SnippetPair (string const &)> IncrementedFileName
|
||||||
(string const & to_format, string const & filename_base)
|
(string const & to_format, string const & filename_base)
|
||||||
{
|
{
|
||||||
return [to_format, filename_base](string const & snippet)
|
return [&to_format, &filename_base](string const & snippet)
|
||||||
{
|
{
|
||||||
static int counter_ = 1;
|
static int counter_ = 1;
|
||||||
ostringstream os;
|
ostringstream os;
|
||||||
@ -478,7 +478,7 @@ namespace {
|
|||||||
|
|
||||||
std::function<bool (InProgressProcess const &)> FindSnippet(string const & s)
|
std::function<bool (InProgressProcess const &)> FindSnippet(string const & s)
|
||||||
{
|
{
|
||||||
return [s](InProgressProcess const & process) {
|
return [&s](InProgressProcess const & process) {
|
||||||
BitmapFile const & snippets = process.second.snippets;
|
BitmapFile const & snippets = process.second.snippets;
|
||||||
BitmapFile::const_iterator beg = snippets.begin();
|
BitmapFile::const_iterator beg = snippets.begin();
|
||||||
BitmapFile::const_iterator end = snippets.end();
|
BitmapFile::const_iterator end = snippets.end();
|
||||||
@ -531,7 +531,7 @@ void PreviewLoader::Impl::add(string const & latex_snippet)
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
std::function<void (InProgressProcess &)> EraseSnippet(string const & s) {
|
std::function<void (InProgressProcess &)> EraseSnippet(string const & s) {
|
||||||
return [s](InProgressProcess & process) {
|
return [&s](InProgressProcess & process) {
|
||||||
BitmapFile & snippets = process.second.snippets;
|
BitmapFile & snippets = process.second.snippets;
|
||||||
BitmapFile::iterator it = snippets.begin();
|
BitmapFile::iterator it = snippets.begin();
|
||||||
BitmapFile::iterator end = snippets.end();
|
BitmapFile::iterator end = snippets.end();
|
||||||
|
Loading…
Reference in New Issue
Block a user