]> git.lyx.org Git - features.git/commitdiff
Fix for bug 3027 by Martin V.
authorAbdelrazak Younes <younes@lyx.org>
Sun, 17 Dec 2006 10:11:28 +0000 (10:11 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sun, 17 Dec 2006 10:11:28 +0000 (10:11 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16309 a592a061-630c-0410-9148-cb99ea01b6c8

src/paragraph.C
src/paragraph.h
src/rowpainter.C

index b030b7ff8fe796e6fb84c52a5f9326256510faa7..9aab8c122d92c5f2f11723d9fefc472d7592815d 100644 (file)
@@ -601,7 +601,10 @@ depth_type Paragraph::getMaxDepthAfter() const
 
 char Paragraph::getAlign() const
 {
-       return params().align();
+       if (params().align() == LYX_ALIGN_LAYOUT)
+               return layout()->align;
+       else
+               return params().align();
 }
 
 
index 7bf747527b8202cad7475e5d78a70dcde80137a9..951a9d537d47befa48aade5eeda55ddc1c0b8eca 100644 (file)
@@ -241,7 +241,7 @@ public:
        docstring const getLabelWidthString() const;
        ///
        void setLabelWidthString(docstring const & s);
-       ///
+       /// Actual paragraph alignment used
        char getAlign() const;
        /// The nesting depth of a paragraph
        depth_type getDepth() const;
index 5b83338af96882b38422430198f471fa20605688..eee68028b4ce91f319bcb59f0f9f0b9cbf648f14 100644 (file)
@@ -893,6 +893,9 @@ void paintPar
                bool cursor_on_row = CursorOnRow(pi, pit, rit, text);
                bool in_inset_alone_on_row = innerCursorOnRow(pi, pit, rit,
                        text);
+               bool leftEdgeFixed = 
+                       (par.getAlign() == LYX_ALIGN_LEFT ||
+                        par.getAlign() == LYX_ALIGN_BLOCK);
 
                // If this is the only object on the row, we can make it wide
                //
@@ -905,7 +908,7 @@ void paintPar
                        if (in) {
                                InsetText * t = const_cast<InsetText *>(in->asTextInset());
                                if (t)
-                                       t->setWide(in_inset_alone_on_row);
+                                       t->setWide(in_inset_alone_on_row && leftEdgeFixed);
                        }
                }
 
@@ -924,7 +927,8 @@ void paintPar
                        // Clear background of this row
                        // (if paragraph background was not cleared)
                        if (!repaintAll &&
-                           (!in_inset_alone_on_row || row_has_changed)) {
+                           (!(in_inset_alone_on_row && leftEdgeFixed) 
+                               || row_has_changed)) {
                                pi.pain.fillRectangle(x, y - rit->ascent(),
                                    text.maxwidth_, rit->height(),
                                    text.backgroundColor());