X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fcontrollers%2FControlMinipage.C;h=44e50d237b03e05ec6a84c9af0cc091efc04e4f5;hb=a61a18e2a0d7b91dd364b2d7c4a91800a4c1cec9;hp=f9ce97d0346be58f4b7edc237b4b9928b047ad86;hpb=5e8837030034cc75b3bfc7422131d71417a7ef13;p=lyx.git diff --git a/src/frontends/controllers/ControlMinipage.C b/src/frontends/controllers/ControlMinipage.C index f9ce97d034..44e50d237b 100644 --- a/src/frontends/controllers/ControlMinipage.C +++ b/src/frontends/controllers/ControlMinipage.C @@ -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 */ @@ -17,14 +17,20 @@ #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(lv, d) { @@ -39,8 +45,7 @@ ControlMinipage::ControlMinipage(LyXView & lv, Dialogs & d) void ControlMinipage::applyParamsToInset() { - inset()->width(params().width); - inset()->widthp(params().widthp); + inset()->pageWidth(params().pageWidth); inset()->pos(params().pos); lv_.view()->updateInset(inset(), true); @@ -59,38 +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 -{ - return (width == o.width && widthp == o.widthp && pos == o.pos); -} -bool MinipageParams::operator!=(MinipageParams const & o) const +bool operator==(MinipageParams const & p1, MinipageParams const & p2) { - return !(*this == o); + return (p1.pageWidth == p2.pageWidth && p1.pos == p2.pos); } -namespace minipage { -vector const getUnits() +bool operator!=(MinipageParams const & p1, MinipageParams const & p2) { - vector units; - units.push_back("mm"); - units.push_back("in"); - units.push_back("em"); - units.push_back("%%"); - units.push_back("%%c"); - units.push_back("%%l"); - units.push_back("%%p"); - - return units; + return !(p1 == p2); } - -} // namespace minipage -