2000-10-03 Juergen Vigna <jug@sad.it>
+ * 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):
int workWidth() const;
///
UpdatableInset * theLockingInset() const;
- void theLockingInset(UpdatableInset const * inset);
+ void theLockingInset(UpdatableInset * inset);
///
void updateInset(Inset * inset, bool mark_dirty);
///
}
-void BufferView::theLockingInset(UpdatableInset const * inset)
+void BufferView::theLockingInset(UpdatableInset * inset)
{
text->the_locking_inset = inset;
}
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);