diff --git a/browser/components/places/content/controller.js b/browser/components/places/content/controller.js index 0113ad08ebf..4910f3db7fb 100755 --- a/browser/components/places/content/controller.js +++ b/browser/components/places/content/controller.js @@ -53,15 +53,6 @@ const RELOAD_ACTION_REMOVE = 2; // rows. const RELOAD_ACTION_MOVE = 3; -#ifdef XP_MACOSX -// On Mac OSX, the transferable system converts "\r\n" to "\n\n", where we -// really just want "\n". -const NEWLINE= "\n"; -#else -// On other platforms, the transferable system converts "\r\n" to "\n". -const NEWLINE = "\r\n"; -#endif - /** * Represents an insertion point within a container where we can insert * items. @@ -1212,7 +1203,7 @@ PlacesController.prototype = { copiedFolders.push(node); function generateChunk(type, overrideURI) { - var suffix = i < (nodes.length - 1) ? "\n" : ""; + var suffix = i < (nodes.length - 1) ? NEWLINE : ""; var uri = overrideURI; if (PlacesUtils.nodeIsLivemarkContainer(node)) diff --git a/browser/components/places/content/utils.js b/browser/components/places/content/utils.js index 694eb31c1d2..0d1d9edb1d8 100644 --- a/browser/components/places/content/utils.js +++ b/browser/components/places/content/utils.js @@ -50,6 +50,15 @@ const LOAD_IN_SIDEBAR_ANNO = "bookmarkProperties/loadInSidebar"; const DESCRIPTION_ANNO = "bookmarkProperties/description"; const POST_DATA_ANNO = "URIProperties/POSTData"; +#ifdef XP_MACOSX +// On Mac OSX, the transferable system converts "\r\n" to "\n\n", where we +// really just want "\n". +const NEWLINE= "\n"; +#else +// On other platforms, the transferable system converts "\r\n" to "\n". +const NEWLINE = "\r\n"; +#endif + function QI_node(aNode, aIID) { var result = null; try { @@ -530,10 +539,10 @@ var PlacesUtils = { function gatherDataUrl(bNode) { if (self.nodeIsLivemarkContainer(bNode)) { var siteURI = self.livemarks.getSiteURI(bNode.itemId).spec; - return siteURI + "\n" + bNode.title; + return siteURI + NEWLINE + bNode.title; } if (self.nodeIsURI(bNode)) - return (aOverrideURI || bNode.uri) + "\n" + bNode.title; + return (aOverrideURI || bNode.uri) + NEWLINE + bNode.title; // ignore containers and separators - items without valid URIs return ""; } @@ -553,7 +562,7 @@ var PlacesUtils = { var escapedTitle = htmlEscape(bNode.title); if (self.nodeIsLivemarkContainer(bNode)) { var siteURI = self.livemarks.getSiteURI(bNode.itemId).spec; - return "" + escapedTitle + "\n"; + return "" + escapedTitle + "" + NEWLINE; } if (self.nodeIsContainer(bNode)) { asContainer(bNode); @@ -561,19 +570,21 @@ var PlacesUtils = { if (!wasOpen) bNode.containerOpen = true; - var childString = "