Skip to content

Commit

Permalink
Fixed EngineIRIOTest failure and simplified code
Browse files Browse the repository at this point in the history
  • Loading branch information
hvbtup committed Nov 15, 2024
1 parent ab8de92 commit 4b0ce5d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ abstract public class ReportItemDesign extends StyledElementDesign {
* Text Resource Key used for altText localization.
*/
protected String altTextKey;
private String tagType;

/**
* Constructor
Expand Down Expand Up @@ -417,23 +416,4 @@ public void setAltTextKey(String altTextKey) {
this.altTextKey = altTextKey;
}

/**
* Set the PDF tag type
*
* @param tagType
*/
public void setTagType(String tagType) {
this.tagType = tagType;

}

/**
* Get the PDF tag type.
*
* Can be null.
*/
public String getTagType() {
return tagType;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.eclipse.birt.report.engine.content.IStyle;
import org.eclipse.birt.report.engine.css.engine.StyleConstants;
import org.eclipse.birt.report.engine.css.engine.value.css.CSSValueConstants;
import org.eclipse.birt.report.engine.ir.ReportItemDesign;
import org.eclipse.birt.report.engine.nLayout.LayoutContext;
import org.eclipse.birt.report.engine.nLayout.area.IArea;
import org.eclipse.birt.report.engine.nLayout.area.IContainerArea;
Expand Down Expand Up @@ -504,22 +503,4 @@ public void updateChildrenPosition() {
}
}

public String getTagType() {
String tagType = null;
ContainerArea base = this;
if (base.getContent() == null)
return null;
tagType = base.getContent().getTagType();
if (tagType != null) {
return tagType;
}
Object generateBy = base.getContent().getGenerateBy();
if (generateBy instanceof ReportItemDesign) {
tagType = ((ReportItemDesign) generateBy).getTagType();
if (tagType != null) {
return tagType;
}
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.eclipse.birt.report.engine.content.IContent;
import org.eclipse.birt.report.engine.content.IStyle;
import org.eclipse.birt.report.engine.content.ITextContent;
import org.eclipse.birt.report.engine.ir.ReportItemDesign;
import org.eclipse.birt.report.engine.layout.pdf.util.PropertyUtil;
import org.eclipse.birt.report.engine.nLayout.LayoutContext;
import org.eclipse.birt.report.engine.nLayout.area.IArea;
Expand Down Expand Up @@ -204,25 +203,4 @@ public void setHelpText(String helpText) {
this.helpText = helpText;
}

public String getTagType() {
ContainerArea base = this;
IContent content = base.getContent();
String tagType = null;
if (content == null) {
return null;
}
if (content instanceof ITextContent) {
tagType = ((ITextContent) content).getTagType();
if (tagType != null) {
return tagType;
}
}
ReportItemDesign generateBy = (ReportItemDesign) content.getGenerateBy();
if (generateBy == null) {
return null;
}
tagType = generateBy.getTagType();
return tagType;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.eclipse.birt.report.engine.css.engine.value.css.CSSValueConstants;
import org.eclipse.birt.report.engine.executor.ExecutionContext;
import org.eclipse.birt.report.engine.ir.DimensionType;
import org.eclipse.birt.report.engine.ir.ReportItemDesign;
import org.eclipse.birt.report.engine.layout.PDFConstants;
import org.eclipse.birt.report.engine.layout.pdf.util.PropertyUtil;
import org.eclipse.birt.report.engine.nLayout.LayoutContext;
Expand Down Expand Up @@ -1377,15 +1376,14 @@ public String getHelpText() {
return null;
}

/**
* Get the value of the PDF tag from the content.
*/
public String getTagType() {
String tagType = content.getTagType();
if (tagType != null) {
return tagType;
}
Object generateBy = content.getGenerateBy();
if (generateBy instanceof ReportItemDesign) {
ReportItemDesign rid = (ReportItemDesign) generateBy;
tagType = rid.getTagType();
IContent content = this.getContent();
String tagType = null;
if (content != null) {
tagType = content.getTagType();
}
return tagType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.eclipse.birt.report.engine.css.engine.StyleConstants;
import org.eclipse.birt.report.engine.css.engine.value.DataFormatValue;
import org.eclipse.birt.report.engine.css.engine.value.css.CSSValueConstants;
import org.eclipse.birt.report.engine.ir.ReportItemDesign;
import org.eclipse.birt.report.engine.layout.pdf.util.PropertyUtil;
import org.eclipse.birt.report.engine.nLayout.LayoutContext;
import org.eclipse.birt.report.engine.nLayout.area.IArea;
Expand Down Expand Up @@ -676,17 +675,4 @@ private TextArea findFirstNonEmptyTextArea(ContainerArea area) {
return null;
}

public String getTagType() {
ContainerArea base = this;
if (base.getContent() == null) {
return null;
}
ReportItemDesign generateBy = (ReportItemDesign) base.getContent().getGenerateBy();
String tagType = generateBy.getTagType();
if (tagType != null) {
return tagType;
}
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -1679,10 +1679,6 @@ private void setupReportItem(ReportItemDesign item, ReportItemHandle handle) {
}

handleAltText(handle, item);

// Copy tagType
String tagType = handle.getTagType();
item.setTagType(tagType);
}

/**
Expand Down

0 comments on commit 4b0ce5d

Please sign in to comment.