]> git.lyx.org Git - features.git/commitdiff
removed unused code
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 29 Apr 2000 00:47:16 +0000 (00:47 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 29 Apr 2000 00:47:16 +0000 (00:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@708 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.C
src/BufferView.h
src/BufferView_pimpl.C
src/BufferView_pimpl.h
src/lyxfunc.C
src/lyxscreen.h
src/screen.C

index 187dd1c8bc9096973cbd522705e0fe8f0c9b4d3c..22ae6295a897b39fbf26bc7698df8b4833321f1c 100644 (file)
@@ -244,14 +244,6 @@ void BufferView::update(signed char f)
 }
 
 
-#if 0
-void BufferView::smallUpdate(signed char f)
-{
-       pimpl_->smallUpdate(f);
-}
-#endif
-
-
 void BufferView::setState()
 {
        pimpl_->setState();
index 6245e3d7ee6ff9a5653339a0cd272dd10c62a585..25f536e785f0f0464601e176ae8781ebc6ad3c9b 100644 (file)
@@ -48,10 +48,6 @@ public:
        void update();
        ///
        void update(signed char f);
-#if 0
-       ///
-       void smallUpdate(signed char f);
-#endif
        ///
        void updateScrollbar();
        ///
index 792809ca8dae803e8fec768dae4d95cd49a886ae..b86aa3cf4b5b47e50663f9521ddd56d24494830b 100644 (file)
@@ -1192,38 +1192,6 @@ void BufferView::Pimpl::update(signed char f)
 }
 
 
-#if 0
-void BufferView::Pimpl::smallUpdate(signed char f)
-{
-#if 1
-       update(f);
-#else
-       screen->SmallUpdate();
-       if (screen->TopCursorVisible()
-           != screen->first) {
-               update(f);
-               return;
-       }
-
-       fitCursor();
-       //updateScrollbar();
-
-       if (!bv_->text->selection)
-               bv_->text->sel_cursor = bv_->text->cursor;
-
-       if (f == 1 || f == -1) {
-               if (buffer_->isLyxClean()) {
-                       buffer_->markDirty();
-                       owner_->getMiniBuffer()->setTimer(4);
-               } else {
-                       buffer_->markDirty();
-               }
-       }
-#endif
-}
-#endif
-
-
 // Callback for cursor timer
 void BufferView::Pimpl::cursorToggle()
 {
index 3914f4574431823dcb51e61bbc41efaac56163ad..7dbea916305364e01dd7a9a339312a2bedd96c5f 100644 (file)
@@ -38,10 +38,6 @@ struct BufferView::Pimpl {
        void update();
        ///
        void update(signed char f);
-#if 0
-       ///
-       void smallUpdate(signed char f);
-#endif
        ///
        void gotoError();
        /// Update pixmap of screen
index 228ad30895ac14e7c02e13e6e04e0736dd30a6c8..c572813b645a03ff646f7e7ad39fdb9c08b5e273 100644 (file)
@@ -1658,11 +1658,7 @@ string LyXFunc::Dispatch(int ac,
        case LFUN_BREAKLINE:
                owner->view()->beforeChange();
                owner->view()->text->InsertChar(LyXParagraph::META_NEWLINE);
-#if 1
                owner->view()->update(1);
-#else
-               owner->view()->smallUpdate(1);
-#endif
                SetUpdateTimer(0.01);
                moveCursorUpdate(false);
                break;
@@ -1704,11 +1700,7 @@ string LyXFunc::Dispatch(int ac,
                        owner->view()->text->Delete();
                        owner->view()->text->sel_cursor = 
                                owner->view()->text->cursor;
-#if 1
                        owner->view()->update(1);
-#else
-                       owner->view()->smallUpdate(1);
-#endif
                        // It is possible to make it a lot faster still
                        // just comment out the lone below...
                        owner->view()->showCursor();
@@ -1751,21 +1743,13 @@ string LyXFunc::Dispatch(int ac,
                                        owner->view()->text->Delete();
                                        owner->view()->text->sel_cursor = 
                                                owner->view()->text->cursor;
-#if 1
                                        owner->view()->update(1);
-#else
-                                       owner->view()->smallUpdate(1);
-#endif
                                }
                        } else {
                                owner->view()->text->Delete();
                                owner->view()->text->sel_cursor = 
                                        owner->view()->text->cursor;
-#if 1
                                owner->view()->update(1);
-#else
-                               owner->view()->smallUpdate(1);
-#endif
                        }
                } else {
                        owner->view()->cut();
@@ -1833,11 +1817,7 @@ string LyXFunc::Dispatch(int ac,
                                owner->view()->text->Backspace();
                                owner->view()->text->sel_cursor = 
                                        owner->view()->text->cursor;
-#if 1
                                owner->view()->update(1);
-#else
-                               owner->view()->smallUpdate(1);
-#endif
                                // It is possible to make it a lot faster still
                                // just comment out the lone below...
                                owner->view()->showCursor();
@@ -1875,11 +1855,7 @@ string LyXFunc::Dispatch(int ac,
                                owner->view()->text->Backspace();
                                owner->view()->text->sel_cursor 
                                        = cursor;
-#if 1
                                owner->view()->update(1);
-#else
-                               owner->view()->smallUpdate (1);
-#endif
                        }
                } else
                        owner->view()->cut();
@@ -1891,11 +1867,7 @@ string LyXFunc::Dispatch(int ac,
        {
                owner->view()->beforeChange();
                owner->view()->text->BreakParagraph(0);
-#if 1
                owner->view()->update(1);
-#else
-               owner->view()->smallUpdate(1);
-#endif
                SetUpdateTimer(0.01);
                owner->view()->text->sel_cursor = 
                        owner->view()->text->cursor;
@@ -1908,11 +1880,7 @@ string LyXFunc::Dispatch(int ac,
        {
                owner->view()->beforeChange();
                owner->view()->text->BreakParagraph(1);
-#if 1
                owner->view()->update(1);
-#else
-               owner->view()->smallUpdate(1);
-#endif
                SetUpdateTimer(0.01);
                owner->view()->text->sel_cursor = 
                        owner->view()->text->cursor;
@@ -1945,11 +1913,7 @@ string LyXFunc::Dispatch(int ac,
                }
                else {
                        owner->view()->text->BreakParagraph(0);
-#if 1
                        owner->view()->update(1);
-#else
-                       owner->view()->smallUpdate(1);
-#endif
                }
                SetUpdateTimer(0.01);
                owner->view()->text->sel_cursor = cursor;
@@ -2009,11 +1973,7 @@ string LyXFunc::Dispatch(int ac,
        case LFUN_QUOTE:
                owner->view()->beforeChange();
                owner->view()->text->InsertChar('\"');  // This " matches the single quote in the code
-#if 1
                owner->view()->update(1);
-#else
-               owner->view()->smallUpdate(1);
-#endif
                SetUpdateTimer();
                 moveCursorUpdate(false);
                break;
@@ -2192,12 +2152,10 @@ string LyXFunc::Dispatch(int ac,
        case LFUN_CIRCLE:
        case LFUN_OGONEK:
        {
-               char c;
+               char c = 0;
                
                if (keyseq.length == -1 && keyseq.getiso() != 0) 
                        c = keyseq.getiso();
-               else
-                       c = 0;
                
                owner->getIntl()->getTrans()->
                        deadkey(c, get_accent(action).accent, 
@@ -2209,11 +2167,8 @@ string LyXFunc::Dispatch(int ac,
                keyseq.length = 0;
                
                // copied verbatim from do_accent_char
-#if 1
                owner->view()->update(1);
-#else
-               owner->view()->smallUpdate(1);
-#endif
+
                SetUpdateTimer();
                owner->view()->text->sel_cursor = 
                        owner->view()->text->cursor;
@@ -2567,11 +2522,7 @@ string LyXFunc::Dispatch(int ac,
                        owner->view()->text->InsertChar(argument[i]);
                        // This needs to be in the loop, or else we
                        // won't break lines correctly. (Asger)
-#if 1
                        owner->view()->update(1);
-#else
-                       owner->view()->smallUpdate(1);
-#endif
                }
                SetUpdateTimer();
                owner->view()->text->sel_cursor = 
@@ -2609,11 +2560,7 @@ string LyXFunc::Dispatch(int ac,
                datetmp_len = (int) strftime(datetmp, 32, arg.c_str(), now_tm);
                for (int i = 0; i < datetmp_len; i++) {
                        owner->view()->text->InsertChar(datetmp[i]);
-#if 1
                        owner->view()->update(1);
-#else
-                       owner->view()->smallUpdate(1);
-#endif
                }
                SetUpdateTimer();
                owner->view()->text->sel_cursor = owner->view()->text->cursor;
@@ -2668,11 +2615,7 @@ string LyXFunc::Dispatch(int ac,
                                        owner->getIntl()->getTrans()->TranslateAndInsert(argument[i], owner->view()->text);
                        }
 
-#if 1
                        owner->view()->update(1);
-#else
-                       owner->view()->smallUpdate(1);
-#endif
                        SetUpdateTimer();
 
                        owner->view()->text->sel_cursor = 
index cd9f3266d71fc7e8c3b515a5cc1c842d5e92e74d..944c722f880b7dfa8701c78a5412999f430a20c2 100644 (file)
@@ -79,11 +79,6 @@ public:
            we only update the current row. */
        void Update();
 
-#if 0
-       /** Updates part of the screen. Updates till row with cursor,
-           or only current row */
-       void SmallUpdate();
-#endif
        /// first visible pixel-row
        unsigned long first;
 
@@ -96,13 +91,8 @@ private:
        /// y1 and y2 are coordinates of the screen
        void DrawFromTo(int y1, int y2);
 
-#if 1
        /// y is a coordinate of the text
        void DrawOneRow(Row * row, long y_text);
-#else
-       /// y is a coordinate of the text
-       void DrawOneRow(Row * row, long & y_text);
-#endif
 
        ///
        WorkArea & owner;
index 04dacc2a3152d2b3a4115c17141e8167f1285fde..6b61b9228e9f08331b7128b240aeb51f6f89747a 100644 (file)
@@ -114,28 +114,15 @@ void LyXScreen::DrawFromTo(int y1, int y2)
 }
 
 
-#if 1
 void LyXScreen::DrawOneRow(Row * row, long y_text)
 {
        long y = y_text - first;
       
        if (y + row->height > 0 && y - row->height <= long(owner.height())) {
-               /* ok there is something visible */
+               // ok there is something visible
                text->GetVisibleRow(y, row, y + first);
        }
 }
-#else
-void LyXScreen::DrawOneRow(Row * row, long & y_text)
-{
-       long y = y_text - first;
-      
-       if (y + row->height > 0 && y - row->height <= long(owner.height())) {
-               /* ok there is something visible */
-               text->GetVisibleRow(y, row, y + first);
-       }
-       y_text += row->height;
-}
-#endif
 
 
 /* draws the screen, starting with textposition y. uses as much already
@@ -391,7 +378,6 @@ bool LyXScreen::FitCursor()
    
 void LyXScreen::Update()
 {
-#if 1
        switch(text->status) {
        case LyXText::NEED_MORE_REFRESH:
        {
@@ -417,81 +403,9 @@ void LyXScreen::Update()
                // Nothing needs done
                break;
        }
-#else
-       if (text->status == LyXText::NEED_MORE_REFRESH
-           || screen_refresh_y > -1 ) {
-               long y = 0;
-               if (screen_refresh_y > -1
-                   && screen_refresh_y < text->refresh_y)
-                       y = screen_refresh_y;
-               else
-                       y = text->refresh_y;
-               
-               //if (y < first) y = first;
-               y = max(y, long(first));
-               
-               DrawFromTo(y - first, owner.height());
-               text->refresh_y = 0;
-               text->status = LyXText::UNCHANGED;
-               screen_refresh_y = -1;
-               expose(0, y - first,
-                      owner.workWidth(), owner.height() - (y - first));
-       } else if (text->status == LyXText::NEED_VERY_LITTLE_REFRESH) {
-               /* ok I will update the current cursor row */
-               long y = text->refresh_y;
-               DrawOneRow(text->refresh_row, y);
-               text->status = LyXText::UNCHANGED;
-               expose(0, text->refresh_y - first,
-                      owner.workWidth(), text->refresh_row->height);
-       }
-#endif
 }
 
 
-#if 0
-void LyXScreen::SmallUpdate()
-{
-#if 1
-       Update();
-#else
-       if (text->status == LyXText::NEED_MORE_REFRESH) {
-               /* ok I will update till the current cursor row */
-               Row * row = text->refresh_row;
-               long y = text->refresh_y;
-               long y2 = y;
-      
-               if (y > long(text->cursor.y)) {
-                       Update();
-                       return;
-               }
-        
-               while (row
-                      && row != text->cursor.row
-                      && y < long(first + owner.height())) {
-                       DrawOneRow(row, y);
-                       row = row->next;
-               }
-      
-               DrawOneRow(row, y);
-               screen_refresh_y = y;
-               screen_refresh_row = row->next;
-               text->status = LyXText::UNCHANGED;
-               // Is the right regin exposed?
-               expose(0, y2 - first,
-                      owner.workWidth(), y - y2);
-       } else if (text->status == LyXText::NEED_VERY_LITTLE_REFRESH) {
-               /* ok I will update the current cursor row */
-               long y = text->refresh_y;
-               DrawOneRow(text->refresh_row, y);
-               text->status = LyXText::UNCHANGED;
-               expose(0, text->refresh_y - first,
-                      owner.workWidth(), text->refresh_row->height);
-       }
-#endif
-}
-#endif
-
-
 void LyXScreen::ToggleSelection(bool kill_selection)
 {
        /* only if there is a selection */