]> git.lyx.org Git - features.git/commitdiff
Various fixes (PageDown/Up, reading kmap, drawing tabular lines).
authorJürgen Vigna <jug@sad.it>
Mon, 30 Oct 2000 08:14:36 +0000 (08:14 +0000)
committerJürgen Vigna <jug@sad.it>
Mon, 30 Oct 2000 08:14:36 +0000 (08:14 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1171 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/BufferView_pimpl.C
src/LyXView.h
src/insets/insettabular.C
src/insets/insettext.C
src/trans.C

index 599ed95e085f3f047747e11b38a4cd0bc1de353f..70a354688d0286c5fb2c8702f42b66a077b30ee0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2000-10-28  Juergen Vigna  <jug@sad.it>
+
+       * 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  <jug@sad.it>
 
        * src/tabular.C (~LyXTabular): removed not needed anymore.
index 8469d5a227a69be2f1a87e4bd78625616b7a98c8..a896c75edf5a698e83a0bcbda0f6aeed66167cf2 100644 (file)
@@ -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()))
index 87ad3703e1912ebb89f434d76b23a9b46d8b168a..5ce2b4efffc94a096ed28f04ff4b66dc3d646f33 100644 (file)
@@ -16,6 +16,7 @@
 #pragma interface
 #endif
 
+#include <config.h>
 #include FORMS_H_LOCATION
 
 #include "LString.h"
index 82eec2b11930c45cd0a384aaecf4115cd17d99cb..e328e51b513e856df53bbad7979962e71b5e60be 100644 (file)
@@ -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 {
index e4094c7c8709fb2045a82e0e75f827af0be19017..0dc00b5668801bd5be29728b98fe95c2f3a376cd 100644 (file)
@@ -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;
index 52d7a26cd4c3ee456d7712eceae252f4238d6130..c6417dd26a9bf8d5d7aca5c093e63c0503cc6ca8 100644 (file)
@@ -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<unsigned char>(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;
 }