[PATCH 2/5] src/Format.cpp: use make_pair

2012-10-23 Thread larsbj
From: Lars Gullik Bjønnes lar...@gullik.org

Use make_pair(...) instead of pairT, U(...).
---
 src/Format.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Format.cpp b/src/Format.cpp
index f031b68..71699d6 100644
--- a/src/Format.cpp
+++ b/src/Format.cpp
@@ -476,7 +476,7 @@ bool Formats::isZippedFile(support::FileName const  
filename) const {
return it-second.zipped;
string const  format = getFormatFromFile(filename);
bool zipped = (format == gzip || format == zip);
-   zipped_.insert(pairstring, ZippedInfo(fname, ZippedInfo(zipped, 
timestamp)));
+   zipped_.insert(make_pair(fname, ZippedInfo(zipped, timestamp)));
return zipped;
 }
 
-- 
1.8.0



[PATCH 3/5] src/lyxfind.cpp: cleanup formatting

2012-10-23 Thread larsbj
From: Lars Gullik Bjønnes lar...@gullik.org

Remove some eol space
re-indent where required
make some ?: constructs a bit easier to read.
---
 src/lyxfind.cpp | 177 ++--
 1 file changed, 96 insertions(+), 81 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index b46abc7..dba41d7 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -94,7 +94,7 @@ private:
 
 
 int findForward(DocIterator  cur, MatchString const  match,
-bool find_del = true)
+   bool find_del = true)
 {
for (; cur; cur.forwardChar())
if (cur.inTexted()) {
@@ -107,7 +107,7 @@ int findForward(DocIterator  cur, MatchString const  
match,
 
 
 int findBackwards(DocIterator  cur, MatchString const  match,
-bool find_del = true)
+ bool find_del = true)
 {
while (cur) {
cur.backwardChar();
@@ -149,7 +149,7 @@ bool searchAllowed(docstring const  str)
 
 
 bool findOne(BufferView * bv, docstring const  searchstr,
-   bool case_sens, bool whole, bool forward, bool find_del = true)
+bool case_sens, bool whole, bool forward, bool find_del = true)
 {
if (!searchAllowed(searchstr))
return false;
@@ -158,8 +158,9 @@ bool findOne(BufferView * bv, docstring const  searchstr,
 
MatchString const match(searchstr, case_sens, whole);
 
-   int match_len = forward ? findForward(cur, match, find_del) :
- findBackwards(cur, match, find_del);
+   int match_len = forward
+   ? findForward(cur, match, find_del)
+   : findBackwards(cur, match, find_del);
 
if (match_len  0)
bv-putSelectionAt(cur, match_len, !forward);
@@ -193,11 +194,13 @@ int replaceAll(BufferView * bv,
pos_type const pos = cur.pos();
Font const font = cur.paragraph().getFontSettings(buf.params(), 
pos);
cur.recordUndo();
-   int striked = ssize - cur.paragraph().eraseChars(pos, pos + 
match_len,
-   
buf.params().trackChanges);
+   int striked = ssize -
+   cur.paragraph().eraseChars(pos, pos + match_len,
+  buf.params().trackChanges);
cur.paragraph().insert(pos, replacestr, font,
-  Change(buf.params().trackChanges ?
- Change::INSERTED : 
Change::UNCHANGED));
+  Change(buf.params().trackChanges
+ ? Change::INSERTED
+ : Change::UNCHANGED));
for (int i = 0; i  rsize + striked; ++i)
cur.forwardChar();
++num;
@@ -229,8 +232,8 @@ int replaceAll(BufferView * bv,
 // returns the number of replacements made (one, if any) and 
 // whether anything at all was done.
 pairbool, int replaceOne(BufferView * bv, docstring searchstr,
-   docstring const  replacestr, bool case_sens, 
-   bool whole, bool forward, bool findnext)
+  docstring const  replacestr, bool case_sens,
+  bool whole, bool forward, bool findnext)
 {
Cursor  cur = bv-cursor();
if (!cur.selection()) {
@@ -256,8 +259,9 @@ pairbool, int replaceOne(BufferView * bv, docstring 
searchstr,
bool have_selection = cur.selection();
docstring const selected = cur.selectionAsString(false);
bool match = 
-   case_sens ? searchstr == selected
-   : compare_no_case(searchstr, selected) == 0;
+   case_sens
+   ? searchstr == selected
+   : compare_no_case(searchstr, selected) == 0;
 
// no selection or current selection is not search word:
// just find the search word
@@ -286,7 +290,7 @@ pairbool, int replaceOne(BufferView * bv, docstring 
searchstr,
 
 
 docstring const find2string(docstring const  search,
-bool casesensitive, bool matchword, bool forward)
+   bool casesensitive, bool matchword, bool forward)
 {
odocstringstream ss;
ss  search  '\n'
@@ -298,8 +302,9 @@ docstring const find2string(docstring const  search,
 
 
 docstring const replace2string(docstring const  replace,
-   docstring const  search, bool casesensitive, bool matchword,
-   bool all, bool forward, bool findnext)
+  docstring const  search,
+  bool casesensitive, bool matchword,
+  bool all, bool forward, bool findnext)
 {
odocstringstream ss;
ss  replace  '\n'
@@ -363,7 +368,7 @@ bool lyxreplace(BufferView * bv,
replace_count = 

[PATCH 4/5] src/lyxfinc.cpp: use make_pair

2012-10-23 Thread larsbj
From: Lars Gullik Bjønnes lar...@gullik.org

Use make_pair(...) instead of pairT, U(...).
---
 src/lyxfind.cpp | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index dba41d7..a19724b 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -240,12 +240,12 @@ pairbool, int replaceOne(BufferView * bv, docstring 
searchstr,
// no selection, non-empty search string: find it
if (!searchstr.empty()) {
findOne(bv, searchstr, case_sens, whole, forward);
-   return pairbool, int(true, 0);
+   return make_pair(true, 0);
}
// empty search string
if (!cur.inTexted())
// bail in math
-   return pairbool, int(false, 0);
+   return make_pair(false, 0);
// select current word and treat it as the search string
cur.innerText()-selectWord(cur, WHOLE_WORD);
searchstr = cur.selectionAsString(false);
@@ -254,7 +254,7 @@ pairbool, int replaceOne(BufferView * bv, docstring 
searchstr,
// if we still don't have a search string, report the error
// and abort.
if (!searchAllowed(searchstr))
-   return pairbool, int(false, 0);
+   return make_pair(false, 0);

bool have_selection = cur.selection();
docstring const selected = cur.selectionAsString(false);
@@ -267,13 +267,13 @@ pairbool, int replaceOne(BufferView * bv, docstring 
searchstr,
// just find the search word
if (!have_selection || !match) {
findOne(bv, searchstr, case_sens, whole, forward);
-   return pairbool, int(true, 0);
+   return make_pair(true, 0);
}
 
// we're now actually ready to replace. if the buffer is
// read-only, we can't, though.
if (bv-buffer().isReadonly())
-   return pairbool, int(false, 0);
+   return make_pair(false, 0);
 
cap::replaceSelectionWithString(cur, replacestr);
if (forward) {
@@ -283,7 +283,7 @@ pairbool, int replaceOne(BufferView * bv, docstring 
searchstr,
if (findnext)
findOne(bv, searchstr, case_sens, whole, forward, false);
 
-   return pairbool, int(true, 1);
+   return make_pair(true, 1);
 }
 
 } // namespace anon
-- 
1.8.0



[PATCH 5/5] src/lyxfind.cpp: use local typedef to simplify

2012-10-23 Thread larsbj
From: Lars Gullik Bjønnes lar...@gullik.org

Use a local typedef pairstring, string P to avoid having to repeat
that multiple times.
---
 src/lyxfind.cpp | 72 -
 1 file changed, 40 insertions(+), 32 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index a19724b..33dbd8a 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -495,54 +495,62 @@ typedef vectorpairstring, string  Escapes;
 /// @note Beware of order
 Escapes const  get_regexp_escapes()
 {
+   typedef std::pairstd::string, std::string P;
+
static Escapes escape_map;
if (escape_map.empty()) {
-   escape_map.push_back(pairstring, string($, _x_$));
-   escape_map.push_back(pairstring, string({, _x_{));
-   escape_map.push_back(pairstring, string(}, _x_}));
-   escape_map.push_back(pairstring, string([, _x_[));
-   escape_map.push_back(pairstring, string(], _x_]));
-   escape_map.push_back(pairstring, string((, _x_());
-   escape_map.push_back(pairstring, string(), _x_)));
-   escape_map.push_back(pairstring, string(+, _x_+));
-   escape_map.push_back(pairstring, string(*, _x_*));
-   escape_map.push_back(pairstring, string(., _x_.));
-   escape_map.push_back(pairstring, string(\\, 
(?:|backslash)));
-   escape_map.push_back(pairstring, string(~, 
(?:textasciitilde|sim)));
-   escape_map.push_back(pairstring, string(^, 
(?:\\^|textasciicircum\\{\\}|mathcircumflex)));
-   escape_map.push_back(pairstring, string(_x_, \\));
+   escape_map.push_back(P($, _x_$));
+   escape_map.push_back(P({, _x_{));
+   escape_map.push_back(P(}, _x_}));
+   escape_map.push_back(P([, _x_[));
+   escape_map.push_back(P(], _x_]));
+   escape_map.push_back(P((, _x_());
+   escape_map.push_back(P(), _x_)));
+   escape_map.push_back(P(+, _x_+));
+   escape_map.push_back(P(*, _x_*));
+   escape_map.push_back(P(., _x_.));
+   escape_map.push_back(P(\\, (?:|backslash)));
+   escape_map.push_back(P(~, (?:textasciitilde|sim)));
+   escape_map.push_back(P(^, 
(?:\\^|textasciicircum\\{\\}|mathcircumflex)));
+   escape_map.push_back(P(_x_, \\));
}
return escape_map;
 }
 
 /// A map of lyx escaped strings and their unescaped equivalent.
-Escapes const  get_lyx_unescapes() {
+Escapes const  get_lyx_unescapes()
+{
+   typedef std::pairstd::string, std::string P;
+
static Escapes escape_map;
if (escape_map.empty()) {
-   escape_map.push_back(pairstring, string(\\%, %));
-   escape_map.push_back(pairstring, string(\\mathcircumflex , 
^));
-   escape_map.push_back(pairstring, string(\\mathcircumflex, 
^));
-   escape_map.push_back(pairstring, string(\\backslash , 
\\));
-   escape_map.push_back(pairstring, string(\\backslash, \\));
-   escape_map.push_back(pairstring, string({, _x_));
-   escape_map.push_back(pairstring, string(}, _x_));
-   escape_map.push_back(pairstring, string(\\sim , ~));
-   escape_map.push_back(pairstring, string(\\sim, ~));
+   escape_map.push_back(P(\\%, %));
+   escape_map.push_back(P(\\mathcircumflex , ^));
+   escape_map.push_back(P(\\mathcircumflex, ^));
+   escape_map.push_back(P(\\backslash , \\));
+   escape_map.push_back(P(\\backslash, \\));
+   escape_map.push_back(P({, _x_));
+   escape_map.push_back(P(}, _x_));
+   escape_map.push_back(P(\\sim , ~));
+   escape_map.push_back(P(\\sim, ~));
}
return escape_map;
 }
 
 /// A map of escapes turning a regexp matching text to one matching latex.
-Escapes const  get_regexp_latex_escapes() {
+Escapes const  get_regexp_latex_escapes()
+{
+   typedef std::pairstd::string, std::string P;
+
static Escapes escape_map;
if (escape_map.empty()) {
-   escape_map.push_back(pairstring, string(, 
(?:|backslash|textbackslash\\{\\})));
-   escape_map.push_back(pairstring, 
string((?!textbackslash)\\{, \\{));
-   escape_map.push_back(pairstring, 
string((?!textbackslash\\{)\\}, \\}));
-   escape_map.push_back(pairstring, string(\\[, \\{\\[\\}));
-   escape_map.push_back(pairstring, string(\\], \\{\\]\\}));
-   escape_map.push_back(pairstring, string(\\^, 
(?:\\^|textasciicircum\\{\\}|mathcircumflex)));
-   escape_map.push_back(pairstring, string(%, \\%));
+   escape_map.push_back(P(, 

[PATCH 1/5] tests/boost.cpp: remove using namespace std

2012-10-23 Thread larsbj
From: Lars Gullik Bjønnes lar...@gullik.org

Trivial to remove the namespace injection.
---
 src/frontends/tests/boost.cpp | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/frontends/tests/boost.cpp b/src/frontends/tests/boost.cpp
index 09d701d..6151f1f 100644
--- a/src/frontends/tests/boost.cpp
+++ b/src/frontends/tests/boost.cpp
@@ -14,14 +14,12 @@
 #include iostream
 #include boost/assert.hpp
 
-using namespace std;
-
 namespace boost {
 
 #ifndef BOOST_NO_EXCEPTIONS
-void throw_exception(exception const  /*e*/)
+void throw_exception(std::exception const )
 {
-   cerrASSERTION VIOLATED IN biblio test;
+   std::cerr  ASSERTION VIOLATED IN biblio test;
BOOST_ASSERT(false);
 }
 #endif
-- 
1.8.0



[PATCH 2/5] src/Format.cpp: use make_pair

2012-10-23 Thread larsbj
From: Lars Gullik Bjønnes 

Use make_pair(...) instead of pair(...).
---
 src/Format.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Format.cpp b/src/Format.cpp
index f031b68..71699d6 100644
--- a/src/Format.cpp
+++ b/src/Format.cpp
@@ -476,7 +476,7 @@ bool Formats::isZippedFile(support::FileName const & 
filename) const {
return it->second.zipped;
string const & format = getFormatFromFile(filename);
bool zipped = (format == "gzip" || format == "zip");
-   zipped_.insert(pair(fname, ZippedInfo(zipped, 
timestamp)));
+   zipped_.insert(make_pair(fname, ZippedInfo(zipped, timestamp)));
return zipped;
 }
 
-- 
1.8.0



[PATCH 3/5] src/lyxfind.cpp: cleanup formatting

2012-10-23 Thread larsbj
From: Lars Gullik Bjønnes 

Remove some eol space
re-indent where required
make some ?: constructs a bit easier to read.
---
 src/lyxfind.cpp | 177 ++--
 1 file changed, 96 insertions(+), 81 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index b46abc7..dba41d7 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -94,7 +94,7 @@ private:
 
 
 int findForward(DocIterator & cur, MatchString const & match,
-bool find_del = true)
+   bool find_del = true)
 {
for (; cur; cur.forwardChar())
if (cur.inTexted()) {
@@ -107,7 +107,7 @@ int findForward(DocIterator & cur, MatchString const & 
match,
 
 
 int findBackwards(DocIterator & cur, MatchString const & match,
-bool find_del = true)
+ bool find_del = true)
 {
while (cur) {
cur.backwardChar();
@@ -149,7 +149,7 @@ bool searchAllowed(docstring const & str)
 
 
 bool findOne(BufferView * bv, docstring const & searchstr,
-   bool case_sens, bool whole, bool forward, bool find_del = true)
+bool case_sens, bool whole, bool forward, bool find_del = true)
 {
if (!searchAllowed(searchstr))
return false;
@@ -158,8 +158,9 @@ bool findOne(BufferView * bv, docstring const & searchstr,
 
MatchString const match(searchstr, case_sens, whole);
 
-   int match_len = forward ? findForward(cur, match, find_del) :
- findBackwards(cur, match, find_del);
+   int match_len = forward
+   ? findForward(cur, match, find_del)
+   : findBackwards(cur, match, find_del);
 
if (match_len > 0)
bv->putSelectionAt(cur, match_len, !forward);
@@ -193,11 +194,13 @@ int replaceAll(BufferView * bv,
pos_type const pos = cur.pos();
Font const font = cur.paragraph().getFontSettings(buf.params(), 
pos);
cur.recordUndo();
-   int striked = ssize - cur.paragraph().eraseChars(pos, pos + 
match_len,
-   
buf.params().trackChanges);
+   int striked = ssize -
+   cur.paragraph().eraseChars(pos, pos + match_len,
+  buf.params().trackChanges);
cur.paragraph().insert(pos, replacestr, font,
-  Change(buf.params().trackChanges ?
- Change::INSERTED : 
Change::UNCHANGED));
+  Change(buf.params().trackChanges
+ ? Change::INSERTED
+ : Change::UNCHANGED));
for (int i = 0; i < rsize + striked; ++i)
cur.forwardChar();
++num;
@@ -229,8 +232,8 @@ int replaceAll(BufferView * bv,
 // returns the number of replacements made (one, if any) and 
 // whether anything at all was done.
 pair replaceOne(BufferView * bv, docstring searchstr,
-   docstring const & replacestr, bool case_sens, 
-   bool whole, bool forward, bool findnext)
+  docstring const & replacestr, bool case_sens,
+  bool whole, bool forward, bool findnext)
 {
Cursor & cur = bv->cursor();
if (!cur.selection()) {
@@ -256,8 +259,9 @@ pair replaceOne(BufferView * bv, docstring 
searchstr,
bool have_selection = cur.selection();
docstring const selected = cur.selectionAsString(false);
bool match = 
-   case_sens ? searchstr == selected
-   : compare_no_case(searchstr, selected) == 0;
+   case_sens
+   ? searchstr == selected
+   : compare_no_case(searchstr, selected) == 0;
 
// no selection or current selection is not search word:
// just find the search word
@@ -286,7 +290,7 @@ pair replaceOne(BufferView * bv, docstring 
searchstr,
 
 
 docstring const find2string(docstring const & search,
-bool casesensitive, bool matchword, bool forward)
+   bool casesensitive, bool matchword, bool forward)
 {
odocstringstream ss;
ss << search << '\n'
@@ -298,8 +302,9 @@ docstring const find2string(docstring const & search,
 
 
 docstring const replace2string(docstring const & replace,
-   docstring const & search, bool casesensitive, bool matchword,
-   bool all, bool forward, bool findnext)
+  docstring const & search,
+  bool casesensitive, bool matchword,
+  bool all, bool forward, bool findnext)
 {
odocstringstream ss;
ss << replace << '\n'
@@ -363,7 +368,7 @@ bool lyxreplace(BufferView * bv,
 

[PATCH 4/5] src/lyxfinc.cpp: use make_pair

2012-10-23 Thread larsbj
From: Lars Gullik Bjønnes 

Use make_pair(...) instead of pair(...).
---
 src/lyxfind.cpp | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index dba41d7..a19724b 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -240,12 +240,12 @@ pair replaceOne(BufferView * bv, docstring 
searchstr,
// no selection, non-empty search string: find it
if (!searchstr.empty()) {
findOne(bv, searchstr, case_sens, whole, forward);
-   return pair(true, 0);
+   return make_pair(true, 0);
}
// empty search string
if (!cur.inTexted())
// bail in math
-   return pair(false, 0);
+   return make_pair(false, 0);
// select current word and treat it as the search string
cur.innerText()->selectWord(cur, WHOLE_WORD);
searchstr = cur.selectionAsString(false);
@@ -254,7 +254,7 @@ pair replaceOne(BufferView * bv, docstring 
searchstr,
// if we still don't have a search string, report the error
// and abort.
if (!searchAllowed(searchstr))
-   return pair(false, 0);
+   return make_pair(false, 0);

bool have_selection = cur.selection();
docstring const selected = cur.selectionAsString(false);
@@ -267,13 +267,13 @@ pair replaceOne(BufferView * bv, docstring 
searchstr,
// just find the search word
if (!have_selection || !match) {
findOne(bv, searchstr, case_sens, whole, forward);
-   return pair(true, 0);
+   return make_pair(true, 0);
}
 
// we're now actually ready to replace. if the buffer is
// read-only, we can't, though.
if (bv->buffer().isReadonly())
-   return pair(false, 0);
+   return make_pair(false, 0);
 
cap::replaceSelectionWithString(cur, replacestr);
if (forward) {
@@ -283,7 +283,7 @@ pair replaceOne(BufferView * bv, docstring 
searchstr,
if (findnext)
findOne(bv, searchstr, case_sens, whole, forward, false);
 
-   return pair(true, 1);
+   return make_pair(true, 1);
 }
 
 } // namespace anon
-- 
1.8.0



[PATCH 5/5] src/lyxfind.cpp: use local typedef to simplify

2012-10-23 Thread larsbj
From: Lars Gullik Bjønnes 

Use a local typedef pair P to avoid having to repeat
that multiple times.
---
 src/lyxfind.cpp | 72 -
 1 file changed, 40 insertions(+), 32 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index a19724b..33dbd8a 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -495,54 +495,62 @@ typedef vector > Escapes;
 /// @note Beware of order
 Escapes const & get_regexp_escapes()
 {
+   typedef std::pair P;
+
static Escapes escape_map;
if (escape_map.empty()) {
-   escape_map.push_back(pair("$", "_x_$"));
-   escape_map.push_back(pair("{", "_x_{"));
-   escape_map.push_back(pair("}", "_x_}"));
-   escape_map.push_back(pair("[", "_x_["));
-   escape_map.push_back(pair("]", "_x_]"));
-   escape_map.push_back(pair("(", "_x_("));
-   escape_map.push_back(pair(")", "_x_)"));
-   escape_map.push_back(pair("+", "_x_+"));
-   escape_map.push_back(pair("*", "_x_*"));
-   escape_map.push_back(pair(".", "_x_."));
-   escape_map.push_back(pair("\\", 
"(?:|backslash)"));
-   escape_map.push_back(pair("~", 
"(?:textasciitilde|sim)"));
-   escape_map.push_back(pair("^", 
"(?:\\^|textasciicircum\\{\\}|mathcircumflex)"));
-   escape_map.push_back(pair("_x_", "\\"));
+   escape_map.push_back(P("$", "_x_$"));
+   escape_map.push_back(P("{", "_x_{"));
+   escape_map.push_back(P("}", "_x_}"));
+   escape_map.push_back(P("[", "_x_["));
+   escape_map.push_back(P("]", "_x_]"));
+   escape_map.push_back(P("(", "_x_("));
+   escape_map.push_back(P(")", "_x_)"));
+   escape_map.push_back(P("+", "_x_+"));
+   escape_map.push_back(P("*", "_x_*"));
+   escape_map.push_back(P(".", "_x_."));
+   escape_map.push_back(P("\\", "(?:|backslash)"));
+   escape_map.push_back(P("~", "(?:textasciitilde|sim)"));
+   escape_map.push_back(P("^", 
"(?:\\^|textasciicircum\\{\\}|mathcircumflex)"));
+   escape_map.push_back(P("_x_", "\\"));
}
return escape_map;
 }
 
 /// A map of lyx escaped strings and their unescaped equivalent.
-Escapes const & get_lyx_unescapes() {
+Escapes const & get_lyx_unescapes()
+{
+   typedef std::pair P;
+
static Escapes escape_map;
if (escape_map.empty()) {
-   escape_map.push_back(pair("\\%", "%"));
-   escape_map.push_back(pair("\\mathcircumflex ", 
"^"));
-   escape_map.push_back(pair("\\mathcircumflex", 
"^"));
-   escape_map.push_back(pair("\\backslash ", 
"\\"));
-   escape_map.push_back(pair("\\backslash", "\\"));
-   escape_map.push_back(pair("{", "_x_<"));
-   escape_map.push_back(pair("}", "_x_>"));
-   escape_map.push_back(pair("\\sim ", "~"));
-   escape_map.push_back(pair("\\sim", "~"));
+   escape_map.push_back(P("\\%", "%"));
+   escape_map.push_back(P("\\mathcircumflex ", "^"));
+   escape_map.push_back(P("\\mathcircumflex", "^"));
+   escape_map.push_back(P("\\backslash ", "\\"));
+   escape_map.push_back(P("\\backslash", "\\"));
+   escape_map.push_back(P("{", "_x_<"));
+   escape_map.push_back(P("}", "_x_>"));
+   escape_map.push_back(P("\\sim ", "~"));
+   escape_map.push_back(P("\\sim", "~"));
}
return escape_map;
 }
 
 /// A map of escapes turning a regexp matching text to one matching latex.
-Escapes const & get_regexp_latex_escapes() {
+Escapes const & get_regexp_latex_escapes()
+{
+   typedef std::pair P;
+
static Escapes escape_map;
if (escape_map.empty()) {
-   escape_map.push_back(pair("", 
"(?:|backslash|textbackslash\\{\\})"));
-   escape_map.push_back(pair("(("(("\\[", "\\{\\[\\}"));
-   escape_map.push_back(pair("\\]", "\\{\\]\\}"));
-   escape_map.push_back(pair("\\^", 
"(?:\\^|textasciicircum\\{\\}|mathcircumflex)"));
-   escape_map.push_back(pair

[PATCH 1/5] tests/boost.cpp: remove using namespace std

2012-10-23 Thread larsbj
From: Lars Gullik Bjønnes 

Trivial to remove the namespace injection.
---
 src/frontends/tests/boost.cpp | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/frontends/tests/boost.cpp b/src/frontends/tests/boost.cpp
index 09d701d..6151f1f 100644
--- a/src/frontends/tests/boost.cpp
+++ b/src/frontends/tests/boost.cpp
@@ -14,14 +14,12 @@
 #include 
 #include 
 
-using namespace std;
-
 namespace boost {
 
 #ifndef BOOST_NO_EXCEPTIONS
-void throw_exception(exception const & /*e*/)
+void throw_exception(std::exception const &)
 {
-   cerr<<"ASSERTION VIOLATED IN biblio test";
+   std::cerr << "ASSERTION VIOLATED IN biblio test";
BOOST_ASSERT(false);
 }
 #endif
-- 
1.8.0



Re: feature request for 1.2.1 or 1.3.0 or 1.3.1 or ...

2002-05-21 Thread larsbj

References: [EMAIL PROTECTED]
From: [EMAIL PROTECTED] (Lars Gullik =?iso-8859-1?q?Bj=F8nnes?=)
Organization: LyX Developer http://www.lyx.org/
Date: Wed, 22 May 2002 08:09:55 +0200
In-Reply-To: [EMAIL PROTECTED]
Message-ID: [EMAIL PROTECTED]
Lines: 16
User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.1 (i686-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

R. Lahaye [EMAIL PROTECTED] writes:

| Rod Pinna writes:

 Just wondering in a reread button could be added in the next version, in
 the graphics insert box. Currently, if I update a picture externally,
 there isn't a way to update the picture without closing lyx.

| What about a watch file in the graphics dialog, or even such a selection
| button in the preferences for all graphics (same as the ghostview option).

Why?
This is how we should behave by default.

-- 
Lgb



Re: feature request for 1.2.1 or 1.3.0 or 1.3.1 or ...

2002-05-21 Thread larsbj

References: <[EMAIL PROTECTED]>
From: [EMAIL PROTECTED] (Lars Gullik =?iso-8859-1?q?Bj=F8nnes?=)
Organization: LyX Developer http://www.lyx.org/
Date: Wed, 22 May 2002 08:09:55 +0200
In-Reply-To: <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Lines: 16
User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.1 (i686-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

"R. Lahaye" <[EMAIL PROTECTED]> writes:

| Rod Pinna writes:
>>
>> Just wondering in a "reread" button could be added in the next version, in
>> the graphics insert box. Currently, if I update a picture externally,
>> there isn't a way to update the picture without closing lyx.
>
| What about a "watch file" in the graphics dialog, or even such a selection
| button in the preferences for all graphics (same as the ghostview option).

Why?
This is how we should behave by default.

-- 
Lgb