remove unneeded LyXText::workWidth(InsetOld const *)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7466 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2003-07-31 14:07:59 +00:00
parent 42e43ec73d
commit bd3f5d89f4
3 changed files with 3 additions and 46 deletions

View File

@ -8,6 +8,9 @@
* paragraph_funcs.C (moveItem): ... here.
* text.C:
lyxtext.h (LyXText::workWidth(InsetOld*)) remove. unused.
2003-07-30 Martin Vermeer <martin.vermeer@hut.fi>
* LColor.[Ch]: Add comment and greyedout logical colors.

View File

@ -398,8 +398,6 @@ public:
void checkParagraph(ParagraphList::iterator pit, lyx::pos_type pos);
///
int workWidth() const;
/// returns width of row containing inset
int workWidth(InsetOld const * inset) const;
///
void computeBidiTables(Buffer const *, RowList::iterator row) const;

View File

@ -148,50 +148,6 @@ int LyXText::workWidth() const
}
int LyXText::workWidth(InsetOld const * inset) const
{
ParagraphList::iterator par = ownerParagraphs().begin();
ParagraphList::iterator end = ownerParagraphs().end();
for ( ; par != end; ++par)
if (&*par == inset->parOwner())
break;
if (par == ownerParagraphs().end()) {
lyxerr << "LyXText::workWidth: unexpected\n";
return -1;
}
pos_type pos = par->getPositionOfInset(inset);
Assert(pos != -1);
LyXLayout_ptr const & layout = par->layout();
if (layout->margintype != MARGIN_RIGHT_ADDRESS_BOX) {
// Optimization here: in most cases, the real row is
// not needed, but only the par/pos values. So we just
// construct a dummy row for leftMargin. (JMarc)
return workWidth() - leftMargin(Row(par, pos));
}
RowList::iterator row = getRow(par, pos);
RowList::iterator frow = row;
RowList::iterator beg = rowlist_.begin();
while (frow != beg && frow->par() == boost::prior(frow)->par())
--frow;
// FIXME: I don't understand this code - jbl
unsigned int maxw = 0;
while (!isParEnd(*this, frow)) {
if (frow != row && maxw < frow->width())
maxw = frow->width();
++frow;
}
return maxw ? maxw : workWidth();
}
int LyXText::getRealCursorX() const
{
int x = cursor.x();