mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
Sonar fixes - a few "String literals should not be duplicated"
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1882819 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0be6193161
commit
ebdd3c37d4
@ -102,7 +102,7 @@ public class EncryptionInfo implements GenericRecord {
|
||||
* Opens for decryption
|
||||
*/
|
||||
public EncryptionInfo(DirectoryNode dir) throws IOException {
|
||||
this(dir.createDocumentInputStream("EncryptionInfo"), null);
|
||||
this(dir.createDocumentInputStream(ENCRYPTION_INFO_ENTRY), null);
|
||||
}
|
||||
|
||||
public EncryptionInfo(LittleEndianInput dis, EncryptionMode preferredEncryptionMode) throws IOException {
|
||||
|
||||
@ -383,9 +383,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
*/
|
||||
@NotImplemented
|
||||
public void clip(Shape s){
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
logNotImplemented();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -406,9 +404,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
*/
|
||||
@NotImplemented
|
||||
public Shape getClip(){
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
logNotImplemented();
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -675,10 +671,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
public boolean drawImage(Image img, int x, int y,
|
||||
Color bgcolor,
|
||||
ImageObserver observer){
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
|
||||
logNotImplemented();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -725,10 +718,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
int width, int height,
|
||||
Color bgcolor,
|
||||
ImageObserver observer){
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
|
||||
logNotImplemented();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -785,9 +775,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
int dx1, int dy1, int dx2, int dy2,
|
||||
int sx1, int sy1, int sx2, int sy2,
|
||||
ImageObserver observer){
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
logNotImplemented();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -850,9 +838,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
int sx1, int sy1, int sx2, int sy2,
|
||||
Color bgcolor,
|
||||
ImageObserver observer){
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
logNotImplemented();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -891,9 +877,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
@NotImplemented
|
||||
public boolean drawImage(Image img, int x, int y,
|
||||
ImageObserver observer) {
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
logNotImplemented();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1078,9 +1062,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
*/
|
||||
@NotImplemented
|
||||
public void setClip(Shape clip) {
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
logNotImplemented();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1101,9 +1083,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
* @since JDK1.1
|
||||
*/
|
||||
public Rectangle getClipBounds(){
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
logNotImplemented();
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1377,9 +1357,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
*/
|
||||
@NotImplemented
|
||||
public void setComposite(Composite comp){
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
logNotImplemented();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1391,9 +1369,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
*/
|
||||
@NotImplemented
|
||||
public Composite getComposite(){
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
logNotImplemented();
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1535,9 +1511,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
*/
|
||||
@NotImplemented
|
||||
public void drawString(AttributedCharacterIterator iterator, float x, float y) {
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
logNotImplemented();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1642,9 +1616,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
*/
|
||||
@NotImplemented
|
||||
public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) {
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
logNotImplemented();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1688,9 +1660,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
public boolean drawImage(Image img, int x, int y,
|
||||
int width, int height,
|
||||
ImageObserver observer) {
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
logNotImplemented();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1739,9 +1709,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
*/
|
||||
@NotImplemented
|
||||
public void setXORMode(Color c1) {
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
logNotImplemented();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1753,9 +1721,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
*/
|
||||
@NotImplemented
|
||||
public void setPaintMode() {
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
logNotImplemented();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1791,9 +1757,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
*/
|
||||
@NotImplemented
|
||||
public void drawRenderedImage(RenderedImage img, AffineTransform xform) {
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
logNotImplemented();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1819,9 +1783,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
*/
|
||||
@NotImplemented
|
||||
public void drawRenderableImage(RenderableImage img, AffineTransform xform) {
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
logNotImplemented();
|
||||
}
|
||||
|
||||
protected void applyStroke(SimpleShape<?,?> shape) {
|
||||
@ -1841,4 +1803,10 @@ public class SLGraphics extends Graphics2D implements Cloneable {
|
||||
shape.setFillColor((Color)_paint);
|
||||
}
|
||||
}
|
||||
|
||||
private void logNotImplemented() {
|
||||
if (LOG.check(POILogger.WARN)) {
|
||||
LOG.log(POILogger.WARN, "Not implemented");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,10 +42,10 @@ public interface PackageRelationshipTypes {
|
||||
String CORE_PROPERTIES_ECMA376 = "http://schemas.openxmlformats.org/officedocument/2006/relationships/metadata/core-properties";
|
||||
|
||||
/**
|
||||
* Namespace of Core properties relationship type as defiend in ECMA 376
|
||||
* Namespace of Core properties relationship type as defined in ECMA 376
|
||||
*/
|
||||
String CORE_PROPERTIES_ECMA376_NS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
||||
|
||||
|
||||
/**
|
||||
* Digital signature relationship type.
|
||||
*/
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
|
||||
package org.apache.poi.xslf.usermodel;
|
||||
|
||||
import static org.apache.poi.openxml4j.opc.PackageRelationshipTypes.CORE_PROPERTIES_ECMA376_NS;
|
||||
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.io.IOException;
|
||||
|
||||
@ -177,7 +179,7 @@ public class XSLFGraphicFrame extends XSLFShape implements GraphicalFrame<XSLFSh
|
||||
XmlObject[] obj = getGraphicalData().selectPath(xpath);
|
||||
if (obj != null && obj.length == 1) {
|
||||
XmlCursor c = obj[0].newCursor();
|
||||
QName idQualifiedName = new QName("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "id");
|
||||
QName idQualifiedName = new QName(CORE_PROPERTIES_ECMA376_NS, "id");
|
||||
id = c.getAttributeText(idQualifiedName);
|
||||
c.dispose();
|
||||
}
|
||||
@ -216,7 +218,7 @@ public class XSLFGraphicFrame extends XSLFShape implements GraphicalFrame<XSLFSh
|
||||
XmlCursor c = obj[0].newCursor();
|
||||
try {
|
||||
// duplicate chart with embedded workbook
|
||||
QName idQualifiedName = new QName("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "id");
|
||||
QName idQualifiedName = new QName(CORE_PROPERTIES_ECMA376_NS, "id");
|
||||
String id = c.getAttributeText(idQualifiedName);
|
||||
XSLFChart srcChart = (XSLFChart) src.getRelationById(id);
|
||||
XSLFChart chartCopy = slide.getSlideShow().createChart(slide);
|
||||
@ -239,22 +241,22 @@ public class XSLFGraphicFrame extends XSLFShape implements GraphicalFrame<XSLFSh
|
||||
|
||||
XSLFSheet sheet = srcShape.getSheet();
|
||||
try {
|
||||
String dm = c.getAttributeText(new QName("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "dm"));
|
||||
String dm = c.getAttributeText(new QName(CORE_PROPERTIES_ECMA376_NS, "dm"));
|
||||
PackageRelationship dmRel = sheet.getPackagePart().getRelationship(dm);
|
||||
PackagePart dmPart = sheet.getPackagePart().getRelatedPart(dmRel);
|
||||
getSheet().importPart(dmRel, dmPart);
|
||||
|
||||
String lo = c.getAttributeText(new QName("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "lo"));
|
||||
String lo = c.getAttributeText(new QName(CORE_PROPERTIES_ECMA376_NS, "lo"));
|
||||
PackageRelationship loRel = sheet.getPackagePart().getRelationship(lo);
|
||||
PackagePart loPart = sheet.getPackagePart().getRelatedPart(loRel);
|
||||
getSheet().importPart(loRel, loPart);
|
||||
|
||||
String qs = c.getAttributeText(new QName("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "qs"));
|
||||
String qs = c.getAttributeText(new QName(CORE_PROPERTIES_ECMA376_NS, "qs"));
|
||||
PackageRelationship qsRel = sheet.getPackagePart().getRelationship(qs);
|
||||
PackagePart qsPart = sheet.getPackagePart().getRelatedPart(qsRel);
|
||||
getSheet().importPart(qsRel, qsPart);
|
||||
|
||||
String cs = c.getAttributeText(new QName("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "cs"));
|
||||
String cs = c.getAttributeText(new QName(CORE_PROPERTIES_ECMA376_NS, "cs"));
|
||||
PackageRelationship csRel = sheet.getPackagePart().getRelationship(cs);
|
||||
PackagePart csPart = sheet.getPackagePart().getRelatedPart(csRel);
|
||||
getSheet().importPart(csRel, csPart);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user