[Libreoffice-commits] .: Branch 'feature/cmclayout' - vcl/source

Caolán McNamara caolan at kemper.freedesktop.org
Tue May 22 05:59:05 PDT 2012


 vcl/source/control/button.cxx |   13 ++++++++-----
 vcl/source/window/builder.cxx |    2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 8d53821aff779c132e5418773a8f9bb1d7f3a76b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 22 13:58:59 2012 +0100

    fix button groups

diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index d76f09b..827e961 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -2312,14 +2312,17 @@ void RadioButton::group(RadioButton &rOther)
     }
 
     if (rOther.m_xGroup)
-    {
-        for (std::set<RadioButton*>::iterator aI = rOther.m_xGroup->begin(), aEnd = rOther.m_xGroup->end(); aI != aEnd; ++aI)
-            m_xGroup->insert(*aI);
-    }
+        m_xGroup->insert(rOther.m_xGroup->begin(), rOther.m_xGroup->end());
 
     m_xGroup->insert(&rOther);
 
-    rOther.m_xGroup = m_xGroup;
+    //make all members of the group share the same button group
+    for (std::set<RadioButton*>::iterator aI = m_xGroup->begin(), aEnd = m_xGroup->end();
+        aI != aEnd; ++aI)
+    {
+        RadioButton* pButton = *aI;
+        pButton->m_xGroup = m_xGroup;
+    }
 
     //if this one is checked, uncheck all the others
     if (mbChecked)
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index e978d7d..4ea8739 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -554,7 +554,7 @@ void VclBuilder::swapGuts(Window &rOrig, Window &rReplacement)
     //now put this at the end of the window list
     rOrig.ImplInsertWindow(pParent);
 #endif
-    fprintf(stderr, "swapped %p for %p (%d)\n", &rReplacement, &rOrig);
+    fprintf(stderr, "swapped %p for %p\n", &rReplacement, &rOrig);
 }
 
 bool VclBuilder::replace(rtl::OString sID, Window &rReplacement)


More information about the Libreoffice-commits mailing list