mirror of https://github.com/apache/poi.git
Fix new Name.isHidden leftover
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1876731 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e9d0ddce93
commit
fbcf0c81ba
|
@ -56,7 +56,7 @@ public class ExternalLinksTable extends POIXMLDocumentPart {
|
|||
super(part);
|
||||
readFrom(part.getInputStream());
|
||||
}
|
||||
|
||||
|
||||
public void readFrom(InputStream is) throws IOException {
|
||||
try {
|
||||
ExternalLinkDocument doc = ExternalLinkDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);
|
||||
|
@ -86,7 +86,7 @@ public class ExternalLinksTable extends POIXMLDocumentPart {
|
|||
public CTExternalLink getCTExternalLink(){
|
||||
return link;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the last recorded name of the file that this
|
||||
* is linked to
|
||||
|
@ -105,14 +105,14 @@ public class ExternalLinksTable extends POIXMLDocumentPart {
|
|||
*/
|
||||
public void setLinkedFileName(String target) {
|
||||
String rId = link.getExternalBook().getId();
|
||||
|
||||
|
||||
if (rId == null || rId.isEmpty()) {
|
||||
// We're a new External Link Table, so nothing to remove
|
||||
} else {
|
||||
// Relationships can't be changed, so remove the old one
|
||||
getPackagePart().removeRelationship(rId);
|
||||
}
|
||||
|
||||
|
||||
// Have a new one added
|
||||
PackageRelationship newRel = getPackagePart().addExternalRelationship(
|
||||
target, PackageRelationshipTypes.EXTERNAL_LINK_PATH);
|
||||
|
@ -120,7 +120,7 @@ public class ExternalLinksTable extends POIXMLDocumentPart {
|
|||
}
|
||||
|
||||
public List<String> getSheetNames() {
|
||||
CTExternalSheetName[] sheetNames =
|
||||
CTExternalSheetName[] sheetNames =
|
||||
link.getExternalBook().getSheetNames().getSheetNameArray();
|
||||
List<String> names = new ArrayList<>(sheetNames.length);
|
||||
for (CTExternalSheetName name : sheetNames) {
|
||||
|
@ -128,9 +128,9 @@ public class ExternalLinksTable extends POIXMLDocumentPart {
|
|||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
|
||||
public List<Name> getDefinedNames() {
|
||||
CTExternalDefinedName[] extNames =
|
||||
CTExternalDefinedName[] extNames =
|
||||
link.getExternalBook().getDefinedNames().getDefinedNameArray();
|
||||
List<Name> names = new ArrayList<>(extNames.length);
|
||||
for (CTExternalDefinedName extName : extNames) {
|
||||
|
@ -138,11 +138,11 @@ public class ExternalLinksTable extends POIXMLDocumentPart {
|
|||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// TODO Last seen data
|
||||
|
||||
|
||||
|
||||
protected class ExternalName implements Name {
|
||||
private CTExternalDefinedName name;
|
||||
protected ExternalName(CTExternalDefinedName name) {
|
||||
|
@ -186,10 +186,16 @@ public class ExternalLinksTable extends POIXMLDocumentPart {
|
|||
public boolean isFunctionName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isDeleted() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHidden() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue