org.apache.poi.xslf.usermodel.XSLFSlide.removeRelation()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(186)

本文整理了Java中org.apache.poi.xslf.usermodel.XSLFSlide.removeRelation()方法的一些代码示例,展示了XSLFSlide.removeRelation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSLFSlide.removeRelation()方法的具体详情如下:
包路径:org.apache.poi.xslf.usermodel.XSLFSlide
类名称:XSLFSlide
方法名:removeRelation

XSLFSlide.removeRelation介绍

暂无

代码示例

代码示例来源:origin: org.apache.poi/poi-ooxml

  1. @SuppressWarnings({"WeakerAccess", "ProtectedMemberInFinalClass"})
  2. protected void removeLayoutRelation(XSLFSlideLayout layout) {
  3. removeRelation(layout, false);
  4. }

代码示例来源:origin: org.apache.poi/poi-ooxml

  1. @SuppressWarnings({"WeakerAccess", "ProtectedMemberInFinalClass"})
  2. protected void removeChartRelation(XSLFChart chart) {
  3. removeRelation(chart);
  4. }

代码示例来源:origin: org.apache.poi/poi-ooxml

  1. @Override
  2. public XSLFSlide importContent(XSLFSheet src){
  3. super.importContent(src);
  4. if (!(src instanceof XSLFSlide)) {
  5. return this;
  6. }
  7. // only copy direct backgrounds - not backgrounds of master sheet
  8. CTBackground bgOther = ((XSLFSlide)src)._slide.getCSld().getBg();
  9. if (bgOther == null) {
  10. return this;
  11. }
  12. CTBackground bgThis = _slide.getCSld().getBg();
  13. // remove existing background
  14. if (bgThis != null) {
  15. if (bgThis.isSetBgPr() && bgThis.getBgPr().isSetBlipFill()) {
  16. String oldId = bgThis.getBgPr().getBlipFill().getBlip().getEmbed();
  17. removeRelation(oldId);
  18. }
  19. _slide.getCSld().unsetBg();
  20. }
  21. bgThis = (CTBackground)_slide.getCSld().addNewBg().set(bgOther);
  22. if(bgOther.isSetBgPr() && bgOther.getBgPr().isSetBlipFill()){
  23. String idOther = bgOther.getBgPr().getBlipFill().getBlip().getEmbed();
  24. String idThis = importBlip(idOther, src);
  25. bgThis.getBgPr().getBlipFill().getBlip().setEmbed(idThis);
  26. }
  27. return this;
  28. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

  1. @SuppressWarnings({"WeakerAccess", "ProtectedMemberInFinalClass"})
  2. protected void removeChartRelation(XSLFChart chart) {
  3. removeRelation(chart);
  4. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

  1. @SuppressWarnings({"WeakerAccess", "ProtectedMemberInFinalClass"})
  2. protected void removeLayoutRelation(XSLFSlideLayout layout) {
  3. removeRelation(layout, false);
  4. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

  1. @Override
  2. public XSLFSlide importContent(XSLFSheet src){
  3. super.importContent(src);
  4. if (!(src instanceof XSLFSlide)) {
  5. return this;
  6. }
  7. // only copy direct backgrounds - not backgrounds of master sheet
  8. CTBackground bgOther = ((XSLFSlide)src)._slide.getCSld().getBg();
  9. if (bgOther == null) {
  10. return this;
  11. }
  12. CTBackground bgThis = _slide.getCSld().getBg();
  13. // remove existing background
  14. if (bgThis != null) {
  15. if (bgThis.isSetBgPr() && bgThis.getBgPr().isSetBlipFill()) {
  16. String oldId = bgThis.getBgPr().getBlipFill().getBlip().getEmbed();
  17. removeRelation(oldId);
  18. }
  19. _slide.getCSld().unsetBg();
  20. }
  21. bgThis = (CTBackground)_slide.getCSld().addNewBg().set(bgOther);
  22. if(bgOther.isSetBgPr() && bgOther.getBgPr().isSetBlipFill()){
  23. String idOther = bgOther.getBgPr().getBlipFill().getBlip().getEmbed();
  24. String idThis = importBlip(idOther, src);
  25. bgThis.getBgPr().getBlipFill().getBlip().setEmbed(idThis);
  26. }
  27. return this;
  28. }

相关文章