X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8337ae1e4071eef441b39bc91cdb2391225f30f9..550d5748b138f7ab9939a0287b9f477564b7a893:/src/richtext/richtextbuffer.cpp diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index c0c9e9345f..946c96c1a7 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -4338,7 +4338,7 @@ bool wxRichTextParagraph::Layout(wxDC& dc, const wxRect& rect, int style) int lineSpacing = 0; // Let's assume line spacing of 10 is normal, 15 is 1.5, 20 is 2, etc. - if (attr.HasLineSpacing() && attr.GetLineSpacing() > 0 && attr.GetFont().Ok()) + if (attr.HasLineSpacing() && attr.GetLineSpacing() > 0 && attr.GetFont().IsOk()) { wxCheckSetFont(dc, attr.GetFont()); lineSpacing = (int) (double(dc.GetCharHeight()) * (double(attr.GetLineSpacing())/10.0 - 1.0)); @@ -5949,7 +5949,7 @@ bool wxRichTextPlainText::Draw(wxDC& dc, const wxRichTextRange& range, const wxR int charHeight = dc.GetCharHeight(); int x, y; - if ( textFont.Ok() ) + if ( textFont.IsOk() ) { if ( textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT) ) { @@ -6248,7 +6248,7 @@ bool wxRichTextPlainText::GetRangeSize(const wxRichTextRange& range, wxSize& siz bool bScript(false); wxFont font(GetBuffer()->GetFontTable().FindFont(textAttr)); - if (font.Ok()) + if (font.IsOk()) { if ( textAttr.HasTextEffects() && ( (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT) || (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUBSCRIPT) ) ) @@ -7792,7 +7792,7 @@ int wxRichTextBuffer::HitTest(wxDC& dc, const wxPoint& pt, long& textPosition, w bool wxRichTextStdRenderer::DrawStandardBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxRichTextAttr& bulletAttr, const wxRect& rect) { - if (bulletAttr.GetTextColour().Ok()) + if (bulletAttr.GetTextColour().IsOk()) { wxCheckSetPen(dc, wxPen(bulletAttr.GetTextColour())); wxCheckSetBrush(dc, wxBrush(bulletAttr.GetTextColour())); @@ -7892,7 +7892,7 @@ bool wxRichTextStdRenderer::DrawTextBullet(wxRichTextParagraph* paragraph, wxDC& wxCheckSetFont(dc, font); - if (attr.GetTextColour().Ok()) + if (attr.GetTextColour().IsOk()) dc.SetTextForeground(attr.GetTextColour()); dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT); @@ -10153,7 +10153,7 @@ IMPLEMENT_CLASS(wxRichTextFileHandler, wxObject) bool wxRichTextFileHandler::LoadFile(wxRichTextBuffer *buffer, const wxString& filename) { wxFFileInputStream stream(filename); - if (stream.Ok()) + if (stream.IsOk()) return LoadFile(buffer, stream); return false; @@ -10162,7 +10162,7 @@ bool wxRichTextFileHandler::LoadFile(wxRichTextBuffer *buffer, const wxString& f bool wxRichTextFileHandler::SaveFile(wxRichTextBuffer *buffer, const wxString& filename) { wxFFileOutputStream stream(filename); - if (stream.Ok()) + if (stream.IsOk()) return SaveFile(buffer, stream); return false; @@ -10421,8 +10421,8 @@ bool wxRichTextImageBlock::WriteHex(wxOutputStream& stream) return true; int bufSize = 100000; - if (int(m_dataSize+1) < bufSize) - bufSize = m_dataSize; + if (int(2*m_dataSize) < bufSize) + bufSize = 2*m_dataSize; char* buf = new char[bufSize+1]; int left = m_dataSize; @@ -10496,7 +10496,7 @@ unsigned char* wxRichTextImageBlock::ReadBlock(wxInputStream& stream, size_t siz unsigned char* wxRichTextImageBlock::ReadBlock(const wxString& filename, size_t size) { wxFileInputStream stream(filename); - if (!stream.Ok()) + if (!stream.IsOk()) return NULL; return ReadBlock(stream, size); @@ -10514,7 +10514,7 @@ bool wxRichTextImageBlock::WriteBlock(wxOutputStream& stream, unsigned char* blo bool wxRichTextImageBlock::WriteBlock(const wxString& filename, unsigned char* block, size_t size) { wxFileOutputStream outStream(filename); - if (!outStream.Ok()) + if (!outStream.IsOk()) return false; return WriteBlock(outStream, block, size);