--- story.cpp	2007-04-25 16:59:00.000000000 -0500
+++ story.cpp.nostylefix	2007-04-28 15:13:32.000000000 -0500
@@ -2434,7 +2434,7 @@
 	connect(Editor, SIGNAL(doubleClicked(int, int)), this, SLOT(doubleClick(int, int)));
 	connect(EditorBar, SIGNAL(ChangeStyle(int, int )), this, SLOT(changeAlignSB(int, int )));
 	connect(EditorBar, SIGNAL(sigEditStyles()), this, SLOT(slotEditStyles()));
-	connect(AlignTools, SIGNAL(newStyle(int)), this, SLOT(newAlign(int)));
+	connect(AlignTools, SIGNAL(newStyle(int)), this, SLOT(newParaStyle(int)));
 	connect(AlignTools, SIGNAL(NewAlign(int)), this, SLOT(newAlign(int)));
 	connect(FillTools, SIGNAL(NewColor(int, int)), this, SLOT(newTxFill(int, int)));
 	connect(StrokeTools, SIGNAL(NewColor(int, int)), this, SLOT(newTxStroke(int, int)));
@@ -2775,7 +2775,7 @@
 	Editor->setFocus();
 }
 
-void StoryEditor::updateProps(int p, int ch)
+void StoryEditor::updateProps(int p, int ch, bool preserveNoStyle)
 {
 	ColorList::Iterator it;
 	int c = 0;
@@ -2854,6 +2854,13 @@
 			//Moved to separate method to ensure consistency for #5484 - Michael Koren 2007-4-21
 			setEditorPropsFromStyle();
 		}
+		//Added to correctly update properties for empty unstyled paragraphs - Michael Koren 2007-4-26
+		//preserveNoStyle is set when changing alignment with no paragraph style to keep properties intact
+		else
+		{
+			if (!preserveNoStyle)
+				setEditorPropsFromFrame();
+		}
 		Editor->setAlign(Editor->currentParaStyle);
 		Editor->setStyle(Editor->CurrentStyle);
 	}
@@ -3284,8 +3291,21 @@
 	changeAlign(st);
 }
 
+//This is called when changing the style from the combobox, as opposed to the alignment buttons
+void StoryEditor::newParaStyle(int st)
+{
+	//If "No Style" was selected get default alignment from frame if there is one
+	if ((st < 5) && (currItem->textAlignment < 5))
+		st = currItem->textAlignment;
+	Editor->currentParaStyle = st;
+	changeAlign(st, true);
+}
+
 void StoryEditor::changeAlignSB(int pa, int align)
 {
+	//If "No Style" was selected get default alignment from frame if there is one
+	if ((align < 5) && (currItem->textAlignment < 5))
+		align = currItem->textAlignment;
 	Editor->currentParaStyle = align;
 	(*Editor->ParagStyles.at(pa)) = Editor->currentParaStyle;
 	if (Editor->StyledText.count() != 0)
@@ -3355,7 +3375,7 @@
 	Editor->setFocus();
 }
 
-void StoryEditor::changeAlign(int )
+void StoryEditor::changeAlign(int , bool isStyleChange)
 {
 	int p, i;
 	bool sel = false;
@@ -3382,6 +3402,10 @@
 			PStart = p;
 			PEnd = p;
 		}
+		//Avoid resetting current attributes for empty paragraphs when only changing alignment.
+		//The second part of the condition is because the alignment buttons can sometimes be active for styled
+		//paragraphs. The first part allows reselecting "No Style" to reset properties like for other styles.
+		bool preserveNoStyle = (isStyleChange || (*Editor->ParagStyles.at(p) > 4)) ? false : true;
 		for (int pa = PStart; pa < QMIN(PEnd+1, static_cast<int>(Editor->StyledText.count())); ++pa)
 		{
 			(*Editor->ParagStyles.at(pa)) = Editor->currentParaStyle;
@@ -3396,7 +3420,7 @@
 				else
 				{
 					//Moved to separate method to ensure consistency for #5484 - Michael Koren 2007-4-21
-					setParPropsFromFrame(pa);
+					setParPropsFromFrame(pa, !isStyleChange);
 				}
 			Editor->updateFromChars(pa);
 			}
@@ -3405,7 +3429,7 @@
 			Editor->setSelection(PStart2, SelStart2, PEnd2, SelEnd2);
 		Editor->setCursorPosition(p, i);
 		Editor->ensureCursorVisible();
-		updateProps(p, i);
+		updateProps(p, i, preserveNoStyle);
 		//Add this once here to replace the signal. modifiedText() is called below already  - Michael Koren #5577
 		EditorBar->doRepaint();
 		connect(Editor, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(updateProps(int, int)));
@@ -3523,12 +3547,14 @@
 }
 
 //Set text properties of a paragraph to frame defaults or change alignment
-void StoryEditor::setParPropsFromFrame(int pa)
+void StoryEditor::setParPropsFromFrame(int pa, bool preserveNoStyle)
 {
 	SEditor::ChList *chars = Editor->StyledText.at(pa);
 	for (uint s = 0; s < chars->count(); ++s)
 	{
-		if (chars->at(s)->cab > 4)
+		//Don't check the previous style unless preserveNoStyle is passed.
+		//Allows reselecting "No Style" to reset properties like for other styles.
+		if (!preserveNoStyle || (chars->at(s)->cab > 4))
 		{
 			chars->at(s)->ccolor = currItem->TxtFill;
 			chars->at(s)->cshade = currItem->ShTxtFill;
