]> git.lyx.org Git - lyx.git/commitdiff
handle font changing stuff when we have a cell selection (fix # 217).
authorJürgen Vigna <jug@sad.it>
Tue, 26 Feb 2002 15:17:00 +0000 (15:17 +0000)
committerJürgen Vigna <jug@sad.it>
Tue, 26 Feb 2002 15:17:00 +0000 (15:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3588 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insettabular.C

index 93886fcd60b9e4c0b13f6e0e1c6109b6ba3d6068..463c94a1cae064ec4dc6df8aff6eda36f91ff10f 100644 (file)
@@ -2,6 +2,9 @@
 
        * insettabular.C (localDispatch): force a SELECTION update if we
        had a selection and we passed the event down to the inset (fix #213)
+       (localDispatch): handle font changing stuff when we have a cell
+       selection so that the selection is not rewoked. I don't really like
+       this fix, but it's the only way I see to do it right now.
 
 2002-02-22  Juergen Vigna  <jug@sad.it>
 
index 6230440d28fb19ade03d36f8fd5f75b70c36eeaf..e3311eb5a0d5b0bd49381d197905413504024794 100644 (file)
@@ -1186,10 +1186,31 @@ InsetTabular::localDispatch(BufferView * bv, kb_action action,
                }
                // ATTENTION: the function above has to be PASTE and PASTESELECTION!!!
        default:
+               // handle font changing stuff on selection before we lock the inset
+               // in the default part!
+               result = UNDISPATCHED;
+               if (hs) {
+                       switch(action) {
+                       case LFUN_LANGUAGE:
+                       case LFUN_EMPH:
+                       case LFUN_BOLD:
+                       case LFUN_NOUN:
+                       case LFUN_CODE:
+                       case LFUN_SANS:
+                       case LFUN_ROMAN:
+                       case LFUN_DEFAULT:
+                       case LFUN_UNDERLINE:
+                       case LFUN_FONT_SIZE:
+                               if (bv->Dispatch(action, arg))
+                                       result = DISPATCHED;
+                               break;
+                       default:
+                               break;
+                       }
+               }
                // we try to activate the actual inset and put this event down to
                // the insets dispatch function.
-               result = UNDISPATCHED;
-               if (the_locking_inset)
+               if ((result == DISPATCHED) || the_locking_inset)
                        break;
                nodraw(true);
                if (activateCellInset(bv)) {