Fixed centering and right-justification when combined with left indentation (bug #10221).

Fixed wrapping problem for long lines (bug #10149).


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@57001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2008-11-28 15:52:52 +00:00
parent 225324fdb6
commit 4b08e76925
2 changed files with 5 additions and 3 deletions

View File

@@ -107,6 +107,8 @@ All (GUI):
before pressing Delete.
- Fixed inability to select no superscript and no subscript in wxRichTextCtrl's
formatting dialog.
- Fixed centering and right-justification when combined with left indentation.
- Fixed wrapping problem for long lines.
- Fixed wxHTML's pagebreaks computation in tables (D.J.Stauffer).
- Fixed wxHtmlWindow::SelectionToText() to correctly insert newlines after
single-cell paragraphs.

View File

@@ -4169,12 +4169,12 @@ void wxRichTextParagraph::ApplyParagraphStyle(const wxTextAttrEx& attr, const wx
// centering, right-justification
if (attr.HasAlignment() && GetAttributes().GetAlignment() == wxTEXT_ALIGNMENT_CENTRE)
{
pos.x = (rect.GetWidth() - size.x)/2 + pos.x;
pos.x = (rect.GetWidth() - (pos.x - rect.x) - size.x)/2 + pos.x;
line->SetPosition(pos);
}
else if (attr.HasAlignment() && GetAttributes().GetAlignment() == wxTEXT_ALIGNMENT_RIGHT)
{
pos.x = pos.x + rect.GetWidth() - size.x;
pos.x = rect.x + rect.GetWidth() - size.x;
line->SetPosition(pos);
}
@@ -4759,7 +4759,7 @@ bool wxRichTextParagraph::FindWrapPosition(const wxRichTextRange& range, wxDC& d
widthBefore = 0;
size_t i;
for (i = (size_t) range.GetStart(); i < (size_t) range.GetEnd(); i++)
for (i = (size_t) range.GetStart(); i <= (size_t) range.GetEnd(); i++)
{
int widthFromStartOfThisRange = g_GlobalPartialTextExtents[i - GetRange().GetStart()] - widthBefore;