]> git.lyx.org Git - features.git/commitdiff
Patch by Richard Heck:
authorJürgen Spitzmüller <spitz@lyx.org>
Wed, 11 Jul 2007 16:39:26 +0000 (16:39 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Wed, 11 Jul 2007 16:39:26 +0000 (16:39 +0000)
* src/Paragraph.cpp (applyLayout):
- do not reset everything unconditionally on paragraph layout change (fix bug 3939)

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

src/Paragraph.cpp

index 914ec5d85793c4939aa79a574cbe82681e60c07b..9fc822753c68f4bc66c985bd0f352f800732f8c5 100644 (file)
@@ -42,6 +42,7 @@
 #include "TexRow.h"
 #include "VSpace.h"
 
+#include "frontends/alert.h"
 #include "frontends/FontMetrics.h"
 
 #include "insets/InsetBibitem.h"
@@ -1652,9 +1653,15 @@ docstring Paragraph::expandLabel(Layout_ptr const & layout,
 void Paragraph::applyLayout(Layout_ptr const & new_layout)
 {
        layout(new_layout);
-       params().labelWidthString(docstring());
-       params().align(LYX_ALIGN_LAYOUT);
-       params().spacing(Spacing(Spacing::Default));
+       LyXAlignment const oldAlign = params().align();
+       // FIXME The first check is due to the fact that LYX_ALIGN_LAYOUT
+       // is not required to be possible. A fix is on the way.
+       if ((oldAlign != LYX_ALIGN_LAYOUT) && 
+           !(oldAlign & layout()->alignpossible)) {
+               frontend::Alert::warning(_("Alignment not permitted"), 
+                       _("The new layout does not permit the alignment previously used.\nSetting to default."));
+               params().align(LYX_ALIGN_LAYOUT);
+       }
 }