~ubuntu-branches/ubuntu/quantal/firefox/quantal

« back to all changes in this revision

Viewing changes to debian/globalmenu/src/uGlobalMenuItem.cpp

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2012-04-10 11:44:48 UTC
  • Revision ID: package-import@ubuntu.com-20120410114448-fr48g2n9crpgmvi8
Tags: 11.0+build1-0ubuntu4
* Update globalmenu-extension to 3.2
  - Fix LP: #915888 - Handling of checkbox menuitems with a command
    node is completely broken
  - Make uGlobalMenu::RemoveMenuObjectAt work correctly when removed items
    are not contiguous
  - Don't try to recycle an item that wasn't a separator as an item that is
    a separator, as this breaks the menu (we already ensured that the reverse
    of this couldn't happen)

Show diffs side-by-side

added added

removed removed

Lines of Context:
479
479
      SetMenuItemType(eRadio);
480
480
    }
481
481
 
482
 
    nsIContent *content = mCommandContent ? mCommandContent : mContent;
483
 
    SetCheckState(content->AttrValueIs(kNameSpaceID_None, uWidgetAtoms::checked,
 
482
    SetCheckState(mContent->AttrValueIs(kNameSpaceID_None, uWidgetAtoms::checked,
484
483
                                       uWidgetAtoms::_true, eCaseMatters));
485
484
    dbusmenu_menuitem_property_set_int(mDbusMenuItem,
486
485
                                       DBUSMENU_MENUITEM_PROP_TOGGLE_STATE,
488
487
                                       DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED : 
489
488
                                        DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED);
490
489
 
491
 
    if (mCommandContent) {
492
 
      UNITY_MENU_BLOCK_EVENTS_FOR_CURRENT_SCOPE();
493
 
      if (IsChecked()) {
494
 
        mContent->SetAttr(kNameSpaceID_None, uWidgetAtoms::checked,
495
 
                          NS_LITERAL_STRING("true"), true);
496
 
      } else {
497
 
        mContent->UnsetAttr(kNameSpaceID_None, uWidgetAtoms::checked,
498
 
                            true);
499
 
      }
500
 
    }
501
 
 
502
490
  } else {
503
491
    dbusmenu_menuitem_property_remove(mDbusMenuItem,
504
492
                                      DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE);
577
565
  if (!mContent->AttrValueIs(kNameSpaceID_None, uWidgetAtoms::autocheck,
578
566
                             uWidgetAtoms::_false, eCaseMatters) &&
579
567
      IsCheckboxOrRadioItem()) {
580
 
    nsIContent *content = mCommandContent ? mCommandContent : mContent;
581
568
    if (!IsChecked()) {
582
569
      // We're currently not checked, so check now
583
 
      content->SetAttr(kNameSpaceID_None, uWidgetAtoms::checked,
584
 
                       NS_LITERAL_STRING("true"), true);
 
570
      mContent->SetAttr(kNameSpaceID_None, uWidgetAtoms::checked,
 
571
                        NS_LITERAL_STRING("true"), true);
585
572
    } else if (IsChecked() && (mFlags & UNITY_MENUITEM_IS_CHECKBOX)) {
586
573
      // We're currently checked, so uncheck now. Don't do this for radio buttons
587
 
      content->UnsetAttr(kNameSpaceID_None, uWidgetAtoms::checked, true);
 
574
      mContent->UnsetAttr(kNameSpaceID_None, uWidgetAtoms::checked, true);
588
575
    }
589
576
  }
590
577
 
771
758
               aContent == mKeyContent,
772
759
               "Received an event that wasn't meant for us!");
773
760
 
774
 
  if ((aContent == mContent || aContent == mCommandContent) &&
775
 
      aAttribute == uWidgetAtoms::checked &&
 
761
  if (aContent == mContent && aAttribute == uWidgetAtoms::checked &&
776
762
      aContent->AttrValueIs(kNameSpaceID_None, uWidgetAtoms::checked,
777
763
                            uWidgetAtoms::_true, eCaseMatters)) {
778
764
    UncheckSiblings();
817
803
      SyncLabelFromContent(mCommandContent);
818
804
    } else if (aAttribute == uWidgetAtoms::disabled) {
819
805
      SyncSensitivityFromContent(mCommandContent);
820
 
    } else if (aAttribute == uWidgetAtoms::checked) {
821
 
      SyncTypeAndStateFromContent();
822
806
    }
823
807
  } else if (aContent == mKeyContent) {
824
808
    SyncAccelFromContent();