[PATCH 1/2] fdo#43399 hidden radio button should also gets unset

Lionel Elie Mamane lionel at mamane.lu
Mon Feb 13 08:36:23 PST 2012


---
 extensions/source/abpilot/typeselectionpage.cxx |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx
index 711159e9..aee5219 100644
--- a/extensions/source/abpilot/typeselectionpage.cxx
+++ b/extensions/source/abpilot/typeselectionpage.cxx
@@ -110,9 +110,13 @@ namespace abp
         m_aAllTypes.push_back( ButtonItem( &m_aOE, AST_OE, bWithMozilla && !bUnx ) );
         m_aAllTypes.push_back( ButtonItem( &m_aOther, AST_OTHER, true ) );
 
-        bool bFirstVisible = true;
         Link aTypeSelectionHandler = LINK(this, TypeSelectionPage, OnTypeSelected );
         const Size aSpacing( LogicToPixel( Size( 0, 3 ), MAP_APPFONT ) );
+        if ( ! m_aAllTypes.empty() )
+        {
+            ButtonItem aItem = m_aAllTypes[0];
+            aItem.m_pItem->SetStyle( aItem.m_pItem->GetStyle() | WB_GROUP );
+        }
         for ( ::std::vector< ButtonItem >::const_iterator loop = m_aAllTypes.begin();
               loop != m_aAllTypes.end(); ++loop )
         {
@@ -125,12 +129,6 @@ namespace abp
                 aTopLeft.Y() += aItemSize.Height() + aSpacing.Height();
                 aItem.m_pItem->SetClickHdl( aTypeSelectionHandler );
                 aItem.m_pItem->Show();
-
-                if ( bFirstVisible )
-                {
-                    aItem.m_pItem->SetStyle( aItem.m_pItem->GetStyle() | WB_GROUP );
-                    bFirstVisible = false;
-                }
             }
         }
     }
-- 
1.7.7.3


--RnlQjJ0d97Da+TV1--


More information about the LibreOffice mailing list