mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-05 13:26:21 +00:00
fix bad InsetWrap cast
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6936 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
1badafaa40
commit
ebdfad1c62
@ -1,3 +1,6 @@
|
||||
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>
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
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>
|
||||
|
||||
|
@ -18,10 +18,11 @@
|
||||
#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;
|
||||
@ -78,7 +79,14 @@ void InsetCaption::draw(BufferView * bv, LyXFont const & f,
|
||||
// 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");
|
||||
|
@ -342,12 +342,6 @@ bool InsetFloat::showInsetDialog(BufferView * bv) const
|
||||
}
|
||||
|
||||
|
||||
string const & InsetFloat::type() const
|
||||
{
|
||||
return params_.type;
|
||||
}
|
||||
|
||||
|
||||
void InsetFloat::wide(bool w, BufferParams const & bp)
|
||||
{
|
||||
params_.wide = w;
|
||||
@ -372,7 +366,7 @@ void InsetFloat::addToToc(toc::TocList & toclist, Buffer const * buf) const
|
||||
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);
|
||||
|
@ -70,8 +70,6 @@ public:
|
||||
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;
|
||||
|
13
src/text2.C
13
src/text2.C
@ -34,6 +34,7 @@
|
||||
|
||||
#include "insets/insetbibitem.h"
|
||||
#include "insets/insetfloat.h"
|
||||
#include "insets/insetwrap.h"
|
||||
|
||||
#include "support/LAssert.h"
|
||||
#include "support/textutils.h"
|
||||
@ -1173,8 +1174,16 @@ void LyXText::setCounter(Buffer const * buf, ParagraphList::iterator pit)
|
||||
}
|
||||
|
||||
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());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user