Bug 388337 - Pasting a folder which contains sub-folders fails. r=sspitzer.

This commit is contained in:
mozilla.mano@sent.com 2007-07-18 14:39:23 -07:00
Родитель 0cbb53edf3
Коммит 5f904e3625
2 изменённых файлов: 28 добавлений и 28 удалений

Просмотреть файл

@ -1245,8 +1245,8 @@ PlacesController.prototype = {
return PlacesUtils.wrapNode(node, type, overrideURI) + placeSuffix;
}
// all items wrapped as TYPE_X_MOZ_PLACE
placeString += generateChunk(PlacesUtils.TYPE_X_MOZ_PLACE);
// all items wrapped as TYPE_X_MOZ_PLACE
placeString += generateChunk(PlacesUtils.TYPE_X_MOZ_PLACE);
}
function addData(type, data) {

Просмотреть файл

@ -506,6 +506,7 @@ var PlacesUtils = {
// Recurse down children if the node is a folder
if (self.nodeIsContainer(bNode)) {
asContainer(bNode);
if (self.nodeIsLivemarkContainer(bNode)) {
// just save the livemark info, reinstantiate on other end
var feedURI = self.livemarks.getFeedURI(bNode.itemId).spec;
@ -541,10 +542,10 @@ var PlacesUtils = {
var siteURI = self.livemarks.getSiteURI(bNode.itemId).spec;
return siteURI + "\n" + bNode.title;
}
else if (self.nodeIsURI(bNode))
if (self.nodeIsURI(bNode))
return (aOverrideURI || bNode.uri) + "\n" + bNode.title;
else // ignore containers and separators - items without valid URIs
return "";
// ignore containers and separators - items without valid URIs
return "";
}
return gatherDataUrl(convertNode(aNode));
@ -564,7 +565,8 @@ var PlacesUtils = {
var siteURI = self.livemarks.getSiteURI(bNode.itemId).spec;
return "<A HREF=\"" + siteURI + "\">" + escapedTitle + "</A>\n";
}
else if (self.nodeIsContainer(bNode)) {
if (self.nodeIsContainer(bNode)) {
asContainer(bNode);
var wasOpen = bNode.containerOpen;
if (!wasOpen)
bNode.containerOpen = true;
@ -578,21 +580,20 @@ var PlacesUtils = {
bNode.containerOpen = wasOpen;
return childString + "</DL>\n";
}
else if (self.nodeIsURI(bNode))
if (self.nodeIsURI(bNode))
return "<A HREF=\"" + bNode.uri + "\">" + escapedTitle + "</A>\n";
else if (self.nodeIsSeparator(bNode))
if (self.nodeIsSeparator(bNode))
return "<HR>\n";
else
return "";
return "";
}
return gatherDataHtml(convertNode(aNode));
}
// case this.TYPE_UNICODE:
function gatherDataText(bNode) {
if (self.nodeIsLivemarkContainer(bNode)) {
if (self.nodeIsLivemarkContainer(bNode))
return self.livemarks.getSiteURI(bNode.itemId).spec;
}
else if (self.nodeIsContainer(bNode)) {
if (self.nodeIsContainer(bNode)) {
asContainer(bNode);
var wasOpen = bNode.containerOpen;
if (!wasOpen)
bNode.containerOpen = true;
@ -607,12 +608,11 @@ var PlacesUtils = {
bNode.containerOpen = wasOpen;
return childString;
}
else if (self.nodeIsURI(bNode))
if (self.nodeIsURI(bNode))
return (aOverrideURI || bNode.uri);
else if (self.nodeIsSeparator(bNode))
if (self.nodeIsSeparator(bNode))
return "--------------------";
else
return "";
return "";
}
return gatherDataText(convertNode(aNode));
@ -700,18 +700,18 @@ var PlacesUtils = {
var annos = node.folder.annos;
var folderItemsTransactions =
getChildItemsTransactions(node.children);
txn = this.ptm.createFolder(title, -1, aIndex, annos,
txn = self.ptm.createFolder(title, -1, index, annos,
folderItemsTransactions);
}
else { // node is a livemark
var feedURI = self._uri(node.uri.feed);
var siteURI = self._uri(node.uri.site);
txn = this.ptm.createLivemark(feedURI, siteURI, node.title,
txn = self.ptm.createLivemark(feedURI, siteURI, node.title,
aContainer, index, node.annos);
}
}
else if (node.type == self.TYPE_X_MOZ_PLACE_SEPARATOR)
txn = this.ptm.createSeparator(-1, aIndex);
txn = self.ptm.createSeparator(-1, index);
else if (node.type == self.TYPE_X_MOZ_PLACE)
txn = self._getBookmarkItemCopyTransaction(node, -1, index);