]> git.lyx.org Git - lyx.git/commitdiff
Fix http://bugzilla.lyx.org/show_bug.cgi?id=4603
authorAbdelrazak Younes <younes@lyx.org>
Tue, 6 May 2008 14:53:54 +0000 (14:53 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 6 May 2008 14:53:54 +0000 (14:53 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24642 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiWrap.cpp
src/frontends/qt4/GuiWrap.h

index 6cc8b54f090a7b24b7518ffab8b38d5384cc0930..ebc78bbacf398099f271bc1e045b7fa033eeeb64 100644 (file)
@@ -149,15 +149,15 @@ void GuiWrap::applyView()
 }
 
 
-void GuiWrap::updateContents()
+void GuiWrap::paramsToDialog(InsetWrapParams const & params)
 {
        // 0pt is a legal width now, it yields a
        // wrapfloat just wide enough for the contents.
-       Length len_w = params_.width;
+       Length len_w = params.width;
        widthED->setText(QString::number(len_w.value()));
        widthUnitLC->setCurrentItem(len_w.unit());
 
-       Length len_o(params_.overhang);
+       Length len_o(params.overhang);
        overhangED->setText(QString::number(len_o.value()));
        overhangUnitLC->setCurrentItem(len_o.unit());
        if (len_o.value() == 0)
@@ -165,24 +165,24 @@ void GuiWrap::updateContents()
        else
                overhangCB->setCheckState(Qt::Checked);
 
-       linesSB->setValue(params_.lines);
-       if (params_.lines == 0)
+       linesSB->setValue(params.lines);
+       if (params.lines == 0)
                linesCB->setCheckState(Qt::Unchecked);
        else
                linesCB->setCheckState(Qt::Checked);
 
        int item = 0;
-       if (params_.placement == "i" || params_.placement == "I")
+       if (params.placement == "i" || params.placement == "I")
                item = 1;
-       else if (params_.placement == "l" || params_.placement == "L")
+       else if (params.placement == "l" || params.placement == "L")
                item = 2;
-       else if (params_.placement == "r" || params_.placement == "R")
+       else if (params.placement == "r" || params.placement == "R")
                item = 3;
 
        valignCO->setCurrentIndex(item);
 
-       if (params_.placement == "O" || params_.placement == "I"
-               || params_.placement == "L" || params_.placement == "R")
+       if (params.placement == "O" || params.placement == "I"
+               || params.placement == "L" || params.placement == "R")
                floatCB->setCheckState(Qt::Checked);
 }
 
@@ -190,6 +190,7 @@ void GuiWrap::updateContents()
 bool GuiWrap::initialiseParams(string const & data)
 {
        InsetWrap::string2params(data, params_);
+       paramsToDialog(params_);
        return true;
 }
 
index dbb20edb6b754e323e5eb34b826a0d248ff2207f..8079da7a5e01c72ed115cda40b8f4abcffd68126 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "GuiDialog.h"
 #include "ui_WrapUi.h"
+
 #include "insets/InsetWrap.h"
 
 namespace lyx {
@@ -30,18 +31,18 @@ private Q_SLOTS:
        void change_adaptor();
 
 private:
-       /// Apply changes
+       /// Dialog inherited methods
+       //@{
        void applyView();
-       /// update
-       void updateContents();
-       ///
+       void updateContents() {}
        bool initialiseParams(std::string const & data);
-       /// clean-up on hide.
        void clearParams();
-       /// clean-up on hide.
        void dispatchParams();
-       ///
        bool isBufferDependent() const { return true; }
+       //@}
+
+       ///
+       void paramsToDialog(InsetWrapParams const & params);
 
        ///
        InsetWrapParams params_;