| Attached Files | story.cpp.patch2_loopinvert.1338.diff [^] (5,369 bytes) 07-Apr-26 02:51 [Show Content] [Hide Content]--- story.cpp 2007-04-23 16:18:26.000000000 -0500
+++ story.cpp.loopinvert.cpp 2007-04-24 16:27:23.000000000 -0500
@@ -3346,9 +3346,9 @@
if (Editor->StyledText.at(pa)->count() > 0)
{
chars = Editor->StyledText.at(pa);
- for (uint s = 0; s < chars->count(); ++s)
+ if (Editor->currentParaStyle > 4)
{
- if (Editor->currentParaStyle > 4)
+ for (uint s = 0; s < chars->count(); ++s)
{
if (!currDoc->docParagraphStyles[Editor->currentParaStyle].Font.isEmpty())
{
@@ -3368,26 +3368,33 @@
chars->at(s)->cstrikepos = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikePos;
chars->at(s)->cstrikewidth = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikeWidth;
}
+ chars->at(s)->cab = Editor->currentParaStyle;
}
- if ((Editor->currentParaStyle < 5) && (chars->at(s)->cab > 4))
+ }
+ else
+ {
+ for (uint s = 0; s < chars->count(); ++s)
{
- chars->at(s)->ccolor = currItem->TxtFill;
- chars->at(s)->cshade = currItem->ShTxtFill;
- chars->at(s)->cstroke = currItem->TxtStroke;
- chars->at(s)->cshade2 = currItem->ShTxtStroke;
- chars->at(s)->cfont = currItem->font();
- chars->at(s)->csize = currItem->fontSize();
- chars->at(s)->cstyle &= ~1919;
- chars->at(s)->cstyle |= currItem->TxTStyle;
- chars->at(s)->cshadowx = currItem->TxtShadowX;
- chars->at(s)->cshadowy = currItem->TxtShadowY;
- chars->at(s)->coutline = currItem->TxtOutline;
- chars->at(s)->cunderpos = currItem->TxtUnderPos;
- chars->at(s)->cunderwidth = currItem->TxtUnderWidth;
- chars->at(s)->cstrikepos = currItem->TxtStrikePos;
- chars->at(s)->cstrikewidth = currItem->TxtStrikeWidth;
+ if (chars->at(s)->cab > 4)
+ {
+ chars->at(s)->ccolor = currItem->TxtFill;
+ chars->at(s)->cshade = currItem->ShTxtFill;
+ chars->at(s)->cstroke = currItem->TxtStroke;
+ chars->at(s)->cshade2 = currItem->ShTxtStroke;
+ chars->at(s)->cfont = currItem->font();
+ chars->at(s)->csize = currItem->fontSize();
+ chars->at(s)->cstyle &= ~1919;
+ chars->at(s)->cstyle |= currItem->TxTStyle;
+ chars->at(s)->cshadowx = currItem->TxtShadowX;
+ chars->at(s)->cshadowy = currItem->TxtShadowY;
+ chars->at(s)->coutline = currItem->TxtOutline;
+ chars->at(s)->cunderpos = currItem->TxtUnderPos;
+ chars->at(s)->cunderwidth = currItem->TxtUnderWidth;
+ chars->at(s)->cstrikepos = currItem->TxtStrikePos;
+ chars->at(s)->cstrikewidth = currItem->TxtStrikeWidth;
+ }
+ chars->at(s)->cab = Editor->currentParaStyle;
}
- chars->at(s)->cab = Editor->currentParaStyle;
}
Editor->updateFromChars(pa);
}
@@ -3498,9 +3505,9 @@
if (Editor->StyledText.at(pa)->count() > 0)
{
chars = Editor->StyledText.at(pa);
- for (uint s = 0; s < chars->count(); ++s)
+ if (Editor->currentParaStyle > 4)
{
- if (Editor->currentParaStyle > 4)
+ for (uint s = 0; s < chars->count(); ++s)
{
if (!currDoc->docParagraphStyles[Editor->currentParaStyle].Font.isEmpty())
{
@@ -3520,26 +3527,33 @@
chars->at(s)->cstrikepos = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikePos;
chars->at(s)->cstrikewidth = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikeWidth;
}
+ chars->at(s)->cab = Editor->currentParaStyle;
}
- if ((Editor->currentParaStyle < 5) && (chars->at(s)->cab > 4))
+ }
+ else
+ {
+ for (uint s = 0; s < chars->count(); ++s)
{
- chars->at(s)->ccolor = currItem->TxtFill;
- chars->at(s)->cshade = currItem->ShTxtFill;
- chars->at(s)->cstroke = currItem->TxtStroke;
- chars->at(s)->cshade2 = currItem->ShTxtStroke;
- chars->at(s)->cfont = currItem->font();
- chars->at(s)->csize = currItem->fontSize();
- chars->at(s)->cstyle &= ~1919;
- chars->at(s)->cstyle |= currItem->TxTStyle;
- chars->at(s)->cshadowx = currItem->TxtShadowX;
- chars->at(s)->cshadowy = currItem->TxtShadowY;
- chars->at(s)->coutline = currItem->TxtOutline;
- chars->at(s)->cunderpos = currItem->TxtUnderPos;
- chars->at(s)->cunderwidth = currItem->TxtUnderWidth;
- chars->at(s)->cstrikepos = currItem->TxtStrikePos;
- chars->at(s)->cstrikewidth = currItem->TxtStrikeWidth;
+ if (chars->at(s)->cab > 4)
+ {
+ chars->at(s)->ccolor = currItem->TxtFill;
+ chars->at(s)->cshade = currItem->ShTxtFill;
+ chars->at(s)->cstroke = currItem->TxtStroke;
+ chars->at(s)->cshade2 = currItem->ShTxtStroke;
+ chars->at(s)->cfont = currItem->font();
+ chars->at(s)->csize = currItem->fontSize();
+ chars->at(s)->cstyle &= ~1919;
+ chars->at(s)->cstyle |= currItem->TxTStyle;
+ chars->at(s)->cshadowx = currItem->TxtShadowX;
+ chars->at(s)->cshadowy = currItem->TxtShadowY;
+ chars->at(s)->coutline = currItem->TxtOutline;
+ chars->at(s)->cunderpos = currItem->TxtUnderPos;
+ chars->at(s)->cunderwidth = currItem->TxtUnderWidth;
+ chars->at(s)->cstrikepos = currItem->TxtStrikePos;
+ chars->at(s)->cstrikewidth = currItem->TxtStrikeWidth;
+ }
+ chars->at(s)->cab = Editor->currentParaStyle;
}
- chars->at(s)->cab = Editor->currentParaStyle;
}
Editor->updateFromChars(pa);
}
story.cpp.patch3_consolidate.1338.diff [^] (23,099 bytes) 07-Apr-26 02:51 [Show Content] [Hide Content]--- story.cpp 2007-04-24 16:27:23.000000000 -0500
+++ story.cpp.consolidate.cpp 2007-04-24 20:27:51.000000000 -0500
@@ -2787,26 +2787,9 @@
{
if (!firstSet)
{
- Editor->CurrTextFill = currItem->TxtFill;
- Editor->CurrTextFillSh = currItem->ShTxtFill;
- Editor->CurrTextStroke = currItem->TxtStroke;
- Editor->CurrTextStrokeSh = currItem->ShTxtStroke;
- Editor->prevFont = Editor->CurrFont;
- Editor->CurrFont = currItem->font();
- Editor->CurrFontSize = currItem->fontSize();
- Editor->CurrentStyle = currItem->TxTStyle;
Editor->currentParaStyle = currItem->textAlignment;
- Editor->CurrTextKern = currItem->ExtraV;
- Editor->CurrTextScale = currItem->TxtScale;
- Editor->CurrTextScaleV = currItem->TxtScaleV;
- Editor->CurrTextBase = currItem->TxtBase;
- Editor->CurrTextShadowX = currItem->TxtShadowX;
- Editor->CurrTextShadowY = currItem->TxtShadowY;
- Editor->CurrTextOutline = currItem->TxtOutline;
- Editor->CurrTextUnderPos = currItem->TxtUnderPos;
- Editor->CurrTextUnderWidth = currItem->TxtUnderWidth;
- Editor->CurrTextStrikePos = currItem->TxtStrikePos;
- Editor->CurrTextStrikeWidth = currItem->TxtStrikeWidth;
+ //Moved to separate method to ensure consistency for #5484 - Michael Koren 2007-4-21
+ setEditorPropsFromFrame();
c = 0;
StrokeTools->SetShade(currItem->ShTxtStroke);
FillTools->SetShade(currItem->ShTxtFill);
@@ -2868,21 +2851,8 @@
{
if (Editor->currentParaStyle > 4)
{
- Editor->prevFont = Editor->CurrFont;
- Editor->CurrFont = currDoc->docParagraphStyles[Editor->currentParaStyle].Font;
- Editor->CurrFontSize = currDoc->docParagraphStyles[Editor->currentParaStyle].FontSize;
- Editor->CurrentStyle = currDoc->docParagraphStyles[Editor->currentParaStyle].FontEffect;
- Editor->CurrTextFill = currDoc->docParagraphStyles[Editor->currentParaStyle].FColor;
- Editor->CurrTextFillSh = currDoc->docParagraphStyles[Editor->currentParaStyle].FShade;
- Editor->CurrTextStroke = currDoc->docParagraphStyles[Editor->currentParaStyle].SColor;
- Editor->CurrTextStrokeSh = currDoc->docParagraphStyles[Editor->currentParaStyle].SShade;
- Editor->CurrTextShadowX = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowX;
- Editor->CurrTextShadowY = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowY;
- Editor->CurrTextOutline = currDoc->docParagraphStyles[Editor->currentParaStyle].txtOutline;
- Editor->CurrTextUnderPos = currDoc->docParagraphStyles[Editor->currentParaStyle].txtUnderPos;
- Editor->CurrTextUnderWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].txtUnderWidth;
- Editor->CurrTextStrikePos = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikePos;
- Editor->CurrTextStrikeWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikeWidth;
+ //Moved to separate method to ensure consistency for #5484 - Michael Koren 2007-4-21
+ setEditorPropsFromStyle();
}
Editor->setAlign(Editor->currentParaStyle);
Editor->setStyle(Editor->CurrentStyle);
@@ -2900,25 +2870,8 @@
}
else
hg = chars->at(QMIN(QMAX(ch-1, 0), static_cast<int>(chars->count())-1));
- Editor->CurrTextFill = hg->ccolor;
- Editor->CurrTextFillSh = hg->cshade;
- Editor->CurrTextStroke = hg->cstroke;
- Editor->CurrTextStrokeSh = hg->cshade2;
- Editor->prevFont = Editor->CurrFont;
- Editor->CurrFont = hg->cfont;
- Editor->CurrFontSize = hg->csize;
- Editor->CurrentStyle = hg->cstyle & 1919;
- Editor->CurrTextKern = hg->cextra;
- Editor->CurrTextScale = hg->cscale;
- Editor->CurrTextScaleV = hg->cscalev;
- Editor->CurrTextBase = hg->cbase;
- Editor->CurrTextShadowX = hg->cshadowx;
- Editor->CurrTextShadowY = hg->cshadowy;
- Editor->CurrTextOutline = hg->coutline;
- Editor->CurrTextUnderPos = hg->cunderpos;
- Editor->CurrTextUnderWidth = hg->cunderwidth;
- Editor->CurrTextStrikePos = hg->cstrikepos;
- Editor->CurrTextStrikeWidth = hg->cstrikewidth;
+ //Moved to separate method to ensure consistency for #5484 - Michael Koren 2007-4-21
+ setEditorPropsFromChar(hg);
}
StrokeTools->SetShade(Editor->CurrTextStrokeSh);
FillTools->SetShade(Editor->CurrTextFillSh);
@@ -3341,60 +3294,20 @@
//Disconnect these too as they otherwise run for every character - Michael Koren #5577
disconnect(Editor, SIGNAL(textChanged()), this, SLOT(modifiedText()));
disconnect(Editor, SIGNAL(textChanged()), EditorBar, SLOT(doRepaint()));
- SEditor::ChList *chars;
+ //SEditor::ChList *chars;
(*Editor->ParagStyles.at(pa)) = Editor->currentParaStyle;
if (Editor->StyledText.at(pa)->count() > 0)
{
- chars = Editor->StyledText.at(pa);
+ //chars = Editor->StyledText.at(pa);
if (Editor->currentParaStyle > 4)
{
- for (uint s = 0; s < chars->count(); ++s)
- {
- if (!currDoc->docParagraphStyles[Editor->currentParaStyle].Font.isEmpty())
- {
- chars->at(s)->cfont = currDoc->docParagraphStyles[Editor->currentParaStyle].Font;
- chars->at(s)->csize = currDoc->docParagraphStyles[Editor->currentParaStyle].FontSize;
- chars->at(s)->cstyle &= ~1919;
- chars->at(s)->cstyle |= currDoc->docParagraphStyles[Editor->currentParaStyle].FontEffect;
- chars->at(s)->ccolor = currDoc->docParagraphStyles[Editor->currentParaStyle].FColor;
- chars->at(s)->cshade = currDoc->docParagraphStyles[Editor->currentParaStyle].FShade;
- chars->at(s)->cstroke = currDoc->docParagraphStyles[Editor->currentParaStyle].SColor;
- chars->at(s)->cshade2 = currDoc->docParagraphStyles[Editor->currentParaStyle].SShade;
- chars->at(s)->cshadowx = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowX;
- chars->at(s)->cshadowy = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowY;
- chars->at(s)->coutline = currDoc->docParagraphStyles[Editor->currentParaStyle].txtOutline;
- chars->at(s)->cunderpos = currDoc->docParagraphStyles[Editor->currentParaStyle].txtUnderPos;
- chars->at(s)->cunderwidth = currDoc->docParagraphStyles[Editor->currentParaStyle].txtUnderWidth;
- chars->at(s)->cstrikepos = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikePos;
- chars->at(s)->cstrikewidth = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikeWidth;
- }
- chars->at(s)->cab = Editor->currentParaStyle;
- }
+ //Moved to separate method to ensure consistency for #5484 - Michael Koren 2007-4-21
+ setParPropsFromStyle(pa);
}
else
{
- for (uint s = 0; s < chars->count(); ++s)
- {
- if (chars->at(s)->cab > 4)
- {
- chars->at(s)->ccolor = currItem->TxtFill;
- chars->at(s)->cshade = currItem->ShTxtFill;
- chars->at(s)->cstroke = currItem->TxtStroke;
- chars->at(s)->cshade2 = currItem->ShTxtStroke;
- chars->at(s)->cfont = currItem->font();
- chars->at(s)->csize = currItem->fontSize();
- chars->at(s)->cstyle &= ~1919;
- chars->at(s)->cstyle |= currItem->TxTStyle;
- chars->at(s)->cshadowx = currItem->TxtShadowX;
- chars->at(s)->cshadowy = currItem->TxtShadowY;
- chars->at(s)->coutline = currItem->TxtOutline;
- chars->at(s)->cunderpos = currItem->TxtUnderPos;
- chars->at(s)->cunderwidth = currItem->TxtUnderWidth;
- chars->at(s)->cstrikepos = currItem->TxtStrikePos;
- chars->at(s)->cstrikewidth = currItem->TxtStrikeWidth;
- }
- chars->at(s)->cab = Editor->currentParaStyle;
- }
+ //Moved to separate method to ensure consistency for #5484 - Michael Koren 2007-4-21
+ setParPropsFromFrame(pa);
}
Editor->updateFromChars(pa);
}
@@ -3413,44 +3326,14 @@
{
if (!currDoc->docParagraphStyles[Editor->currentParaStyle].Font.isEmpty())
{
- Editor->prevFont = Editor->CurrFont;
- Editor->CurrFont = currDoc->docParagraphStyles[Editor->currentParaStyle].Font;
- Editor->CurrFontSize = currDoc->docParagraphStyles[Editor->currentParaStyle].FontSize;
- Editor->CurrentStyle = currDoc->docParagraphStyles[Editor->currentParaStyle].FontEffect;
- Editor->CurrTextFill = currDoc->docParagraphStyles[Editor->currentParaStyle].FColor;
- Editor->CurrTextFillSh = currDoc->docParagraphStyles[Editor->currentParaStyle].FShade;
- Editor->CurrTextStroke = currDoc->docParagraphStyles[Editor->currentParaStyle].SColor;
- Editor->CurrTextStrokeSh = currDoc->docParagraphStyles[Editor->currentParaStyle].SShade;
- Editor->CurrTextShadowX = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowX;
- Editor->CurrTextShadowY = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowY;
- Editor->CurrTextOutline = currDoc->docParagraphStyles[Editor->currentParaStyle].txtOutline;
- Editor->CurrTextUnderPos = currDoc->docParagraphStyles[Editor->currentParaStyle].txtUnderPos;
- Editor->CurrTextUnderWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].txtUnderWidth;
- Editor->CurrTextStrikePos = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikePos;
- Editor->CurrTextStrikeWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikeWidth;
+ //Moved to separate method to ensure consistency for #5484 - Michael Koren 2007-4-21
+ setEditorPropsFromStyle();
}
}
else
{
- Editor->CurrTextFill = currItem->TxtFill;
- Editor->CurrTextFillSh = currItem->ShTxtFill;
- Editor->CurrTextStroke = currItem->TxtStroke;
- Editor->CurrTextStrokeSh = currItem->ShTxtStroke;
- Editor->prevFont = Editor->CurrFont;
- Editor->CurrFont = currItem->font();
- Editor->CurrFontSize = currItem->fontSize();
- Editor->CurrentStyle = currItem->TxTStyle;
- Editor->CurrTextKern = currItem->ExtraV;
- Editor->CurrTextScale = currItem->TxtScale;
- Editor->CurrTextScaleV = currItem->TxtScaleV;
- Editor->CurrTextBase = currItem->TxtBase;
- Editor->CurrTextShadowX = currItem->TxtShadowX;
- Editor->CurrTextShadowY = currItem->TxtShadowY;
- Editor->CurrTextOutline = currItem->TxtOutline;
- Editor->CurrTextUnderPos = currItem->TxtUnderPos;
- Editor->CurrTextUnderWidth = currItem->TxtUnderWidth;
- Editor->CurrTextStrikePos = currItem->TxtStrikePos;
- Editor->CurrTextStrikeWidth = currItem->TxtStrikeWidth;
+ //Moved to separate method to ensure consistency for #5484 - Michael Koren 2007-4-21
+ setEditorPropsFromFrame();
}
Editor->setStyle(Editor->CurrentStyle);
if (Editor->CurrentStyle & 4)
@@ -3484,7 +3367,7 @@
disconnect(Editor, SIGNAL(textChanged()), this, SLOT(modifiedText()));
disconnect(Editor, SIGNAL(textChanged()), EditorBar, SLOT(doRepaint()));
int PStart, PEnd, SelStart, SelEnd, PStart2, PEnd2, SelStart2, SelEnd2;
- SEditor::ChList *chars;
+ //SEditor::ChList *chars;
if (Editor->hasSelectedText())
{
Editor->getSelection(&PStart, &SelStart, &PEnd, &SelEnd);
@@ -3504,56 +3387,16 @@
(*Editor->ParagStyles.at(pa)) = Editor->currentParaStyle;
if (Editor->StyledText.at(pa)->count() > 0)
{
- chars = Editor->StyledText.at(pa);
+ //chars = Editor->StyledText.at(pa);
if (Editor->currentParaStyle > 4)
{
- for (uint s = 0; s < chars->count(); ++s)
- {
- if (!currDoc->docParagraphStyles[Editor->currentParaStyle].Font.isEmpty())
- {
- chars->at(s)->cfont = currDoc->docParagraphStyles[Editor->currentParaStyle].Font;
- chars->at(s)->csize = currDoc->docParagraphStyles[Editor->currentParaStyle].FontSize;
- chars->at(s)->cstyle &= ~1919;
- chars->at(s)->cstyle |= currDoc->docParagraphStyles[Editor->currentParaStyle].FontEffect;
- chars->at(s)->ccolor = currDoc->docParagraphStyles[Editor->currentParaStyle].FColor;
- chars->at(s)->cshade = currDoc->docParagraphStyles[Editor->currentParaStyle].FShade;
- chars->at(s)->cstroke = currDoc->docParagraphStyles[Editor->currentParaStyle].SColor;
- chars->at(s)->cshade2 = currDoc->docParagraphStyles[Editor->currentParaStyle].SShade;
- chars->at(s)->cshadowx = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowX;
- chars->at(s)->cshadowy = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowY;
- chars->at(s)->coutline = currDoc->docParagraphStyles[Editor->currentParaStyle].txtOutline;
- chars->at(s)->cunderpos = currDoc->docParagraphStyles[Editor->currentParaStyle].txtUnderPos;
- chars->at(s)->cunderwidth = currDoc->docParagraphStyles[Editor->currentParaStyle].txtUnderWidth;
- chars->at(s)->cstrikepos = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikePos;
- chars->at(s)->cstrikewidth = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikeWidth;
- }
- chars->at(s)->cab = Editor->currentParaStyle;
- }
+ //Moved to separate method to ensure consistency for #5484 - Michael Koren 2007-4-21
+ setParPropsFromStyle(pa);
}
else
{
- for (uint s = 0; s < chars->count(); ++s)
- {
- if (chars->at(s)->cab > 4)
- {
- chars->at(s)->ccolor = currItem->TxtFill;
- chars->at(s)->cshade = currItem->ShTxtFill;
- chars->at(s)->cstroke = currItem->TxtStroke;
- chars->at(s)->cshade2 = currItem->ShTxtStroke;
- chars->at(s)->cfont = currItem->font();
- chars->at(s)->csize = currItem->fontSize();
- chars->at(s)->cstyle &= ~1919;
- chars->at(s)->cstyle |= currItem->TxTStyle;
- chars->at(s)->cshadowx = currItem->TxtShadowX;
- chars->at(s)->cshadowy = currItem->TxtShadowY;
- chars->at(s)->coutline = currItem->TxtOutline;
- chars->at(s)->cunderpos = currItem->TxtUnderPos;
- chars->at(s)->cunderwidth = currItem->TxtUnderWidth;
- chars->at(s)->cstrikepos = currItem->TxtStrikePos;
- chars->at(s)->cstrikewidth = currItem->TxtStrikeWidth;
- }
- chars->at(s)->cab = Editor->currentParaStyle;
- }
+ //Moved to separate method to ensure consistency for #5484 - Michael Koren 2007-4-21
+ setParPropsFromFrame(pa);
}
Editor->updateFromChars(pa);
}
@@ -3575,44 +3418,14 @@
{
if (!currDoc->docParagraphStyles[Editor->currentParaStyle].Font.isEmpty())
{
- Editor->prevFont = Editor->CurrFont;
- Editor->CurrFont = currDoc->docParagraphStyles[Editor->currentParaStyle].Font;
- Editor->CurrFontSize = currDoc->docParagraphStyles[Editor->currentParaStyle].FontSize;
- Editor->CurrentStyle = currDoc->docParagraphStyles[Editor->currentParaStyle].FontEffect;
- Editor->CurrTextFill = currDoc->docParagraphStyles[Editor->currentParaStyle].FColor;
- Editor->CurrTextFillSh = currDoc->docParagraphStyles[Editor->currentParaStyle].FShade;
- Editor->CurrTextStroke = currDoc->docParagraphStyles[Editor->currentParaStyle].SColor;
- Editor->CurrTextStrokeSh = currDoc->docParagraphStyles[Editor->currentParaStyle].SShade;
- Editor->CurrTextShadowX = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowX;
- Editor->CurrTextShadowY = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowY;
- Editor->CurrTextOutline = currDoc->docParagraphStyles[Editor->currentParaStyle].txtOutline;
- Editor->CurrTextUnderPos = currDoc->docParagraphStyles[Editor->currentParaStyle].txtUnderPos;
- Editor->CurrTextUnderWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].txtUnderWidth;
- Editor->CurrTextStrikePos = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikePos;
- Editor->CurrTextStrikeWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikeWidth;
+ //Moved to separate method to ensure consistency for #5484 - Michael Koren 2007-4-21
+ setEditorPropsFromStyle();
}
}
else
{
- Editor->CurrTextFill = currItem->TxtFill;
- Editor->CurrTextFillSh = currItem->ShTxtFill;
- Editor->CurrTextStroke = currItem->TxtStroke;
- Editor->CurrTextStrokeSh = currItem->ShTxtStroke;
- Editor->prevFont = Editor->CurrFont;
- Editor->CurrFont = currItem->font();
- Editor->CurrFontSize = currItem->fontSize();
- Editor->CurrentStyle = currItem->TxTStyle;
- Editor->CurrTextKern = currItem->ExtraV;
- Editor->CurrTextScale = currItem->TxtScale;
- Editor->CurrTextScaleV = currItem->TxtScaleV;
- Editor->CurrTextBase = currItem->TxtBase;
- Editor->CurrTextShadowX = currItem->TxtShadowX;
- Editor->CurrTextShadowY = currItem->TxtShadowY;
- Editor->CurrTextOutline = currItem->TxtOutline;
- Editor->CurrTextUnderPos = currItem->TxtUnderPos;
- Editor->CurrTextUnderWidth = currItem->TxtUnderWidth;
- Editor->CurrTextStrikePos = currItem->TxtStrikePos;
- Editor->CurrTextStrikeWidth = currItem->TxtStrikeWidth;
+ //Moved to separate method to ensure consistency for #5484 - Michael Koren 2007-4-21
+ setEditorPropsFromFrame();
}
Editor->setStyle(Editor->CurrentStyle);
if (Editor->CurrentStyle & 4)
@@ -3634,6 +3447,132 @@
Editor->setFocus();
}
+//Set current text properties to frame defaults
+//Note does not set currentParaStyle
+void StoryEditor::setEditorPropsFromFrame()
+{
+ Editor->CurrTextFill = currItem->TxtFill;
+ Editor->CurrTextFillSh = currItem->ShTxtFill;
+ Editor->CurrTextStroke = currItem->TxtStroke;
+ Editor->CurrTextStrokeSh = currItem->ShTxtStroke;
+ Editor->prevFont = Editor->CurrFont;
+ Editor->CurrFont = currItem->font();
+ Editor->CurrFontSize = currItem->fontSize();
+ Editor->CurrentStyle = currItem->TxTStyle;
+ Editor->CurrTextKern = currItem->ExtraV;
+ Editor->CurrTextScale = currItem->TxtScale;
+ Editor->CurrTextScaleV = currItem->TxtScaleV;
+ Editor->CurrTextBase = currItem->TxtBase;
+ Editor->CurrTextShadowX = currItem->TxtShadowX;
+ Editor->CurrTextShadowY = currItem->TxtShadowY;
+ Editor->CurrTextOutline = currItem->TxtOutline;
+ Editor->CurrTextUnderPos = currItem->TxtUnderPos;
+ Editor->CurrTextUnderWidth = currItem->TxtUnderWidth;
+ Editor->CurrTextStrikePos = currItem->TxtStrikePos;
+ Editor->CurrTextStrikeWidth = currItem->TxtStrikeWidth;
+}
+
+//Set current text properties from current paragraph style
+void StoryEditor::setEditorPropsFromStyle()
+{
+ Editor->prevFont = Editor->CurrFont;
+ Editor->CurrFont = currDoc->docParagraphStyles[Editor->currentParaStyle].Font;
+ Editor->CurrFontSize = currDoc->docParagraphStyles[Editor->currentParaStyle].FontSize;
+ Editor->CurrentStyle = currDoc->docParagraphStyles[Editor->currentParaStyle].FontEffect;
+ Editor->CurrTextFill = currDoc->docParagraphStyles[Editor->currentParaStyle].FColor;
+ Editor->CurrTextFillSh = currDoc->docParagraphStyles[Editor->currentParaStyle].FShade;
+ Editor->CurrTextStroke = currDoc->docParagraphStyles[Editor->currentParaStyle].SColor;
+ Editor->CurrTextStrokeSh = currDoc->docParagraphStyles[Editor->currentParaStyle].SShade;
+ Editor->CurrTextShadowX = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowX;
+ Editor->CurrTextShadowY = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowY;
+ Editor->CurrTextOutline = currDoc->docParagraphStyles[Editor->currentParaStyle].txtOutline;
+ Editor->CurrTextUnderPos = currDoc->docParagraphStyles[Editor->currentParaStyle].txtUnderPos;
+ Editor->CurrTextUnderWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].txtUnderWidth;
+ Editor->CurrTextStrikePos = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikePos;
+ Editor->CurrTextStrikeWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikeWidth;
+}
+
+//Set current text properties from a given character
+//Note does not set currentParaStyle
+void StoryEditor::setEditorPropsFromChar(struct PtiSmall *hg)
+{
+ Editor->CurrTextFill = hg->ccolor;
+ Editor->CurrTextFillSh = hg->cshade;
+ Editor->CurrTextStroke = hg->cstroke;
+ Editor->CurrTextStrokeSh = hg->cshade2;
+ Editor->prevFont = Editor->CurrFont;
+ Editor->CurrFont = hg->cfont;
+ Editor->CurrFontSize = hg->csize;
+ Editor->CurrentStyle = hg->cstyle & 1919;
+ Editor->CurrTextKern = hg->cextra;
+ Editor->CurrTextScale = hg->cscale;
+ Editor->CurrTextScaleV = hg->cscalev;
+ Editor->CurrTextBase = hg->cbase;
+ Editor->CurrTextShadowX = hg->cshadowx;
+ Editor->CurrTextShadowY = hg->cshadowy;
+ Editor->CurrTextOutline = hg->coutline;
+ Editor->CurrTextUnderPos = hg->cunderpos;
+ Editor->CurrTextUnderWidth = hg->cunderwidth;
+ Editor->CurrTextStrikePos = hg->cstrikepos;
+ Editor->CurrTextStrikeWidth = hg->cstrikewidth;
+}
+
+//Set text properties of a paragraph to frame defaults or change alignment
+void StoryEditor::setParPropsFromFrame(int pa)
+{
+ SEditor::ChList *chars = Editor->StyledText.at(pa);
+ for (uint s = 0; s < chars->count(); ++s)
+ {
+ if (chars->at(s)->cab > 4)
+ {
+ chars->at(s)->ccolor = currItem->TxtFill;
+ chars->at(s)->cshade = currItem->ShTxtFill;
+ chars->at(s)->cstroke = currItem->TxtStroke;
+ chars->at(s)->cshade2 = currItem->ShTxtStroke;
+ chars->at(s)->cfont = currItem->font();
+ chars->at(s)->csize = currItem->fontSize();
+ chars->at(s)->cstyle &= ~1919;
+ chars->at(s)->cstyle |= currItem->TxTStyle;
+ chars->at(s)->cshadowx = currItem->TxtShadowX;
+ chars->at(s)->cshadowy = currItem->TxtShadowY;
+ chars->at(s)->coutline = currItem->TxtOutline;
+ chars->at(s)->cunderpos = currItem->TxtUnderPos;
+ chars->at(s)->cunderwidth = currItem->TxtUnderWidth;
+ chars->at(s)->cstrikepos = currItem->TxtStrikePos;
+ chars->at(s)->cstrikewidth = currItem->TxtStrikeWidth;
+ }
+ chars->at(s)->cab = Editor->currentParaStyle;
+ }
+}
+
+//Set text properties of a paragraph from current paragraph style
+void StoryEditor::setParPropsFromStyle(int pa)
+{
+ SEditor::ChList *chars = Editor->StyledText.at(pa);
+ for (uint s = 0; s < chars->count(); ++s)
+ {
+ if (!currDoc->docParagraphStyles[Editor->currentParaStyle].Font.isEmpty())
+ {
+ chars->at(s)->cfont = currDoc->docParagraphStyles[Editor->currentParaStyle].Font;
+ chars->at(s)->csize = currDoc->docParagraphStyles[Editor->currentParaStyle].FontSize;
+ chars->at(s)->cstyle &= ~1919;
+ chars->at(s)->cstyle |= currDoc->docParagraphStyles[Editor->currentParaStyle].FontEffect;
+ chars->at(s)->ccolor = currDoc->docParagraphStyles[Editor->currentParaStyle].FColor;
+ chars->at(s)->cshade = currDoc->docParagraphStyles[Editor->currentParaStyle].FShade;
+ chars->at(s)->cstroke = currDoc->docParagraphStyles[Editor->currentParaStyle].SColor;
+ chars->at(s)->cshade2 = currDoc->docParagraphStyles[Editor->currentParaStyle].SShade;
+ chars->at(s)->cshadowx = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowX;
+ chars->at(s)->cshadowy = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowY;
+ chars->at(s)->coutline = currDoc->docParagraphStyles[Editor->currentParaStyle].txtOutline;
+ chars->at(s)->cunderpos = currDoc->docParagraphStyles[Editor->currentParaStyle].txtUnderPos;
+ chars->at(s)->cunderwidth = currDoc->docParagraphStyles[Editor->currentParaStyle].txtUnderWidth;
+ chars->at(s)->cstrikepos = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikePos;
+ chars->at(s)->cstrikewidth = currDoc->docParagraphStyles[Editor->currentParaStyle].txtStrikeWidth;
+ }
+ chars->at(s)->cab = Editor->currentParaStyle;
+ }
+}
+
void StoryEditor::modifiedText()
{
textChanged = true;
story.h.consolidate.1338.diff [^] (583 bytes) 07-Apr-26 02:52 [Show Content] [Hide Content]--- story.h 2007-01-26 17:06:08.000000000 -0600
+++ story.h.consolidate.h 2007-04-24 20:10:33.000000000 -0500
@@ -345,6 +345,13 @@
PageItem* currentItem() const;
ScribusDoc* currentDocument() const;
+ //Moved duplicate code to separate methods for consistency for #5484
+ void setEditorPropsFromFrame();
+ void setEditorPropsFromStyle();
+ void setEditorPropsFromChar(struct PtiSmall *hg);
+ void setParPropsFromFrame(int pa);
+ void setParPropsFromStyle(int pa);
+
/*! Enables/disables the "smart" selection (#1203) - 10/16/2004 pv */
bool smartSelection;
int smartSel;
story.cpp.patch4_attribfix.1338.diff [^] (2,672 bytes) 07-Apr-26 02:53 [Show Content] [Hide Content]--- story.cpp 2007-04-24 20:27:51.000000000 -0500
+++ story.cpp.attribfix 2007-04-25 16:59:00.000000000 -0500
@@ -3483,6 +3483,11 @@
Editor->CurrTextFillSh = currDoc->docParagraphStyles[Editor->currentParaStyle].FShade;
Editor->CurrTextStroke = currDoc->docParagraphStyles[Editor->currentParaStyle].SColor;
Editor->CurrTextStrokeSh = currDoc->docParagraphStyles[Editor->currentParaStyle].SShade;
+ //Added next four for #5484 - paragraph styles have these too - Michael Koren 2007-4-25
+ Editor->CurrTextKern = currDoc->docParagraphStyles[Editor->currentParaStyle].kernVal;
+ Editor->CurrTextScale = currDoc->docParagraphStyles[Editor->currentParaStyle].scaleH;
+ Editor->CurrTextScaleV = currDoc->docParagraphStyles[Editor->currentParaStyle].scaleV;
+ Editor->CurrTextBase = currDoc->docParagraphStyles[Editor->currentParaStyle].baseOff;
Editor->CurrTextShadowX = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowX;
Editor->CurrTextShadowY = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowY;
Editor->CurrTextOutline = currDoc->docParagraphStyles[Editor->currentParaStyle].txtOutline;
@@ -3533,6 +3538,11 @@
chars->at(s)->csize = currItem->fontSize();
chars->at(s)->cstyle &= ~1919;
chars->at(s)->cstyle |= currItem->TxTStyle;
+ //Added next four for #5484 - Michael Koren 2007-4-25
+ chars->at(s)->cextra = currItem->ExtraV;
+ chars->at(s)->cscale = currItem->TxtScale;
+ chars->at(s)->cscalev = currItem->TxtScaleV;
+ chars->at(s)->cbase = currItem->TxtBase;
chars->at(s)->cshadowx = currItem->TxtShadowX;
chars->at(s)->cshadowy = currItem->TxtShadowY;
chars->at(s)->coutline = currItem->TxtOutline;
@@ -3561,6 +3571,11 @@
chars->at(s)->cshade = currDoc->docParagraphStyles[Editor->currentParaStyle].FShade;
chars->at(s)->cstroke = currDoc->docParagraphStyles[Editor->currentParaStyle].SColor;
chars->at(s)->cshade2 = currDoc->docParagraphStyles[Editor->currentParaStyle].SShade;
+ //Added next four for #5484 - Michael Koren 2007-4-25
+ chars->at(s)->cextra = currDoc->docParagraphStyles[Editor->currentParaStyle].kernVal;
+ chars->at(s)->cscale = currDoc->docParagraphStyles[Editor->currentParaStyle].scaleH;
+ chars->at(s)->cscalev = currDoc->docParagraphStyles[Editor->currentParaStyle].scaleV;
+ chars->at(s)->cbase = currDoc->docParagraphStyles[Editor->currentParaStyle].baseOff;
chars->at(s)->cshadowx = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowX;
chars->at(s)->cshadowy = currDoc->docParagraphStyles[Editor->currentParaStyle].txtShadowY;
chars->at(s)->coutline = currDoc->docParagraphStyles[Editor->currentParaStyle].txtOutline;
|