As bugzilla is down, attached the summary of my hebrew-related changes as a patch.
- Martin On Tue, 2005-08-30 at 18:55, Martin Vermeer wrote: > On Tue, 2005-08-30 at 17:28, Jean-Marc Lasgouttes wrote: > > >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes: > > > > Martin> Heck yes, you're right. These strings are in the po files. > > Martin> Yippee!!! > > > > Could you update the patch accordingly? > > Was already done, see bugzilla. I'll leave the po file work to the > localizers. > > > Martin> (BTW I checked some po files including the French, and the > > Martin> localizers apparently didn't grok it... Hebrew looks wrong > > Martin> too. Are you sure this really works?) > > > > Well, only no.po and de.po are somewhat up to date anyway. > > But, localized LyX in French should show all messed up sectioning header > counters if these strings are really picked up. Have you checked? > > > JMarc > > - Martin
Index: buffer_funcs.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer_funcs.C,v retrieving revision 1.31 diff -u -p -r1.31 buffer_funcs.C --- buffer_funcs.C 9 Jun 2005 09:58:05 -0000 1.31 +++ buffer_funcs.C 30 Aug 2005 16:19:32 -0000 @@ -23,6 +23,7 @@ #include "Floating.h" #include "FloatList.h" #include "gettext.h" +#include "language.h" #include "LaTeX.h" #include "lyxtextclass.h" #include "paragraph.h" @@ -440,7 +441,8 @@ void setCounter(Buffer const & buf, ParI counters.step(enumcounter); - par.params().labelString(counters.enumLabel(enumcounter)); + par.params().labelString(counters.enumLabel(enumcounter, + par.getParLanguage(bufparams)->lang())); } else if (layout->labeltype == LABEL_BIBLIO) {// ale970302 counters.step("bibitem"); int number = counters.value("bibitem"); @@ -522,7 +524,8 @@ string expandLabel(Buffer const & buf, } } - return tclass.counters().counterLabel(fmt); + // Label format may depend on buffer language (hebrew!) + return tclass.counters().counterLabel(fmt, buf.params().language->lang()); } Index: bufferview_funcs.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/bufferview_funcs.C,v retrieving revision 1.155 diff -u -p -r1.155 bufferview_funcs.C --- bufferview_funcs.C 16 Jul 2005 00:04:53 -0000 1.155 +++ bufferview_funcs.C 30 Aug 2005 16:19:32 -0000 @@ -190,7 +190,14 @@ Point coordOffset(DocIterator const & di for (size_t rit = 0; rit != rend; ++rit) y += par.rows()[rit].height(); y += par.rows()[rend].ascent(); - x += dit.bottom().text()->cursorX(dit.bottom(), boundary && dit.depth() == 1); + if (sl.pos() < par.size() + && sl.text()->getFont(par, sl.pos()).isVisibleRightToLeft()) + x += dit.bottom().text()->cursorX(dit.bottom(), + dit.depth() == 1); + else + x += dit.bottom().text()->cursorX(dit.bottom(), + boundary && dit.depth() == 1); + // The following correction should not be there at all. // The cursor looks much better with the -1, though. --x; Index: counters.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/counters.C,v retrieving revision 1.34 diff -u -p -r1.34 counters.C --- counters.C 6 Jan 2005 16:39:22 -0000 1.34 +++ counters.C 30 Aug 2005 16:19:32 -0000 @@ -260,7 +260,8 @@ string const romanCounter(int const n) } // namespace anon -string Counters::labelItem(string const & ctr, string const & numbertype) +string Counters::labelItem(string const & ctr, string const & numbertype, + string const & language) { if (counterList.find(ctr) == counterList.end()) { lyxerr << "Counter " << ctr << " does not exist." << endl; @@ -271,10 +272,16 @@ string Counters::labelItem(string const return string(1, hebrewCounter(value(ctr))); if (numbertype == "alph") - return string(1, loweralphaCounter(value(ctr))); + if (language == "hebrew") + return string(1, hebrewCounter(value(ctr))); + else + return string(1, loweralphaCounter(value(ctr))); if (numbertype == "Alph") - return string(1, alphaCounter(value(ctr))); + if (language == "hebrew") + return string(1, hebrewCounter(value(ctr))); + else + return string(1, alphaCounter(value(ctr))); if (numbertype == "roman") return lowerromanCounter(value(ctr)); @@ -286,7 +293,7 @@ string Counters::labelItem(string const } -string Counters::counterLabel(string const & format) +string Counters::counterLabel(string const & format, string const & language) { string label = format; while (true) { @@ -305,7 +312,7 @@ string Counters::counterLabel(string con break; string const numbertype(label, i + 1, j - i - 1); string const counter(label, j + 1, k - j - 1); - string const rep = labelItem(counter, numbertype); + string const rep = labelItem(counter, numbertype, language); label = string(label, 0, i) + rep + string(label, k + 1, string::npos); //lyxerr << " : " << " (" << counter << "," // << numbertype << ") -> " << label << endl; @@ -315,11 +322,11 @@ string Counters::counterLabel(string con } -string Counters::enumLabel(string const & ctr, string const & langtype) +string Counters::enumLabel(string const & ctr, string const & language) { ostringstream os; - if (langtype == "hebrew") { + if (language == "hebrew") { if (ctr == "enumi") os << '.' << value("enumi"); else if (ctr == "enumii") Index: text.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v retrieving revision 1.624 diff -u -p -r1.624 text.C --- text.C 15 Aug 2005 08:26:53 -0000 1.624 +++ text.C 30 Aug 2005 16:19:35 -0000 @@ -2129,12 +2129,21 @@ int LyXText::cursorX(CursorSlice const & } // see correction above - if (boundary_correction) - if (getFont(par, ppos).isRightToLeft()) + if (boundary_correction) { + if (getFont(par, ppos).isVisibleRightToLeft()) x -= singleWidth(par, ppos); else x += singleWidth(par, ppos); + } + // Make sure inside an inset we always count from the left + // edge (bidi!) -- MV + if (sl.pos() < par.size()) { + font = getFont(par, sl.pos()); + if (!boundary && font.isVisibleRightToLeft() + && par.isInset(sl.pos())) + x -= par.getInset(sl.pos())->width(); + } return int(x); }
signature.asc
Description: This is a digitally signed message part