From e191ee875133b476d005f2b35eec43e8281dbac2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Thu, 20 Oct 2005 14:40:47 +0000 Subject: [PATCH] Warning fixes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35956 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextbuffer.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index e5fa616f93..cf57ce9b69 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -1502,7 +1502,7 @@ bool wxRichTextParagraphLayoutBox::SetStyle(const wxRichTextRange& range, const { // We'll be using a copy of the paragraph to make style changes, // not updating the buffer directly. - wxRichTextParagraph* newPara = NULL; + wxRichTextParagraph* newPara wxDUMMY_INITIALIZE(NULL); if (haveControl && withUndo) { @@ -1527,8 +1527,8 @@ bool wxRichTextParagraphLayoutBox::SetStyle(const wxRichTextRange& range, const // we can start applying a different style. // TODO: check that the style actually changes or is different // from style outside of range - wxRichTextObject* firstObject = NULL; - wxRichTextObject* lastObject = NULL; + wxRichTextObject* firstObject wxDUMMY_INITIALIZE(NULL); + wxRichTextObject* lastObject wxDUMMY_INITIALIZE(NULL); if (childRange.GetStart() == newPara->GetRange().GetStart()) firstObject = newPara->GetChildren().GetFirst()->GetData(); @@ -1596,11 +1596,13 @@ bool wxRichTextParagraphLayoutBox::SetStyle(const wxRichTextRange& range, const /// Get the text attributes for this position. bool wxRichTextParagraphLayoutBox::GetStyle(long position, wxTextAttrEx& style) const { - wxRichTextObject* obj = NULL; + wxRichTextObject* obj wxDUMMY_INITIALIZE(NULL); + if (style.IsParagraphStyle()) obj = GetParagraphAtPosition(position); else obj = GetLeafObjectAtPosition(position); + if (obj) { style = obj->GetAttributes(); @@ -1613,11 +1615,13 @@ bool wxRichTextParagraphLayoutBox::GetStyle(long position, wxTextAttrEx& style) /// Get the text attributes for this position. bool wxRichTextParagraphLayoutBox::GetStyle(long position, wxRichTextAttr& style) const { - wxRichTextObject* obj = NULL; + wxRichTextObject* obj wxDUMMY_INITIALIZE(NULL); + if (style.IsParagraphStyle()) obj = GetParagraphAtPosition(position); else obj = GetLeafObjectAtPosition(position); + if (obj) { style = obj->GetAttributes(); @@ -1869,7 +1873,7 @@ bool wxRichTextParagraph::Draw(wxDC& dc, const wxRichTextRange& WXUNUSED(range), wxRichTextLine* line = m_cachedLines.GetFirst() ? (wxRichTextLine* ) m_cachedLines.GetFirst()->GetData() : (wxRichTextLine*) NULL; wxPoint linePos; - int lineHeight = 0; + int lineHeight wxDUMMY_INITIALIZE(0); if (line) { lineHeight = line->GetSize().y; @@ -4849,12 +4853,11 @@ bool wxRichTextPlainTextHandler::DoLoadFile(wxRichTextBuffer *buffer, wxInputStr return false; wxString str; - int ch = 0; int lastCh = 0; while (!stream.Eof()) { - ch = stream.GetC(); + int ch = stream.GetC(); if (ch == 10 && lastCh != 13) str += wxT('\n'); -- 2.45.2