Bug 1557847 - C-C part: Adapt to array changes in nsIClipboard.hasDataMatchingFlavors(). r=me
authorJorg K <jorgk@jorgk.com>
Mon, 10 Jun 2019 00:09:40 +0200
changeset 35815 97712b1f5c4be2d92e565e283727c5fec1564b4b
parent 35814 a7bf84ab2a7585a118fa6d66fa6f79e1618b7172
child 35816 e73ec57351765daf1d9e629afc07e7dc54b07018
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersme
bugs1557847
Bug 1557847 - C-C part: Adapt to array changes in nsIClipboard.hasDataMatchingFlavors(). r=me
calendar/base/content/calendar-clipboard.js
suite/components/places/content/controller.js
--- a/calendar/base/content/calendar-clipboard.js
+++ b/calendar/base/content/calendar-clipboard.js
@@ -33,17 +33,16 @@ function canPaste() {
                            .filter(cal.acl.userCanAddItemsToCalendar);
         if (!calendars.length) {
             return false;
         }
     }
 
     const flavors = ["text/calendar", "text/unicode"];
     return Services.clipboard.hasDataMatchingFlavors(flavors,
-                                                     flavors.length,
                                                      Ci.nsIClipboard.kGlobalClipboard);
 }
 
 /**
  * Copy the ics data of the current view's selected events to the clipboard and
  * deletes the events on success
  *
  * @param aCalendarItemArray    (optional) an array of items to cut. If not
--- a/suite/components/places/content/controller.js
+++ b/suite/components/places/content/controller.js
@@ -320,17 +320,17 @@ PlacesController.prototype = {
    */
   _isClipboardDataPasteable: function PC__isClipboardDataPasteable() {
     // if the clipboard contains TYPE_X_MOZ_PLACE_* data, it is definitely
     // pasteable, with no need to unwrap all the nodes.
 
     var flavors = PlacesUIUtils.PLACES_FLAVORS;
     var clipboard = this.clipboard;
     var hasPlacesData =
-      clipboard.hasDataMatchingFlavors(flavors, flavors.length,
+      clipboard.hasDataMatchingFlavors(flavors,
                                        Ci.nsIClipboard.kGlobalClipboard);
     if (hasPlacesData)
       return this._view.insertionPoint != null;
 
     // if the clipboard doesn't have TYPE_X_MOZ_PLACE_* data, we also allow
     // pasting of valid "text/unicode" and "text/x-moz-url" data
     var xferable = Cc["@mozilla.org/widget/transferable;1"]
                      .createInstance(Ci.nsITransferable);