From d28b89ba8085de06555509450197ec75edbcd3cf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 15 Aug 2003 15:20:50 +0000 Subject: [PATCH] add an additional full rebreak for 'resizeCurrentBuffer'. remove some #if 0 code from singleWidth rebreaking git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7558 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView_pimpl.C | 4 ++++ src/text.C | 24 +++++------------------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index e47e994ac5..c5281728fd 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -427,6 +427,10 @@ void BufferView::Pimpl::resizeCurrentBuffer() selendpar = bv_->text->ownerParagraphs().end(); } +#warning doesn't help much + bv_->text->redoParagraphs(bv_->text->ownerParagraphs().begin(), + bv_->text->ownerParagraphs().end()); + if (par != bv_->text->ownerParagraphs().end()) { bv_->text->selection.set(true); // At this point just to avoid the Delete-Empty-Paragraph- diff --git a/src/text.C b/src/text.C index 7d23d25667..22c020db0c 100644 --- a/src/text.C +++ b/src/text.C @@ -223,26 +223,12 @@ int LyXText::singleWidth(ParagraphList::iterator pit, if (c == Paragraph::META_INSET) { InsetOld * tmpinset = pit->getInset(pos); - if (tmpinset) { - if (tmpinset->lyxCode() == InsetOld::HFILL_CODE) { - // Because of the representation as vertical lines - return 3; - } -#if 0 -#warning enabling this fixes the 'insets of width 0 on load' problem - // this IS needed otherwise on initialitation we don't get the fill - // of the row right (ONLY on initialization if we read a file!) - // should be changed! (Jug 20011204) - //tmpinset->update(bv()); - Dimension dim; - MetricsInfo mi(bv(), font, workWidth()); - tmpinset->metrics(mi, dim); - return dim.wid; -#else - return tmpinset->width(); -#endif + Assert(tmpinset); + if (tmpinset->lyxCode() == InsetOld::HFILL_CODE) { + // Because of the representation as vertical lines + return 3; } - return 0; + return tmpinset->width(); } if (IsSeparatorChar(c)) -- 2.39.2