From 9359baacf89c4586751e60e45d711eaa3a2c9335 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 7 Sep 2001 15:41:36 +0000 Subject: [PATCH] bug fixes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2707 a592a061-630c-0410-9148-cb99ea01b6c8 --- boost/ChangeLog | 4 +++ boost/boost/crc.hpp | 9 ++++++ lib/ChangeLog | 8 +++++ lib/layouts/dinbrief.layout | 3 -- lib/layouts/egs.layout | 18 +++++------ lib/layouts/iletter.layout | 6 ++-- lib/layouts/stdletter.inc | 6 ++-- src/ChangeLog | 8 +++++ src/frontends/xforms/ChangeLog | 6 ++++ src/frontends/xforms/Toolbar_pimpl.C | 46 ++++++++++++++++++---------- src/insets/ChangeLog | 5 +++ src/insets/insetquotes.C | 2 +- src/lyxfont.h | 1 - src/paragraph.C | 2 +- src/text.C | 7 +++-- 15 files changed, 91 insertions(+), 40 deletions(-) diff --git a/boost/ChangeLog b/boost/ChangeLog index 88c05a6ad7..ab5d913d0a 100644 --- a/boost/ChangeLog +++ b/boost/ChangeLog @@ -1,3 +1,7 @@ +2001-09-07 Jean-Marc Lasgouttes + + * boost/crc.hpp (detail): re-apply the cxx patch from 2001-06-07. + 2001-07-07 Lars Gullik Bjønnes * boost/config.hpp: update diff --git a/boost/boost/crc.hpp b/boost/boost/crc.hpp index 4658ae4abe..d7bff778f8 100644 --- a/boost/boost/crc.hpp +++ b/boost/boost/crc.hpp @@ -280,10 +280,15 @@ namespace detail typedef typename base_type::least least; typedef typename base_type::fast fast; +#ifdef __DECCXX + static const least high_bit = 1ul << (Bits - 1u); + static const fast high_bit_fast = 1ul << (Bits - 1u); +#else BOOST_STATIC_CONSTANT( least, high_bit = (least( 1u ) << ( Bits - 1u )) ); BOOST_STATIC_CONSTANT( fast, high_bit_fast = (fast( 1u ) << ( Bits - 1u )) ); +#endif }; // boost::detail::high_uint_t @@ -340,7 +345,11 @@ namespace detail BOOST_STATIC_CONSTANT( fast, high_bit_fast = base_type::high_bit_fast ); #endif +#ifdef __DECCXX + static const least sig_bits = (~( ~(0ul) << Bits)); +#else BOOST_STATIC_CONSTANT( least, sig_bits = (~( ~(least( 0u )) << Bits )) ); +#endif BOOST_STATIC_CONSTANT( fast, sig_bits_fast = fast(sig_bits) ); }; // boost::detail::mask_uint_t diff --git a/lib/ChangeLog b/lib/ChangeLog index a4dcb4cfa5..bb088258a4 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,11 @@ +2001-09-07 Jean-Marc Lasgouttes + + * layouts/dinbrief.layout: + * layouts/egs.layout: + * layouts/iletter.layout: + * layouts/stdletter.inc: remove bogus use of the now defunct Latex + tag + 2001-09-06 Jean-Marc Lasgouttes * examples/da_splash.lyx: new translation from Claus Hindsgaul diff --git a/lib/layouts/dinbrief.layout b/lib/layouts/dinbrief.layout index 21e857aa86..614cdf0b45 100644 --- a/lib/layouts/dinbrief.layout +++ b/lib/layouts/dinbrief.layout @@ -54,7 +54,6 @@ Style Opening Shape Italic Size Small Color blue - Latex no_latex EndFont End @@ -68,7 +67,6 @@ Style Signature Shape Italic Size Small Color blue - Latex no_latex EndFont End @@ -82,7 +80,6 @@ Style Closing Shape Italic Size Small Color blue - Latex no_latex EndFont End diff --git a/lib/layouts/egs.layout b/lib/layouts/egs.layout index deb6afa01e..2fe7efb1f0 100644 --- a/lib/layouts/egs.layout +++ b/lib/layouts/egs.layout @@ -353,7 +353,7 @@ Style Author LabelFont Series Bold Shape Italic - Latex Latex + Color red EndFont End @@ -379,7 +379,7 @@ Style Affil LabelFont Series Bold Shape Italic - Latex Latex + Color red EndFont End @@ -405,7 +405,7 @@ Style Journal LabelFont Series Bold Shape Italic - Latex Latex + Color red EndFont End @@ -432,7 +432,7 @@ Style msnumber LabelFont Series Bold Shape Italic - Latex Latex + Color red EndFont End @@ -459,7 +459,7 @@ Style FirstAuthor LabelFont Series Bold Shape Italic - Latex Latex + Color red EndFont End @@ -485,7 +485,7 @@ Style Received LabelFont Series Bold Shape Italic - Latex Latex + Color red EndFont End @@ -511,7 +511,7 @@ Style Accepted LabelFont Series Bold Shape Italic - Latex Latex + Color red EndFont End @@ -539,7 +539,7 @@ Style Offsets LabelFont Series Bold Shape Italic - Latex Latex + Color red EndFont End @@ -738,7 +738,7 @@ Style LaTeX # standard font definition Font - Latex Latex + Color red EndFont End diff --git a/lib/layouts/iletter.layout b/lib/layouts/iletter.layout index 6941546428..d6d4968280 100644 --- a/lib/layouts/iletter.layout +++ b/lib/layouts/iletter.layout @@ -62,7 +62,7 @@ Style Oggetto LabelFont Series Bold Shape Italic - Latex Latex + Color red EndFont End @@ -84,7 +84,7 @@ Style Citta LabelFont Series Bold Shape Italic - Latex Latex + Color red EndFont End @@ -106,6 +106,6 @@ Style Data LabelFont Series Bold Shape Italic - Latex Latex + Color red EndFont End diff --git a/lib/layouts/stdletter.inc b/lib/layouts/stdletter.inc index 9f60e64dc7..9bb39cf399 100644 --- a/lib/layouts/stdletter.inc +++ b/lib/layouts/stdletter.inc @@ -75,7 +75,7 @@ Style Opening LabelFont Series Bold Shape Italic - Latex Latex + Color red EndFont End @@ -98,7 +98,7 @@ Style Signature LabelFont Series Bold Shape Italic - Latex Latex + Color red EndFont End @@ -121,7 +121,7 @@ Style Closing LabelFont Series Bold Shape Italic - Latex Latex + Color red EndFont End diff --git a/src/ChangeLog b/src/ChangeLog index 0764dcce31..c9e4b7bc9e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2001-09-07 Jean-Marc Lasgouttes + + * lyxfont.h (isSymbolFont): shut off warning + + * text.C (setHeightOfRow): + (getVisibleRow): fix crash with empty paragraphs which have a + bottom line + 2001-09-07 Rob Lahaye * lyxrc.[Ch]: added dialogs_iconify_with_main variable and associated diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index e18b1b832c..64dd008728 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,9 @@ +2001-09-07 Jean-Marc Lasgouttes + + * Toolbar_pimpl.C (setLayout): + (layoutSelected): make them work even when gettext has been + translating the interface. + 2001-09-07 Angus Leeming * FormPreferences.C (build): Fix bug: if you start LyX and open the diff --git a/src/frontends/xforms/Toolbar_pimpl.C b/src/frontends/xforms/Toolbar_pimpl.C index 11896ca641..48bad4b157 100644 --- a/src/frontends/xforms/Toolbar_pimpl.C +++ b/src/frontends/xforms/Toolbar_pimpl.C @@ -145,21 +145,6 @@ extern "C" int C_Toolbar_BubblePost(FL_OBJECT * ob, int event, } // namespace anon -// this one is not "C" because combox callbacks are really C++ %-| -void Toolbar::Pimpl::layoutSelectedCB(int, void * arg, Combox *) -{ - Toolbar::Pimpl * tb = reinterpret_cast(arg); - - tb->layoutSelected(); -} - - -void Toolbar::Pimpl::layoutSelected() -{ - owner->getLyXFunc()->dispatch(LFUN_LAYOUT, combox->getline()); -} - - void Toolbar::Pimpl::activate() { ToolbarList::const_iterator p = toollist.begin(); @@ -216,12 +201,41 @@ void Toolbar::Pimpl::update() } +// this one is not "C" because combox callbacks are really C++ %-| +void Toolbar::Pimpl::layoutSelectedCB(int, void * arg, Combox *) +{ + Toolbar::Pimpl * tb = reinterpret_cast(arg); + + tb->layoutSelected(); +} + + +void Toolbar::Pimpl::layoutSelected() +{ + string const & layoutguiname = combox->getline(); + LyXTextClass const & tc = + textclasslist.TextClass(owner->buffer()-> + params.textclass); + + LyXTextClass::const_iterator end = tc.end(); + for (LyXTextClass::const_iterator cit = tc.begin(); + cit != end; ++cit) { + if (_(cit->name()) == layoutguiname) { + owner->getLyXFunc()->dispatch(LFUN_LAYOUT, cit->name()); + return; + } + } + lyxerr << "ERROR (Toolbar::Pimpl::layoutSelected): layout not found!" + << endl; +} + + void Toolbar::Pimpl::setLayout(int layout) { if (combox) { LyXTextClass const & tc = textclasslist.TextClass(owner->buffer()-> params.textclass); - combox->select(tc[layout].name()); + combox->select(_(tc[layout].name())); } } diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index a3499d693d..a94fe63421 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2001-09-07 Jean-Marc Lasgouttes + + * insetquotes.C (InsetQuotes): when trying to decide the side of + the quote, choose `left' only after a space or '(' + 2001-09-04 José Matos * figinset.C * figinset.h diff --git a/src/insets/insetquotes.C b/src/insets/insetquotes.C index 0ad0d96b20..e4937eff2e 100644 --- a/src/insets/insetquotes.C +++ b/src/insets/insetquotes.C @@ -85,7 +85,7 @@ InsetQuotes::InsetQuotes(char c, BufferParams const & params) { // Decide whether left or right switch (c) { - case ' ': case '(': case '{': case '[': case '-': case ':': + case ' ': case '(': case Paragraph::META_HFILL: case Paragraph::META_NEWLINE: side_ = LeftQ; // left quote diff --git a/src/lyxfont.h b/src/lyxfont.h index 4bd9ad0e95..601a430ce4 100644 --- a/src/lyxfont.h +++ b/src/lyxfont.h @@ -434,7 +434,6 @@ bool LyXFont::isSymbolFont() const default: return false; } - return false; } /// diff --git a/src/paragraph.C b/src/paragraph.C index 6823dbadf6..6aabdd620b 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -537,7 +537,7 @@ Inset * Paragraph::getInset(Paragraph::size_type pos) if (it != insetlist.end() && it->pos == pos) return it->inset; - lyxerr << "ERROR (Paragraph::GetInset): " + lyxerr << "ERROR (Paragraph::getInset): " "Inset does not exist: " << pos << endl; //::raise(SIGSTOP); diff --git a/src/text.C b/src/text.C index feac08041d..3e8400867a 100644 --- a/src/text.C +++ b/src/text.C @@ -1429,7 +1429,8 @@ void LyXText::setHeightOfRow(BufferView * bview, Row * row_ptr) const if (firstpar->params().lineBottom()) maxdesc += 2 * lyxfont::ascent('x', getFont(bview->buffer(), - par, par->size() - 1)); + par, + max(Paragraph::size_type(0), par->size() - 1))); // and now the pagebreaks if (firstpar->params().pagebreakBottom()) @@ -3423,7 +3424,7 @@ void LyXText::getVisibleRow(BufferView * bview, int y_offset, int x_offset, y_bottom -= lyxfont::ascent('x', getFont(bview->buffer(), par, - par->size() - 1)); + max(Paragraph::size_type(0), par->size() - 1))); int const w = (inset_owner ? inset_owner->width(bview, font) : ww); int const xp = static_cast(inset_owner ? x : 0); @@ -3434,7 +3435,7 @@ void LyXText::getVisibleRow(BufferView * bview, int y_offset, int x_offset, y_bottom -= lyxfont::ascent('x', getFont(bview->buffer(), par, - par->size() - 1)); + max(Paragraph::size_type(0), par->size() - 1))); } // draw an endlabel -- 2.39.2