Dov Feldstern wrote:

> Right, thanks. So here's the question: Do we assume that the count can
> only be greater than 0 if there was an encoding switch, or is even that
> assuming too much?

That is not assuming too much IMO. Why should swicthEncoding output anything
if it did not change the encoding?

> Should the code read: 
> 
> if (... && enc_switch.first) {
> runparams.encoding = encoding;
> if (enc_switch.second > 0) {
> newline stuff...
> }
> }
> 
> or
> 
> if (... && enc_switch.first)
> runparams.encoding = encoding;
> if (... && enc_switch.second > 0) {
> newline stuff...
> }

I don't really care, choose what you like (or what is shorter).

> ? Also, is the first part of the condition (encoding->package() ==
> Encoding::inputenc) necessary/correct for the encoding switch?

Yes, although it could also be encoding->package() != Encoding::CJK. These
two tests are equivalent, because switches from/to Encoding::none need to
be ignored anyway. The important thing is that Encoding::CJK is handled in
Font.cpp only.

>>> Index: lyx-devel/src/output_latex.h
>>> ===================================================================
>>> --- lyx-devel.orig/src/output_latex.h        2007-07-01
>>> 20:28:13.000000000
>> +0300
>>> +++ lyx-devel/src/output_latex.h        2007-07-01 20:30:52.000000000
>> +0300
>>> @@ -17,6 +17,8 @@
>>>  
>>>  namespace lyx {
>>>  
>>> +using std::pair;
>> 
>> 'using' is forbiden in header files.
> 
> Is any kind of include necessary for using pair, or do I just use it,
> and the using in the .cpp file is enough?

std::pair is declared in <utility>. If that header does not get pulled in by
other headers used in output_latex.h you have to include it in
output_latex.h.

Note that you do not need any 'using' diective, you can as well use the
fully qualified name std::pair.


Georg

Reply via email to