Merge "Fix displaying of file diff if draft patch has been deleted" into stable-2.5
This commit is contained in:
@@ -35,8 +35,8 @@ import com.google.gwt.user.client.ui.HTMLPanel;
|
|||||||
import com.google.gwt.user.client.ui.Image;
|
import com.google.gwt.user.client.ui.Image;
|
||||||
import com.google.gwtorm.client.KeyUtil;
|
import com.google.gwtorm.client.KeyUtil;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.Map;
|
||||||
|
|
||||||
public class PatchSetSelectBox extends Composite {
|
public class PatchSetSelectBox extends Composite {
|
||||||
interface Binder extends UiBinder<HTMLPanel, PatchSetSelectBox> {
|
interface Binder extends UiBinder<HTMLPanel, PatchSetSelectBox> {
|
||||||
@@ -63,7 +63,7 @@ public class PatchSetSelectBox extends Composite {
|
|||||||
PatchSet.Id idActive;
|
PatchSet.Id idActive;
|
||||||
Side side;
|
Side side;
|
||||||
PatchScreen.Type screenType;
|
PatchScreen.Type screenType;
|
||||||
List<Anchor> links;
|
Map<Integer, Anchor> links;
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
HTMLPanel linkPanel;
|
HTMLPanel linkPanel;
|
||||||
@@ -88,7 +88,7 @@ public class PatchSetSelectBox extends Composite {
|
|||||||
this.idSideA = idSideA;
|
this.idSideA = idSideA;
|
||||||
this.idSideB = idSideB;
|
this.idSideB = idSideB;
|
||||||
this.idActive = (side == Side.A) ? idSideA : idSideB;
|
this.idActive = (side == Side.A) ? idSideA : idSideB;
|
||||||
this.links = new LinkedList<Anchor>();
|
this.links = new HashMap<Integer, Anchor>();
|
||||||
|
|
||||||
linkPanel.clear();
|
linkPanel.clear();
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ public class PatchSetSelectBox extends Composite {
|
|||||||
baseLink = createLink(PatchUtil.C.patchBase(), null);
|
baseLink = createLink(PatchUtil.C.patchBase(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
links.add(baseLink);
|
links.put(0, baseLink);
|
||||||
if (screenType == PatchScreen.Type.UNIFIED || side == Side.A) {
|
if (screenType == PatchScreen.Type.UNIFIED || side == Side.A) {
|
||||||
linkPanel.add(baseLink);
|
linkPanel.add(baseLink);
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ public class PatchSetSelectBox extends Composite {
|
|||||||
for (Patch patch : script.getHistory()) {
|
for (Patch patch : script.getHistory()) {
|
||||||
PatchSet.Id psId = patch.getKey().getParentKey();
|
PatchSet.Id psId = patch.getKey().getParentKey();
|
||||||
Anchor anchor = createLink(Integer.toString(psId.get()), psId);
|
Anchor anchor = createLink(Integer.toString(psId.get()), psId);
|
||||||
links.add(anchor);
|
links.put(psId.get(), anchor);
|
||||||
linkPanel.add(anchor);
|
linkPanel.add(anchor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user