Hello,

The title says it all. This is one more step in the eradication of workArea_ inside BufferView!

Abdel.

Log:
* BufferView::workAreaResize(): now requires width and height.
* BufferView::pimpl::workAreaResize(): ditto
* gtk/GWorkArea.C: adapt call to above Change
* qt3/QContentPane.C: ditto
* qt4/GuiWorkArea.C: ditto
* xforms/XWorkArea.C: ditto



Index: src/BufferView.C
===================================================================
--- src/BufferView.C    (revision 14173)
+++ src/BufferView.C    (working copy)
@@ -242,9 +242,9 @@
 }
 
 
-void BufferView::workAreaResize()
+void BufferView::workAreaResize(int width, int height)
 {
-        pimpl_->workAreaResize();
+        pimpl_->workAreaResize(width, height);
 }
 
 
Index: src/BufferView.h
===================================================================
--- src/BufferView.h    (revision 14173)
+++ src/BufferView.h    (working copy)
@@ -186,7 +186,7 @@
        void selectionLost();
 
        ///
-       void workAreaResize();
+       void workAreaResize(int width, int height);
        
        /// Receive a keypress
        void workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state);
Index: src/BufferView_pimpl.C
===================================================================
--- src/BufferView_pimpl.C      (revision 14173)
+++ src/BufferView_pimpl.C      (working copy)
@@ -638,17 +638,14 @@
 }
 
 
-void BufferView::Pimpl::workAreaResize()
+void BufferView::Pimpl::workAreaResize(int width, int height)
 {
-       static int workArea_width;
-       static int workArea_height;
+       bool const widthChange = width != width_;
+       bool const heightChange = height != height_;
 
-       bool const widthChange = workArea_->width() != workArea_width;
-       bool const heightChange = workArea_->height() != workArea_height;
-
        // Update from work area
-       workArea_width = workArea_->width();
-       workArea_height = workArea_->height();
+       width_ = width;
+       height_ = height;
 
        if (buffer_ && widthChange) {
                // The visible LyXView need a resize
Index: src/BufferView_pimpl.h
===================================================================
--- src/BufferView_pimpl.h      (revision 14173)
+++ src/BufferView_pimpl.h      (working copy)
@@ -75,7 +75,7 @@
        ///
        bool loadLyXFile(std::string const &, bool);
        ///
-       void workAreaResize();
+       void workAreaResize(int width, int height);
        ///
        void updateScrollbar();
        ///
@@ -125,6 +125,11 @@
        lyx::frontend::Clipboard & clipboard() const;
 
 private:
+       ///
+       int width_;
+       ///
+       int height_;
+
        /// An error list (replaces the error insets)
        ErrorList errorlist_;
        /// add an error to the list
Index: src/frontends/gtk/GWorkArea.C
===================================================================
--- src/frontends/gtk/GWorkArea.C       (revision 14165)
+++ src/frontends/gtk/GWorkArea.C       (working copy)
@@ -332,7 +332,7 @@
                gtk_im_context_set_client_window(
                        imContext_, workArea_.get_window()->gobj());
        }
-       view_.view()->workAreaResize();
+       view_.view()->workAreaResize(workArea_.get_width(), 
workArea_.get_height());
        return true;
 }
 
Index: src/frontends/qt3/QContentPane.C
===================================================================
--- src/frontends/qt3/QContentPane.C    (revision 14165)
+++ src/frontends/qt3/QContentPane.C    (working copy)
@@ -337,7 +337,7 @@
        }
 
        pixmap_->resize(width(), height());
-        wa_->view().view()->workAreaResize();
+       wa_->view().view()->workAreaResize(width(), height());
 }
 
 
@@ -345,7 +345,7 @@
 {
        if (!pixmap_.get()) {
                pixmap_.reset(new QPixmap(width(), height()));
-                wa_->view().view()->workAreaResize();
+               wa_->view().view()->workAreaResize(width(), height());
                return;
        }
 
Index: src/frontends/qt4/GuiWorkArea.C
===================================================================
--- src/frontends/qt4/GuiWorkArea.C     (revision 14173)
+++ src/frontends/qt4/GuiWorkArea.C     (working copy)
@@ -439,7 +439,7 @@
 //     paint_device_ = QImage(viewport()->width(), viewport()->height(), 
QImage::Format_RGB32);
        paint_device_ = QPixmap(viewport()->width(), viewport()->height());
 
-       buffer_view_->workAreaResize();
+       buffer_view_->workAreaResize(viewport()->width(), viewport()->height());
 
        /*
        lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION
Index: src/frontends/xforms/XWorkArea.C
===================================================================
--- src/frontends/xforms/XWorkArea.C    (revision 14165)
+++ src/frontends/xforms/XWorkArea.C    (working copy)
@@ -220,7 +220,7 @@
                                       height,
                                       fl_get_visual_depth());
 
-       view_.view()->workAreaResize();
+       view_.view()->workAreaResize(width, height);
 }
 
 

Reply via email to