Move text related stuff to LyXText::dispatch

Has anybody noticed the accent-foo stuff is not working (with or without
this patch)?

Andre'
? .text3.C.swp
? 1.diff
? 2.diff
? 3.diff
? fullredraw.diff
? par-row.diff
? qfont_loader.tar.bz2
? search.diff
? tabular-il.diff
? textcache.diff
? tmp.diff
? vspace.diff
? frontends/xforms/1.diff
? insets/1.diff
? mathed/1.diff
? mathed/cursor.diff
? support/1.diff
Index: BufferView.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView.C,v
retrieving revision 1.228
diff -u -p -r1.228 BufferView.C
--- BufferView.C        4 Feb 2004 11:23:22 -0000       1.228
+++ BufferView.C        6 Feb 2004 13:25:43 -0000
@@ -428,12 +428,6 @@ int BufferView::workHeight() const
 }
 
 
-void BufferView::updateParagraphDialog()
-{
-       pimpl_->updateParagraphDialog();
-}
-
-
 LyXText * BufferView::text() const
 {
        return pimpl_->buffer_ ? &pimpl_->buffer_->text() : 0;
Index: BufferView.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView.h,v
retrieving revision 1.164
diff -u -p -r1.164 BufferView.h
--- BufferView.h        4 Feb 2004 11:23:22 -0000       1.164
+++ BufferView.h        6 Feb 2004 13:25:43 -0000
@@ -111,9 +111,6 @@ public:
        /// return the lyxtext we are using
        LyXText * getLyXText() const;
 
-       /// update paragraph dialogs
-       void updateParagraphDialog();
-
        /// return the current encoding at the cursor
        Encoding const * getEncoding() const;
 
Index: BufferView_pimpl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.503
diff -u -p -r1.503 BufferView_pimpl.C
--- BufferView_pimpl.C  6 Feb 2004 11:12:47 -0000       1.503
+++ BufferView_pimpl.C  6 Feb 2004 13:25:44 -0000
@@ -1046,36 +1046,6 @@ bool BufferView::Pimpl::dispatch(FuncReq
        }
        break;
 
-       // --- accented characters ---------------------------
-
-       case LFUN_UMLAUT:
-       case LFUN_CIRCUMFLEX:
-       case LFUN_GRAVE:
-       case LFUN_ACUTE:
-       case LFUN_TILDE:
-       case LFUN_CEDILLA:
-       case LFUN_MACRON:
-       case LFUN_DOT:
-       case LFUN_UNDERDOT:
-       case LFUN_UNDERBAR:
-       case LFUN_CARON:
-       case LFUN_SPECIAL_CARON:
-       case LFUN_BREVE:
-       case LFUN_TIE:
-       case LFUN_HUNG_UMLAUT:
-       case LFUN_CIRCLE:
-       case LFUN_OGONEK:
-               if (cmd.argument.empty()) {
-                       // As always...
-                       owner_->getLyXFunc().handleKeyFunc(cmd.action);
-               } else {
-                       owner_->getLyXFunc().handleKeyFunc(cmd.action);
-                       owner_->getIntl().getTransManager()
-                               .TranslateAndInsert(cmd.argument[0], 
bv_->getLyXText());
-                       update();
-               }
-               break;
-
        case LFUN_FLOAT_LIST:
                if (tclass.floats().typeExist(cmd.argument)) {
                        InsetBase * inset = new InsetFloatList(cmd.argument);
@@ -1102,18 +1072,6 @@ bool BufferView::Pimpl::dispatch(FuncReq
                }
                break;
 
-       case LFUN_LAYOUT_PARAGRAPH: {
-               string data;
-               params2string(*bv_->getLyXText()->cursorPar(), data);
-               data = "show\n" + data;
-               bv_->owner()->getDialogs().show("paragraph", data);
-               break;
-       }
-
-       case LFUN_PARAGRAPH_UPDATE:
-               updateParagraphDialog();
-               break;
-
        case LFUN_PARAGRAPH_APPLY:
                setParagraphParams(*bv_, cmd.argument);
                break;
@@ -1258,24 +1216,4 @@ bool BufferView::Pimpl::ChangeInsets(Ins
        }
        bv_->text()->setCursorIntern(cur.par(), cur.pos());
        return need_update;
-}
-
-
-void BufferView::Pimpl::updateParagraphDialog()
-{
-       if (!bv_->owner()->getDialogs().visible("paragraph"))
-               return;
-       CursorSlice const & cur = bv_->cursor().innerTextSlice();
-       LyXText * text = bv_->cursor().innerText();
-       Paragraph const & par = *text->getPar(cur.par());
-       string data;
-       params2string(par, data);
-
-       // Will the paragraph accept changes from the dialog?
-       InsetBase * const inset = cur.inset();
-       bool const accept =
-               !(inset && inset->forceDefaultParagraphs(inset));
-
-       data = "update " + tostr(accept) + '\n' + data;
-       bv_->owner()->getDialogs().update("paragraph", data);
 }
Index: BufferView_pimpl.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.h,v
retrieving revision 1.116
diff -u -p -r1.116 BufferView_pimpl.h
--- BufferView_pimpl.h  4 Feb 2004 09:44:10 -0000       1.116
+++ BufferView_pimpl.h  6 Feb 2004 13:25:44 -0000
@@ -109,8 +109,6 @@ struct BufferView::Pimpl : public boost:
        int top_y() const;
        ///
        void top_y(int y);
-       /// update paragraph dialogs
-       void updateParagraphDialog();
 private:
        /// the y coordinate of the top of the screen
        int top_y_;
Index: text3.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.216
diff -u -p -r1.216 text3.C
--- text3.C     4 Feb 2004 11:23:24 -0000       1.216
+++ text3.C     6 Feb 2004 13:25:45 -0000
@@ -28,6 +28,7 @@
 #include "gettext.h"
 #include "intl.h"
 #include "language.h"
+#include "lyxfunc.h"
 #include "lyxrc.h"
 #include "lyxrow.h"
 #include "paragraph.h"
@@ -1486,6 +1487,54 @@ DispatchResult LyXText::dispatch(LCursor
                cur.pop(cur.currentDepth());
                cur.bv().cursor() = cur;
                cursorDown(true);
+               break;
+
+       case LFUN_LAYOUT_PARAGRAPH: {
+               string data;
+               params2string(cur.paragraph(), data);
+               data = "show\n" + data;
+               bv->owner()->getDialogs().show("paragraph", data);
+               break;
+       }
+
+       case LFUN_PARAGRAPH_UPDATE: {
+               if (!bv->owner()->getDialogs().visible("paragraph"))
+                       break;
+               string data;
+               params2string(cur.paragraph(), data);
+
+               // Will the paragraph accept changes from the dialog?
+               InsetBase * const inset = cur.inset();
+               bool const accept =
+                       !(inset && inset->forceDefaultParagraphs(inset));
+
+               data = "update " + tostr(accept) + '\n' + data;
+               bv->owner()->getDialogs().update("paragraph", data);
+               break;
+       }
+
+
+       case LFUN_UMLAUT:
+       case LFUN_CIRCUMFLEX:
+       case LFUN_GRAVE:
+       case LFUN_ACUTE:
+       case LFUN_TILDE:
+       case LFUN_CEDILLA:
+       case LFUN_MACRON:
+       case LFUN_DOT:
+       case LFUN_UNDERDOT:
+       case LFUN_UNDERBAR:
+       case LFUN_CARON:
+       case LFUN_SPECIAL_CARON:
+       case LFUN_BREVE:
+       case LFUN_TIE:
+       case LFUN_HUNG_UMLAUT:
+       case LFUN_CIRCLE:
+       case LFUN_OGONEK:
+               bv->owner()->getLyXFunc().handleKeyFunc(cmd.action);
+               if (!cmd.argument.empty())
+                       bv->owner()->getIntl().getTransManager()
+                               .TranslateAndInsert(cmd.argument[0], this);
                break;
 
        default:
Index: insets/insettext.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.C,v
retrieving revision 1.574
diff -u -p -r1.574 insettext.C
--- insets/insettext.C  6 Feb 2004 11:12:49 -0000       1.574
+++ insets/insettext.C  6 Feb 2004 13:25:45 -0000
@@ -298,7 +298,7 @@ void InsetText::edit(LCursor & cur, bool
        finishUndo();
        sanitizeEmptyText(cur.bv());
        updateLocal(cur);
-       cur.bv().updateParagraphDialog();
+       dispatch(cur, FuncRequest(LFUN_PARAGRAPH_UPDATE));
 }
 
 

Reply via email to