return;
// this should not be needed, but it is...
- bv_->text->redoParagraph(bv_->text->cursor.par());
+ //bv_->text->redoParagraph(bv_->text->cursor.par());
+ //bv_->text->fullRebreak();
update();
updateScrollbar();
+2003-08-26 André Pönitz <poenitz@gmx.net>
+
+ * paragraph_func.[Ch] (outerPar): new function
+
2003-08-25 Martin Vermeer <martin.vermeer@hut.fi>
* lyxrow_funcs.C:
return ParIterator(paragraphs.end(), paragraphs);
}
+
ParConstIterator Buffer::par_iterator_begin() const
{
return ParConstIterator(const_cast<ParagraphList&>(paragraphs).begin(), paragraphs);
#include "Lsstream.h"
#include "lyxlex.h"
#include "lyxrc.h"
+#include "paragraph_funcs.h"
+#include "lyxtext.h"
#include "frontends/Alert.h"
#include "frontends/Dialogs.h"
void InsetGraphics::statusChanged()
{
BufferView * bv = graphic_->view();
- if (bv)
+ if (bv) {
+ bv->text->redoParagraph(outerPar(*bv->buffer(), this));
bv->updateInset();
+ }
}
int InsetText::textWidth() const
{
- return textwidth_;
+ return textwidth_;
}
{}
-void Row::y(unsigned int newy)
-{
- y_ = newy;
-}
-
-
-unsigned int Row::y() const
-{
- return y_;
-}
-
-
-unsigned short Row::height() const
-{
- return height_;
-}
-
-
void Row::pos(pos_type p)
{
pos_ = p;
}
-void Row::height(unsigned short h)
-{
- height_ = h;
-}
-
-
void Row::width(unsigned int w)
{
width_ = w;
}
-void Row::ascent_of_text(unsigned short a)
+void Row::ascent_of_text(unsigned int a)
{
ascent_of_text_ = a;
}
-unsigned short Row::ascent_of_text() const
+unsigned int Row::ascent_of_text() const
{
return ascent_of_text_;
}
///
int fill() const;
///
- void height(unsigned short h);
+ void height(unsigned int h) { height_ = h; }
///
- unsigned short height() const;
+ unsigned int height() const { return height_; }
///
void width(unsigned int w);
///
unsigned int width() const;
///
- void ascent_of_text(unsigned short a);
+ void ascent_of_text(unsigned int a);
///
- unsigned short ascent_of_text() const;
+ unsigned int ascent_of_text() const;
///
void top_of_text(unsigned int top);
///
/// return true if this row is the start of a paragraph
bool isParStart() const;
/// return the cached y position
- unsigned int y() const;
+ unsigned int y() const { return y_; }
/// cache the y position
- void y(unsigned int newy);
+ void y(unsigned int newy) { y_ = newy; }
///
float x() const;
///
Needed for hfills, flushright, block etc. */
mutable int fill_;
///
- unsigned short height_;
+ unsigned int height_;
///
unsigned int width_;
/// cached y position
Paragraph::Paragraph()
- : pimpl_(new Paragraph::Pimpl(this))
+ : pimpl_(new Paragraph::Pimpl(this)), y(0)
{
enumdepth = 0;
itemdepth = 0;
Paragraph::Paragraph(Paragraph const & lp)
- : pimpl_(new Paragraph::Pimpl(*lp.pimpl_, this))
+ : pimpl_(new Paragraph::Pimpl(*lp.pimpl_, this)), y(0)
{
enumdepth = 0;
itemdepth = 0;
///
mutable RowList rows;
+ /// last draw y position (baseline of top row)
+ int y;
private:
///
#include "Lsstream.h"
#include "support/lstrings.h"
+#include "support/LAssert.h"
#include "insets/insetoptarg.h"
#include "insets/insetcommandparams.h"
return tmpfont;
}
+
+
+ParagraphList::iterator outerPar(Buffer & buf, InsetOld * inset)
+{
+ ParIterator pit = buf.par_iterator_begin();
+ ParIterator end = buf.par_iterator_end();
+ for ( ; pit != end; ++pit) {
+ InsetList::iterator ii = pit->insetlist.begin();
+ InsetList::iterator iend = pit->insetlist.end();
+ for ( ; ii != iend; ++ii)
+ if (ii->inset == inset)
+ return pit.outerPar();
+ }
+ lyxerr << "outerPar: should not happen\n";
+ Assert(false);
+ return end.pit(); // shut up compiler
+}
+
class TexRow;
class LatexRunParams;
class LyXLex;
+class InsetOld;
///
void breakParagraph(BufferParams const & bparams,
LyXFont const outerFont(ParagraphList::iterator pit,
ParagraphList const & plist);
+/// find outermost paragraph containing an inset
+ParagraphList::iterator outerPar(Buffer & buf, InsetOld * inset);
+
+
#endif // PARAGRAPH_FUNCS_H