mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-05 13:26:21 +00:00
outerPar
"fix" loading problem git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7608 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
bf070fc876
commit
eaad9ff595
@ -1377,7 +1377,8 @@ void BufferView::Pimpl::updateInset()
|
||||
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();
|
||||
|
@ -1,4 +1,8 @@
|
||||
|
||||
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:
|
||||
|
@ -2190,6 +2190,7 @@ ParIterator Buffer::par_iterator_end()
|
||||
return ParIterator(paragraphs.end(), paragraphs);
|
||||
}
|
||||
|
||||
|
||||
ParConstIterator Buffer::par_iterator_begin() const
|
||||
{
|
||||
return ParConstIterator(const_cast<ParagraphList&>(paragraphs).begin(), paragraphs);
|
||||
|
@ -68,6 +68,8 @@ TODO
|
||||
#include "Lsstream.h"
|
||||
#include "lyxlex.h"
|
||||
#include "lyxrc.h"
|
||||
#include "paragraph_funcs.h"
|
||||
#include "lyxtext.h"
|
||||
|
||||
#include "frontends/Alert.h"
|
||||
#include "frontends/Dialogs.h"
|
||||
@ -168,8 +170,10 @@ InsetGraphics::~InsetGraphics()
|
||||
void InsetGraphics::statusChanged()
|
||||
{
|
||||
BufferView * bv = graphic_->view();
|
||||
if (bv)
|
||||
if (bv) {
|
||||
bv->text->redoParagraph(outerPar(*bv->buffer(), this));
|
||||
bv->updateInset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -247,7 +247,7 @@ void InsetText::metrics(MetricsInfo & mi, Dimension & dim) const
|
||||
|
||||
int InsetText::textWidth() const
|
||||
{
|
||||
return textwidth_;
|
||||
return textwidth_;
|
||||
}
|
||||
|
||||
|
||||
|
28
src/lyxrow.C
28
src/lyxrow.C
@ -38,24 +38,6 @@ Row::Row(pos_type pos)
|
||||
{}
|
||||
|
||||
|
||||
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;
|
||||
@ -92,12 +74,6 @@ int Row::fill() const
|
||||
}
|
||||
|
||||
|
||||
void Row::height(unsigned short h)
|
||||
{
|
||||
height_ = h;
|
||||
}
|
||||
|
||||
|
||||
void Row::width(unsigned int w)
|
||||
{
|
||||
width_ = w;
|
||||
@ -110,13 +86,13 @@ unsigned int Row::width() const
|
||||
}
|
||||
|
||||
|
||||
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_;
|
||||
}
|
||||
|
14
src/lyxrow.h
14
src/lyxrow.h
@ -37,17 +37,17 @@ public:
|
||||
///
|
||||
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);
|
||||
///
|
||||
@ -59,9 +59,9 @@ public:
|
||||
/// 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;
|
||||
///
|
||||
@ -89,7 +89,7 @@ private:
|
||||
Needed for hfills, flushright, block etc. */
|
||||
mutable int fill_;
|
||||
///
|
||||
unsigned short height_;
|
||||
unsigned int height_;
|
||||
///
|
||||
unsigned int width_;
|
||||
/// cached y position
|
||||
|
@ -66,7 +66,7 @@ using lyx::pos_type;
|
||||
|
||||
|
||||
Paragraph::Paragraph()
|
||||
: pimpl_(new Paragraph::Pimpl(this))
|
||||
: pimpl_(new Paragraph::Pimpl(this)), y(0)
|
||||
{
|
||||
enumdepth = 0;
|
||||
itemdepth = 0;
|
||||
@ -75,7 +75,7 @@ Paragraph::Paragraph()
|
||||
|
||||
|
||||
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;
|
||||
|
@ -303,6 +303,8 @@ public:
|
||||
|
||||
///
|
||||
mutable RowList rows;
|
||||
/// last draw y position (baseline of top row)
|
||||
int y;
|
||||
|
||||
private:
|
||||
///
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "Lsstream.h"
|
||||
|
||||
#include "support/lstrings.h"
|
||||
#include "support/LAssert.h"
|
||||
|
||||
#include "insets/insetoptarg.h"
|
||||
#include "insets/insetcommandparams.h"
|
||||
@ -1045,3 +1046,21 @@ LyXFont const outerFont(ParagraphList::iterator pit,
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@ class BufferParams;
|
||||
class TexRow;
|
||||
class LatexRunParams;
|
||||
class LyXLex;
|
||||
class InsetOld;
|
||||
|
||||
///
|
||||
void breakParagraph(BufferParams const & bparams,
|
||||
@ -74,4 +75,8 @@ int readParagraph(Buffer & buf, Paragraph & par, LyXLex & lex);
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user