Abdelrazak Younes wrote:
Here is the patch. I think it is easy to understand.
So objection?
Err.., there are at least two changes that I have committed in the past
few weeks (totally unrelated to MVC) which this patch is undoing:
Index: Font.cpp
===================================================================
--- Font.cpp (revision 19485)
+++ Font.cpp (working copy)
@@ -32,7 +32,6 @@
using std::endl;
using std::string;
using std::ostream;
-using std::pair;
#ifndef CXX_GLOBAL_CSTD
using std::strlen;
@@ -786,12 +785,12 @@
}
if (language()->encoding()->package() == Encoding::CJK) {
- pair<bool, int> const c = switchEncoding(os, bparams,
+ int const c = switchEncoding(os, bparams,
runparams.moving_arg, *(runparams.encoding),
*(language()->encoding()));
- if (c.first) {
+ if (c > 0) {
open_encoding_ = true;
- count += c.second;
+ count += c;
runparams.encoding = language()->encoding();
}
}
@@ -947,11 +946,11 @@
// We need to close the encoding even if it does not change
// to do correct environment nesting
Encoding const * const ascii =
encodings.getFromLyXName("ascii");
- pair<bool, int> const c = switchEncoding(os, bparams,
+ int const c = switchEncoding(os, bparams,
runparams.moving_arg, *(runparams.encoding),
*ascii);
- BOOST_ASSERT(c.first);
- count += c.second;
+ BOOST_ASSERT(c > 0);
+ count += c;
runparams.encoding = ascii;
open_encoding_ = false;
}
and related stuff in a few other files (r18994)
and:
Index: Paragraph.cpp
===================================================================
--- Paragraph.cpp (revision 19485)
+++ Paragraph.cpp (working copy)
@@ -1284,19 +1284,7 @@
Font const & font, Change const & change)
{
pimpl_->insertInset(pos, inset, change);
- // Set the font/language of the inset...
setFont(pos, font);
- // ... as well as the font/language of the text inside the inset
- // FIXME: This is far from perfect. It basically overrides work being
done
- // in the InsetText constructor. Also, it doesn't work for Tables
- // (precisely because each cell's font/language is set in the Table's
- // constructor, so by now it's too late). The long-term solution should
- // be moving current_font into Cursor, and getting rid of all this...
- // (see
http://thread.gmane.org/gmane.editors.lyx.devel/88869/focus=88944)
- if (inset->asTextInset()) {
- inset->asTextInset()->text_.current_font = font;
- inset->asTextInset()->text_.real_current_font = font;
- }
}
@@ -2090,11 +2078,11 @@
// Switch file encoding if necessary
if (runparams.encoding->package() == Encoding::inputenc &&
font.language()->encoding()->package() ==
Encoding::inputenc) {
- std::pair<bool, int> const enc_switch =
switchEncoding(os, bparams,
+ int const count = switchEncoding(os, bparams,
runparams.moving_arg,
*(runparams.encoding),
*(font.language()->encoding()));
- if (enc_switch.first) {
- column += enc_switch.second;
+ if (count > 0) {
+ column += count;
runparams.encoding =
font.language()->encoding();
}
}
This is part of r18993; and again, parts r18994.