]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlMinipage.C
ws fixes, formatting and some other small changes
[lyx.git] / src / frontends / controllers / ControlMinipage.C
index dab432c839a7fc4bc1ab2844a0427572fa5b6254..a8db010c82c0b30b7d7067438099383b73ca28a4 100644 (file)
@@ -1,14 +1,12 @@
-/* This file is part of
- * ====================================================== 
+/**
+ * \file ControlMinipage.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
+ * \author Jürgen Vigna
+ * \author Angus Leeming
  *
- *           Copyright 2001 The LyX Team.
- *
- * ======================================================
- *
- * \author Jürgen Vigna, jug@sad.it
- * \author Angus Leeming, a.leeming@ic.ac.uk
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
 #pragma implementation
 #endif
 
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
 #include "ControlMinipage.h"
-#include "Dialogs.h"
-#include "LyXView.h"
-#include "buffer.h"
-
-using std::vector;
-using SigC::slot;
+#include "BufferView.h"
 
-// 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<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()->pageWidth(params().pageWidth);
        inset()->pos(params().pos);
 
-       lv_.view()->updateInset(inset(), true);
+       bufferview()->updateInset(inset(), true);
 }
 
 
@@ -66,30 +48,19 @@ MinipageParams::MinipageParams()
        : pos(InsetMinipage::top)
 {}
 
+
 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<string> const getUnits()
+bool operator!=(MinipageParams const & p1, MinipageParams const & p2)
 {
-       vector<string> units;
-       const char * str;
-       for(int i=0;(str=stringFromUnit(i));++i)
-           units.push_back(str);
-
-       return units;
+       return !(p1 == p2);
 }
-} // namespace minipage