]> git.lyx.org Git - features.git/commitdiff
Remove const, set language of surronding paragraph (point 19 Dekel ;)
authorJürgen Vigna <jug@sad.it>
Tue, 3 Oct 2000 15:31:35 +0000 (15:31 +0000)
committerJürgen Vigna <jug@sad.it>
Tue, 3 Oct 2000 15:31:35 +0000 (15:31 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1076 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/BufferView.h
src/BufferView2.C
src/insets/insettext.C

index 2f44366f7705aa45eb668119c06d698050735d52..84d759b1ddfda60e945e33e3e45f600becdd7430 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 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): 
index e6bbd847c5780203b58614d3847f1939290f48ee..7f786fcd501bb83b861a46fc5a50b335284b99e2 100644 (file)
@@ -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);
        ///
index 5ec1a284dead2f6c961d7bc74eefc0d3ed0115de..809365a1723f2199d5468c84b1b42ba697602f73 100644 (file)
@@ -900,7 +900,7 @@ UpdatableInset * BufferView::theLockingInset() const
 }
 
 
-void BufferView::theLockingInset(UpdatableInset const * inset)
+void BufferView::theLockingInset(UpdatableInset * inset)
 {
     text->the_locking_inset = inset;
 }
index e6bee21a06810495f043c7043f8d513d0b525211..e4e6d3ad49bb0a054c815913e6b984f64cd5c2dd 100644 (file)
@@ -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);