]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlMinipage.C
Add the missing template instatiations!
[lyx.git] / src / frontends / controllers / ControlMinipage.C
index 14f1741b685c74c828e6868e5ee3686580b608f2..44e50d237b03e05ec6a84c9af0cc091efc04e4f5 100644 (file)
@@ -7,7 +7,7 @@
  *
  * ======================================================
  *
- * \author Juergen Vigna, jug@sad.it
+ * \author JΓΌrgen Vigna, jug@sad.it
  * \author Angus Leeming, a.leeming@ic.ac.uk
  */
 
 #pragma implementation
 #endif
 
+#include "ViewBase.h"
+#include "ButtonControllerBase.h"
 #include "ControlMinipage.h"
+#include "ControlInset.tmpl"
 #include "Dialogs.h"
 #include "LyXView.h"
 #include "buffer.h"
+#include "BufferView.h"
+#include "helper_funcs.h"
 
+using std::vector;
 using SigC::slot;
 
+
 ControlMinipage::ControlMinipage(LyXView & lv, Dialogs & d)
        : ControlInset<InsetMinipage, MinipageParams>(lv, d)
 {
        d_.showMinipage.connect(slot(this, &ControlMinipage::showInset));
+
+       // We could have an extra method updateInset that calls
+       // view().update() rather than view().show(), but I don't see why
+       // it is really needed.
        d_.updateMinipage.connect(slot(this, &ControlMinipage::showInset));
 }
 
 
 void ControlMinipage::applyParamsToInset()
 {
-       inset()->width(params().width);
-       inset()->widthp(params().widthp);
+       inset()->pageWidth(params().pageWidth);
        inset()->pos(params().pos);
+
+       lv_.view()->updateInset(inset(), true);
 }
 
 
@@ -52,19 +64,21 @@ MinipageParams const ControlMinipage::getParams(InsetMinipage const & inset)
 
 
 MinipageParams::MinipageParams()
-       : widthp(0), pos(InsetMinipage::top)
+       : pos(InsetMinipage::top)
 {}
 
 MinipageParams::MinipageParams(InsetMinipage const & inset)
-       : width(inset.width()), widthp(inset.widthp()), pos(inset.pos())
+       : pageWidth(inset.pageWidth()), pos(inset.pos())
 {}
 
-bool MinipageParams::operator==(MinipageParams const & o) const
+
+bool operator==(MinipageParams const & p1, MinipageParams const & p2)
 {
-       return (width == o.width && widthp == o.widthp && pos == o.pos);
+       return (p1.pageWidth == p2.pageWidth && p1.pos == p2.pos);
 }
 
-bool MinipageParams::operator!=(MinipageParams const & o) const
+
+bool operator!=(MinipageParams const & p1, MinipageParams const & p2)
 {
-       return !(*this == o);
+       return !(p1 == p2);
 }