X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fcontrollers%2FControlMinipage.C;h=44e50d237b03e05ec6a84c9af0cc091efc04e4f5;hb=a61a18e2a0d7b91dd364b2d7c4a91800a4c1cec9;hp=dab432c839a7fc4bc1ab2844a0427572fa5b6254;hpb=697a0d48b59e489f0b5e10146f806878aaead6c3;p=lyx.git diff --git a/src/frontends/controllers/ControlMinipage.C b/src/frontends/controllers/ControlMinipage.C index dab432c839..44e50d237b 100644 --- a/src/frontends/controllers/ControlMinipage.C +++ b/src/frontends/controllers/ControlMinipage.C @@ -20,15 +20,16 @@ #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; -// sorry this is just a temporary hack we should include vspace.h! (Jug) -extern const char * stringFromUnit(int); ControlMinipage::ControlMinipage(LyXView & lv, Dialogs & d) : ControlInset(lv, d) @@ -44,7 +45,7 @@ ControlMinipage::ControlMinipage(LyXView & lv, Dialogs & d) void ControlMinipage::applyParamsToInset() { - inset()->width(params().width); + inset()->pageWidth(params().pageWidth); inset()->pos(params().pos); lv_.view()->updateInset(inset(), true); @@ -67,29 +68,17 @@ MinipageParams::MinipageParams() {} MinipageParams::MinipageParams(InsetMinipage const & inset) - : width(inset.width()), pos(inset.pos()) + : pageWidth(inset.pageWidth()), pos(inset.pos()) {} -bool MinipageParams::operator==(MinipageParams const & o) const -{ - return (width == o.width && 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; - const char * str; - for(int i=0;(str=stringFromUnit(i));++i) - units.push_back(str); - - return units; + return !(p1 == p2); } - -} // namespace minipage