lyx_mirror/src/frontends/controllers/ControlMinipage.C
Angus Leeming c265d16ed0 Nothing but a changed email address (trying to factor my tree in in small steps)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4998 a592a061-630c-0410-9148-cb99ea01b6c8
2002-08-15 16:02:22 +00:00

68 lines
1.3 KiB
C

/* This file is part of
* ======================================================
*
* LyX, The Document Processor
*
* Copyright 2001 The LyX Team.
*
* ======================================================
*
* \author Jürgen Vigna, jug@sad.it
* \author Angus Leeming <leeming@lyx.org>
*/
#include <config.h>
#ifdef __GNUG__
#pragma implementation
#endif
#include "ControlMinipage.h"
#include "BufferView.h"
ControlMinipage::ControlMinipage(LyXView & lv, Dialogs & d)
: ControlInset<InsetMinipage, MinipageParams>(lv, d)
{}
void ControlMinipage::applyParamsToInset()
{
inset()->pageWidth(params().pageWidth);
inset()->pos(params().pos);
bufferview()->updateInset(inset(), true);
}
void ControlMinipage::applyParamsNoInset()
{
}
MinipageParams const ControlMinipage::getParams(InsetMinipage const & inset)
{
return MinipageParams(inset);
}
MinipageParams::MinipageParams()
: pos(InsetMinipage::top)
{}
MinipageParams::MinipageParams(InsetMinipage const & inset)
: pageWidth(inset.pageWidth()), pos(inset.pos())
{}
bool operator==(MinipageParams const & p1, MinipageParams const & p2)
{
return (p1.pageWidth == p2.pageWidth && p1.pos == p2.pos);
}
bool operator!=(MinipageParams const & p1, MinipageParams const & p2)
{
return !(p1 == p2);
}