+2003-05-06 John Levon <levon@movementarian.org>
+
+ * text2.C: don't cast wrap inset to float
2003-05-05 André Pönitz <poenitz@gmx.net>
+2003-05-06 John Levon <levon@movementarian.org>
+
+ * insetcaption.C: don't cast wrap inset to InsetFloat
+
+ * insetfloat.h:
+ * insetfloat.C: remove unneeded type() function
2003-05-05 André Pönitz <poenitz@gmx.net>
#include "buffer.h"
#include "FloatList.h"
#include "insets/insetfloat.h"
+#include "insets/insetwrap.h"
#include "debug.h"
#include "gettext.h"
#include "support/lstrings.h"
-
+#include "support/LAssert.h"
#include "support/BoostFormat.h"
using std::ostream;
// belongs to.
Inset * i1 = owner();
Inset * i2 = i1 ? i1->owner() : 0;
- string const type = static_cast<InsetFloat *>(i2)->type();
+ string type;
+ if (i2->lyxCode() == FLOAT_CODE)
+ type = static_cast<InsetFloat *>(i2)->params().type;
+ else if (i2->lyxCode() == WRAP_CODE)
+ type = static_cast<InsetWrap *>(i2)->params().type;
+ else
+ lyx::Assert(0);
+
FloatList const & floats =
bv->buffer()->params.getLyXTextClass().floats();
string const fl = i2 ? floats.getType(type).name() : N_("Float");
}
-string const & InsetFloat::type() const
-{
- return params_.type;
-}
-
-
void InsetFloat::wide(bool w, BufferParams const & bp)
{
params_.wide = w;
Paragraph * tmp = *pit;
if (tmp->layout()->name() == caplayout) {
- string const name = floatname(type(), buf->params);
+ string const name = floatname(params_.type, buf->params);
string const str =
tostr(toclist[name].size() + 1)
+ ". " + tmp->asString(buf, false);
insets that may contain several paragraphs */
bool noFontChange() const { return true; }
///
- string const & type() const;
- ///
void wide(bool w, BufferParams const &);
///
void addToToc(toc::TocList &, Buffer const *) const;
#include "insets/insetbibitem.h"
#include "insets/insetfloat.h"
+#include "insets/insetwrap.h"
#include "support/LAssert.h"
#include "support/textutils.h"
}
if (isOK) {
- Floating const & fl
- = textclass.floats().getType(static_cast<InsetFloat*>(in)->type());
+ string type;
+
+ if (in->lyxCode() == Inset::FLOAT_CODE)
+ type = static_cast<InsetFloat*>(in)->params().type;
+ else if (in->lyxCode() == Inset::WRAP_CODE)
+ type = static_cast<InsetWrap*>(in)->params().type;
+ else
+ lyx::Assert(0);
+
+ Floating const & fl = textclass.floats().getType(type);
textclass.counters().step(fl.type());