[haiku-commits] haiku: hrev52719 - src/apps/cortex/InfoView

  • From: Barrett17 <b.vitruvio@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 7 Jan 2019 07:23:55 -0500 (EST)

hrev52719 adds 1 changeset to branch 'master'
old head: ae09eb30c504a822368fc8a57c3020aefa674034
new head: 27a59a2fa4c3aae44e4a6a6d97973ad53df20cbe
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=27a59a2fa4c3+%5Eae09eb30c504

----------------------------------------------------------------------------

27a59a2fa4c3: cortex: Fix PVS 1206
  
  * Remove cast to void* in AddItem() at line 363, so that
  avoid that the object which was created using 'new' operator
  is immediately cast to another type.
  * Also remove other casts in AddItem().
  
  Change-Id: Ia20ab39ef50dce12b9d06ca5b1736a8a8e3e9cdd
  Reviewed-on: https://review.haiku-os.org/c/856
  Reviewed-by: Barrett17 <b.vitruvio@xxxxxxxxx>

                                      [ Murai Takashi <tmurai01@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev52719
Commit:      27a59a2fa4c3aae44e4a6a6d97973ad53df20cbe
URL:         https://git.haiku-os.org/haiku/commit/?id=27a59a2fa4c3
Author:      Murai Takashi <tmurai01@xxxxxxxxx>
Date:        Mon Jan  7 11:27:48 2019 UTC
Committer:   Barrett17 <b.vitruvio@xxxxxxxxx>
Commit-Date: Mon Jan  7 12:23:48 2019 UTC

----------------------------------------------------------------------------

1 file changed, 10 insertions(+), 11 deletions(-)
src/apps/cortex/InfoView/InfoView.cpp | 21 ++++++++++-----------

----------------------------------------------------------------------------

diff --git a/src/apps/cortex/InfoView/InfoView.cpp 
b/src/apps/cortex/InfoView/InfoView.cpp
index b1d9c77d57..bbc2a39a7e 100644
--- a/src/apps/cortex/InfoView/InfoView.cpp
+++ b/src/apps/cortex/InfoView/InfoView.cpp
@@ -292,7 +292,7 @@ void InfoView::FrameResized(
        for (int32 i = 0; i < m_fields->CountItems(); i++) {
                bool wrappingChanged = false;
                _InfoTextField *field = static_cast<_InfoTextField 
*>(m_fields->ItemAt(i));
-               field->updateLineWrapping(&wrappingChanged, 
+               field->updateLineWrapping(&wrappingChanged,
                                                                  heightChanged 
? 0 : &heightChanged);
                float fieldHeight = field->getHeight() + M_V_MARGIN;
                if (heightChanged) {
@@ -360,13 +360,12 @@ void InfoView::addField(
        BString text) {
        D_METHOD(("InfoView::addField()\n"));
 
-       m_fields->AddItem(reinterpret_cast<void *>
-                                         (new _InfoTextField(label, text, 
this)));
+       m_fields->AddItem(new _InfoTextField(label, text, this));
 }
 
 // -------------------------------------------------------- //
 // *** internal class: _InfoTextField
-// 
+//
 // *** ctor/dtor
 // -------------------------------------------------------- //
 
@@ -404,7 +403,7 @@ _InfoTextField::~_InfoTextField() {
 
 // -------------------------------------------------------- //
 // *** internal class: _InfoTextField
-// 
+//
 // *** operations (public)
 // -------------------------------------------------------- //
 
@@ -479,7 +478,7 @@ void _InfoTextField::updateLineWrapping(
                                        currentLine->Remove(i, 1);
                                        currentLine->MoveInto(*newLine, i,
                                                                                
  currentLine->CountChars() - i);
-                                       
m_textLines->AddItem(reinterpret_cast<void *>(currentLine));
+                                       m_textLines->AddItem(currentLine);
                                        currentLine = newLine;
                                        break;
                                }
@@ -488,7 +487,7 @@ void _InfoTextField::updateLineWrapping(
                        {
                                if (i == currentLine->CountChars() - 1) // the 
last char in the text
                                {
-                                       
m_textLines->AddItem(reinterpret_cast<void *>(currentLine));
+                                       m_textLines->AddItem(currentLine);
                                        currentLine = 0;
                                        break;
                                }
@@ -505,7 +504,7 @@ void _InfoTextField::updateLineWrapping(
                                                BString *newLine = new 
BString();
                                                currentLine->MoveInto(*newLine, 
lastBreak,
                                                                                
          currentLine->CountChars() - lastBreak);
-                                               
m_textLines->AddItem(reinterpret_cast<void *>(currentLine));    
+                                               
m_textLines->AddItem(currentLine);
                                                currentLine = newLine;
                                                break;
                                        }
@@ -539,7 +538,7 @@ void _InfoTextField::updateLineWrapping(
 
 // -------------------------------------------------------- //
 // *** internal class: _InfoTextField
-// 
+//
 // *** accessors (public)
 // -------------------------------------------------------- //
 
@@ -580,12 +579,12 @@ bool
 _InfoTextField::isWrapped() const {
        D_ACCESS(("_InfoTextField::isWrapped()\n"));
 
-       return (m_textLines->CountItems() > 1); 
+       return (m_textLines->CountItems() > 1);
 }
 
 // -------------------------------------------------------- //
 // *** internal class: _InfoTextField
-// 
+//
 // *** static internal methods (private)
 // -------------------------------------------------------- //
 


Other related posts:

  • » [haiku-commits] haiku: hrev52719 - src/apps/cortex/InfoView - Barrett17