]> git.lyx.org Git - features.git/commitdiff
adjust some comments
authorAndré Pönitz <poenitz@gmx.net>
Fri, 1 Aug 2003 12:52:59 +0000 (12:52 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Fri, 1 Aug 2003 12:52:59 +0000 (12:52 +0000)
restrict code region covered by save/restoreLyXTextState

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7473 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/insettext.C

index 2bea9220ae9d503bc6e81261cefb19507fd7e3e0..0b21274b8e640df4b5474b04e012c53ba9f4c662 100644 (file)
@@ -79,17 +79,17 @@ using namespace bv_funcs;
 using lyx::pos_type;
 using lyx::textclass_type;
 
-// These functions should probably go into bufferview_funcs somehow (Jug)
+
+// we should get rid of these (Andre')
 
 void InsetText::saveLyXTextState() const
 {
        // check if my paragraphs are still valid
        ParagraphList::iterator it = const_cast<ParagraphList&>(paragraphs).begin();
        ParagraphList::iterator end = const_cast<ParagraphList&>(paragraphs).end();
-       for (; it != end; ++it) {
+       for (; it != end; ++it)
                if (it == text_.cursor.par())
                        break;
-       }
 
        if (it != end && text_.cursor.pos() <= it->size())
                sstate = text_; // slicing intended
@@ -159,7 +159,7 @@ void InsetText::init(InsetText const * ins)
                drawFrame_ = ins->drawFrame_;
                frame_color = ins->frame_color;
        } else {
-               textwidth_ = 0; // unbounded
+               textwidth_ = 0; // broken
                drawFrame_ = NEVER;
                frame_color = LColor::insetframe;
                autoBreakRows = false;
@@ -1922,14 +1922,8 @@ void InsetText::deleteLyXText(BufferView * bv, bool recursive) const
 
 void InsetText::resizeLyXText(BufferView * bv, bool /*force*/) const
 {
-       if (paragraphs.size() == 1 && paragraphs.begin()->empty()) {
-               // no data, resize not neccessary!
-               // we have to do this as a fixed width may have changed!
-               saveLyXTextState();
-               text_.init(bv);
-               restoreLyXTextState();
+       if (paragraphs.size() == 1 && paragraphs.begin()->empty())
                return;
-       }
 
        if (!bv)
                return;
@@ -1937,12 +1931,11 @@ void InsetText::resizeLyXText(BufferView * bv, bool /*force*/) const
        Assert(bv);
        setViewCache(bv);
 
-       saveLyXTextState();
-
        for_each(const_cast<ParagraphList&>(paragraphs).begin(),
                 const_cast<ParagraphList&>(paragraphs).end(),
                 boost::bind(&Paragraph::resizeInsetsLyXText, _1, bv));
 
+       saveLyXTextState();
        text_.init(bv);
        restoreLyXTextState();