Skip to content

Commit 07cef63

Browse files
committed
Fixed comparation of extended attributes of type Document
1 parent 5897935 commit 07cef63

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/document/MetadataDiff.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,7 @@ public MetadataDiff(final GUIVersion version1, final GUIVersion version2) {
117117

118118
IButton compareContent = new IButton(I18N.message("comparecontent"));
119119
compareContent.setWidth100();
120-
compareContent.addClickHandler(event -> {
121-
ComparisonWindow diff = new ComparisonWindow(version1, version2);
122-
diff.show();
123-
});
120+
compareContent.addClickHandler(click -> new ComparisonWindow(version1, version2).show());
124121
if (Feature.visible(Feature.COMPARISON)) {
125122
addItem(compareContent);
126123
compareContent.setDisabled(!Feature.enabled(Feature.COMPARISON));
@@ -135,9 +132,8 @@ private void printExtendedAttributes(ArrayList<DiffRecord> records, GUIVersion v
135132

136133
List<String> names = prepareAttributeNames(version1, version2);
137134

138-
for (String name : names) {
135+
for (String name : names)
139136
addDiffRecord(version1, version2, dateFormat, numberFormat, attributeRecords, name);
140-
}
141137

142138
attributeRecords.sort(null);
143139
records.addAll(attributeRecords);
@@ -175,7 +171,8 @@ private void addDiffRecord(GUIVersion version1, GUIVersion version2, DateTimeFor
175171

176172
private String extractValue(DateTimeFormat dateFormat, NumberFormat numberFormat, GUIAttribute attribute) {
177173
String val = "";
178-
if ((attribute.getType() == GUIAttribute.TYPE_STRING || attribute.getType() == GUIAttribute.TYPE_USER)
174+
if ((attribute.getType() == GUIAttribute.TYPE_STRING || attribute.getType() == GUIAttribute.TYPE_USER
175+
|| attribute.getType() == GUIAttribute.TYPE_DOCUMENT || attribute.getType() == GUIAttribute.TYPE_FOLDER)
179176
&& attribute.getStringValue() != null) {
180177
val = attribute.getStringValue();
181178
} else if (attribute.getType() == GUIAttribute.TYPE_INT && attribute.getValue() != null) {

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/document/VersionsPanel.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ protected void onDraw() {
8080
ListGridField permalink = preparePermalink();
8181

8282
ListGridField wfStatus = prepareWorkflow();
83-
83+
8484
list = new RefreshableListGrid(
8585
new VersionsDS(document.getId(), null, Session.get().getConfigAsInt("gui.maxversions")));
8686
list.setEmptyMessage(I18N.message("notitemstoshow"));
@@ -349,8 +349,7 @@ public void onFailure(Throwable caught) {
349349

350350
@Override
351351
public void onSuccess(List<GUIVersion> result) {
352-
MetadataDiff diffWinfow = new MetadataDiff(result.get(0), result.get(1));
353-
diffWinfow.show();
352+
new MetadataDiff(result.get(0), result.get(1)).show();
354353
}
355354
}));
356355
return compareMetadata;

0 commit comments

Comments
 (0)