text += textObj->GetTextForRange(range);
}
else
- return true;
+ {
+ text += wxT(" ");
+ }
}
node = node->GetNext();
text = textObj->GetTextForRange(range) + text;
}
else
- return true;
+ {
+ text = wxT(" ") + text;
+ }
}
node = node->GetPrevious();
{
if (para && para->GetRange().GetEnd() == pos)
pos1 ++;
+
+ // Now see if we need to number the paragraph.
if (newPara->GetAttributes().HasBulletNumber())
- newPara->GetAttributes().SetBulletNumber(newPara->GetAttributes().GetBulletNumber()+1);
+ {
+ wxRichTextAttr numberingAttr;
+ if (FindNextParagraphNumber(para, numberingAttr))
+ wxRichTextApplyStyle(newPara->GetAttributes(), (const wxRichTextAttr&) numberingAttr);
+ }
}
action->SetPosition(pos);
}
}
}
+
+ // Also apply list style if present
+ if (lookUpNewParaStyle && !para->GetAttributes().GetListStyleName().IsEmpty() && GetStyleSheet())
+ {
+ wxRichTextListStyleDefinition* listDef = GetStyleSheet()->FindListStyle(para->GetAttributes().GetListStyleName());
+ if (listDef)
+ {
+ int thisIndent = para->GetAttributes().GetLeftIndent();
+ int thisLevel = para->GetAttributes().HasOutlineLevel() ? para->GetAttributes().GetOutlineLevel() : listDef->FindLevelForIndent(thisIndent);
+
+ // Apply the overall list style, and item style for this level
+ wxRichTextAttr listStyle(listDef->GetCombinedStyleForLevel(thisLevel, GetStyleSheet()));
+ wxRichTextApplyStyle(attr, listStyle);
+ attr.SetOutlineLevel(thisLevel);
+ if (para->GetAttributes().HasBulletNumber())
+ attr.SetBulletNumber(para->GetAttributes().GetBulletNumber());
+ }
+ }
+
if (!foundAttributes)
{
attr = para->GetAttributes();
attr.SetFlags(flags);
}
- // Now see if we need to number the paragraph.
- if (attr.HasBulletStyle())
- {
- wxTextAttr numberingAttr;
- if (FindNextParagraphNumber(para, numberingAttr))
- wxRichTextApplyStyle(attr, (const wxTextAttr&) numberingAttr);
- }
-
return attr;
}
else
if (action->GetNewParagraphs().GetChildCount() == 1)
action->GetNewParagraphs().SetPartialParagraph(true);
- action->SetPosition(position);
+ action->SetPosition(position+1);
// Set the range we'll need to delete in Undo
- action->SetRange(wxRichTextRange(position, position));
+ action->SetRange(wxRichTextRange(position+1, position+1));
SubmitAction(action);