]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/sizer.cpp
wxListCtrl::InsertItem() returned wrong index.
[wxWidgets.git] / src / common / sizer.cpp
index 0802fea03948f0cbaf1d9741d0da49ea786938f8..a41263744895ad26306f145f00f30160586bca7a 100644 (file)
@@ -897,28 +897,22 @@ wxSize wxBoxSizer::CalcMin()
     {
         wxSizerItem *item = (wxSizerItem*) node->Data();
 
-        int weight = 1;
-        if (item->GetOption())
-            weight = item->GetOption();
-
+        m_stretchable += item->GetOption();
+        
         wxSize size( item->CalcMin() );
 
         if (m_orient == wxHORIZONTAL)
         {
-            m_minWidth += (size.x * weight);
+            m_minWidth += size.x;
             m_minHeight = wxMax( m_minHeight, size.y );
         }
         else
         {
-            m_minHeight += (size.y * weight);
+            m_minHeight += size.y;
             m_minWidth = wxMax( m_minWidth, size.x );
         }
 
-        if (item->GetOption())
-        {
-            m_stretchable += weight;
-        }
-        else
+        if (item->GetOption() == 0)
         {
             if (m_orient == wxVERTICAL)
             {
@@ -926,7 +920,7 @@ wxSize wxBoxSizer::CalcMin()
                 m_fixedWidth = wxMax( m_fixedWidth, size.x );
             }
             else
-            {
+            { 
                 m_fixedWidth += size.x;
                 m_fixedHeight = wxMax( m_fixedHeight, size.y );
             }