From bd3f5d89f4638180a6adf9968849015365c11a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 31 Jul 2003 14:07:59 +0000 Subject: [PATCH] remove unneeded LyXText::workWidth(InsetOld const *) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7466 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 3 +++ src/lyxtext.h | 2 -- src/text.C | 44 -------------------------------------------- 3 files changed, 3 insertions(+), 46 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b6f2964323..f399b1ab58 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -8,6 +8,9 @@ * paragraph_funcs.C (moveItem): ... here. + * text.C: + lyxtext.h (LyXText::workWidth(InsetOld*)) remove. unused. + 2003-07-30 Martin Vermeer * LColor.[Ch]: Add comment and greyedout logical colors. diff --git a/src/lyxtext.h b/src/lyxtext.h index 978d59026b..83027e9c43 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -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; diff --git a/src/text.C b/src/text.C index 93dce36902..a4ad945e4b 100644 --- a/src/text.C +++ b/src/text.C @@ -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();