From 7bab35423bd18b04a0c90f3bbf571a1c02f12f37 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Tue, 3 Oct 2000 15:31:35 +0000 Subject: [PATCH] Remove const, set language of surronding paragraph (point 19 Dekel ;) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1076 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 6 ++++++ src/BufferView.h | 2 +- src/BufferView2.C | 2 +- src/insets/insettext.C | 17 +++++++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2f44366f77..84d759b1dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2000-10-03 Juergen Vigna + * src/BufferView2.C (theLockingInset): removed const because of + Agnus's compile problems. + + * src/insets/insettext.C (LocalDispatch): set the language of the + surronding paragraph on inserting the first character. + * various files: changed use of BufferView::the_locking_inset. * src/BufferView2.C (theLockingInset): diff --git a/src/BufferView.h b/src/BufferView.h index e6bbd847c5..7f786fcd50 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -103,7 +103,7 @@ public: int workWidth() const; /// UpdatableInset * theLockingInset() const; - void theLockingInset(UpdatableInset const * inset); + void theLockingInset(UpdatableInset * inset); /// void updateInset(Inset * inset, bool mark_dirty); /// diff --git a/src/BufferView2.C b/src/BufferView2.C index 5ec1a284de..809365a172 100644 --- a/src/BufferView2.C +++ b/src/BufferView2.C @@ -900,7 +900,7 @@ UpdatableInset * BufferView::theLockingInset() const } -void BufferView::theLockingInset(UpdatableInset const * inset) +void BufferView::theLockingInset(UpdatableInset * inset) { text->the_locking_inset = inset; } diff --git a/src/insets/insettext.C b/src/insets/insettext.C index e6bee21a06..e4e6d3ad49 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -750,6 +750,23 @@ InsetText::LocalDispatch(BufferView * bv, bv->text->cursor.par()->next #endif ); + // if an empty paragraph set the language to the surronding + // paragraph language on insertion of the first character! + if (!par->Last() && !par->next) { + LyXText * text = 0; + if (owner()) { + Inset * inset = owner(); + while(inset && inset->getLyXText(bv) == TEXT(bv)) + inset = inset->owner(); + if (inset) + text = inset->getLyXText(bv); + } + if (!text) + text = bv->text; + LyXFont font(LyXFont::ALL_IGNORE); + font.setLanguage(text->cursor.par()->getParLanguage(bv->buffer()->params)); + SetFont(bv, font, false); + } if (lyxrc.auto_region_delete) { if (TEXT(bv)->selection){ TEXT(bv)->CutSelection(bv, false); -- 2.39.2