wxSize actualSize;
wxRichTextRange actualRange(lastCompletedEndPos+1, wrapPosition);
+ /// Use previous descent, not the wrapping descent we just found, since this may be too big
+ /// for the fragment we're about to add.
+ childDescent = maxDescent;
+
#if wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS
// Get height only, then the width using the partial extents
GetRangeSize(actualRange, actualSize, childDescent, dc, wxRICHTEXT_UNFORMATTED|wxRICHTEXT_HEIGHT_ONLY);
{
int rightIndent = ConvertTenthsMMToPixels(dc, attr.GetRightIndent());
pos.x = (rect.GetWidth() - (pos.x - rect.x) - rightIndent - size.x)/2 + pos.x;
+ // Lines are relative to the paragraph position
+ pos.x -= GetPosition().x;
line->SetPosition(pos);
}
else if (attr.HasAlignment() && GetAttributes().GetAlignment() == wxTEXT_ALIGNMENT_RIGHT)
{
int rightIndent = ConvertTenthsMMToPixels(dc, attr.GetRightIndent());
pos.x = rect.x + rect.GetWidth() - size.x - rightIndent;
+ // Lines are relative to the paragraph position
+ pos.x -= GetPosition().x;
line->SetPosition(pos);
}
else if (!filename.IsEmpty())
{
wxString path, file, ext;
- wxSplitPath(filename, & path, & file, & ext);
+ wxFileName::SplitPath(filename, & path, & file, & ext);
return FindHandler(ext, imageType);
}
else
bool wxRichTextFileHandler::CanHandle(const wxString& filename) const
{
wxString path, file, ext;
- wxSplitPath(filename, & path, & file, & ext);
+ wxFileName::SplitPath(filename, & path, & file, & ext);
return (ext.Lower() == GetExtension());
}
if ((imageType != wxBITMAP_TYPE_JPEG) && convertToJPEG)
{
- wxString tempFile;
- bool success = wxGetTempFileName(_("image"), tempFile) ;
-
- wxASSERT(success);
+ wxString tempFile =
+ wxFileName::CreateTempFileName(_("image"));
- wxUnusedVar(success);
+ wxASSERT(!tempFile.IsEmpty());
image.SaveFile(tempFile, wxBITMAP_TYPE_JPEG);
filenameToRead = tempFile;
if (imageType == wxBITMAP_TYPE_INVALID)
return false; // Could not determine image type
- wxString tempFile;
- bool success = wxGetTempFileName(_("image"), tempFile) ;
-
- wxASSERT(success);
- wxUnusedVar(success);
+ wxString tempFile = wxFileName::CreateTempFileName(_("image")) ;
+ wxASSERT(!tempFile.IsEmpty());
if (!image.SaveFile(tempFile, m_imageType))
{
wxMemoryInputStream mstream(m_data, m_dataSize);
bool success = image.LoadFile(mstream, GetImageType());
#else
- wxString tempFile;
- bool success = wxGetTempFileName(_("image"), tempFile) ;
- wxASSERT(success);
+ wxString tempFile = wxFileName::CreateTempFileName(_("image"));
+ wxASSERT(!tempFile.IsEmpty());
if (!WriteBlock(tempFile, m_data, m_dataSize))
{