From 731478c86ef0155067ba4ffa8c55259384bdb8a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Mon, 30 Oct 2000 08:14:36 +0000 Subject: [PATCH] Various fixes (PageDown/Up, reading kmap, drawing tabular lines). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1171 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 13 +++++++++++++ src/BufferView_pimpl.C | 6 +++--- src/LyXView.h | 1 + src/insets/insettabular.C | 1 + src/insets/insettext.C | 17 ++++++++++++++++- src/trans.C | 8 +++++++- 6 files changed, 41 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 599ed95e08..70a354688d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2000-10-28 Juergen Vigna + + * src/insets/insettabular.C (draw): fixed drawing bug. + + * src/insets/insettext.C (clear): + (Read): + (SetParagraphData): clearing the TEXT buffers when deleting the + paragraphs used by it. + + * src/BufferView_pimpl.C (cursorNext): fixed PageDown problem. + + * src/trans.C (AddDeadkey): fixed bug in inizializing keymap array. + 2000-10-27 Juergen Vigna * src/tabular.C (~LyXTabular): removed not needed anymore. diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 8469d5a227..a896c75edf 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -1167,13 +1167,13 @@ void BufferView::Pimpl::cursorNext(LyXText * text) if (!text->cursor.row()->next()) return; - int y = text->first; + int y = text->first + workarea_->height(); // if (text->inset_owner) // y += bv_->text->first; text->GetRowNearY(y); + Row * cursorrow = text->cursor.row(); - text->SetCursorFromCoordinates(bv_, text->cursor.x_fix(), y - + workarea_->height()); + text->SetCursorFromCoordinates(bv_, text->cursor.x_fix(), y); // + workarea_->height()); bv_->text->FinishUndo(); // This is to allow jumping over large insets if ((cursorrow == bv_->text->cursor.row())) diff --git a/src/LyXView.h b/src/LyXView.h index 87ad3703e1..5ce2b4efff 100644 --- a/src/LyXView.h +++ b/src/LyXView.h @@ -16,6 +16,7 @@ #pragma interface #endif +#include #include FORMS_H_LOCATION #include "LString.h" diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index 82eec2b119..e328e51b51 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -290,6 +290,7 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline, tabular->GetAdditionalHeight(cell); } } + i = tabular->row_of_cell(actcell); if (the_locking_inset == tabular->GetCellInset(cell)) { LyXText::text_status st = bv->text->status; do { diff --git a/src/insets/insettext.C b/src/insets/insettext.C index e4094c7c87..0dc00b5668 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -112,6 +112,8 @@ void InsetText::init(InsetText const * ins) InsetText::~InsetText() { + // delete all instances of LyXText before deleting the paragraps used + // by it. for(Cache::const_iterator cit = cache.begin(); cit != cache.end(); ++cit) delete (*cit).second; LyXParagraph * p = par->next; @@ -126,6 +128,10 @@ InsetText::~InsetText() void InsetText::clear() { + // delete all instances of LyXText before deleting the paragraps used + // by it. + for(Cache::const_iterator cit = cache.begin(); cit != cache.end(); ++cit) + delete (*cit).second; LyXParagraph * p = par->next; delete par; while(p) { @@ -169,6 +175,11 @@ void InsetText::Read(Buffer const * buf, LyXLex & lex) #endif LyXFont font(LyXFont::ALL_INHERIT); + // delete all instances of LyXText before deleting the paragraps used + // by it. + for(Cache::const_iterator cit = cache.begin(); cit != cache.end(); ++cit) + delete (*cit).second; + LyXParagraph * p = par->next; delete par; while(p) { @@ -1374,8 +1385,12 @@ int InsetText::getMaxWidth(Painter & pain, UpdatableInset const * inset) const void InsetText::SetParagraphData(LyXParagraph *p) { - LyXParagraph * np; + // delete all instances of LyXText before deleting the paragraps used + // by it. + for(Cache::const_iterator cit = cache.begin(); cit != cache.end(); ++cit) + delete (*cit).second; + LyXParagraph * np; if (par) { np = par->next; delete par; diff --git a/src/trans.C b/src/trans.C index 52d7a26cd4..c6417dd26a 100644 --- a/src/trans.C +++ b/src/trans.C @@ -155,7 +155,13 @@ void Trans::AddDeadkey(tex_accent accent, string const & keys, for(string::size_type i = 0; i < keys.length(); ++i) { string * temp = &keymap_[static_cast(keys[i])]; - (*temp)[0] = 0; (*temp)[1] = accent; +#warning this is not really clean we should find a cleaner way (Jug) + *temp = "xx"; /* this is needed for the being sure that the below + assignment is not assigned to a nullpointer + (if size of string = 0) + */ + (*temp)[0] = 0; + (*temp)[1] = accent; } kmod_list_[accent]->exception_list = 0; } -- 2.39.5