NumberingDefinitionsPart ndp = new NumberingDefinitionsPart(); ndp.setJaxbElement(transitionContainer.getNumbering()); mdp.addTargetPart(ndp); for (AbstractNum anum : ndp.getJaxbElement().getAbstractNum()) { if (anum.getMultiLevelType()==null) continue; String multiLevelType = anum.getMultiLevelType().getVal();
/** * For the given *concrete* list numId, restart the numbering on the specified * level at value val. This is done by creating a new list (ie <w:num>) * which uses the existing w:abstractNum. * @param numId * @param ilvl * @param val * @return */ public long restart(long numId, long ilvl, long val) throws InvalidOperationException { // Find the abstractNumId // (Ensure maps are initialised) if (em == null ) { getEmulator(); } ListNumberingDefinition existingLnd = instanceListDefinitions.get( Long.toString(numId) ); if (existingLnd==null) { throw new InvalidOperationException("Concrete/instance list " + numId + " does not exist"); } return restart(existingLnd.getNumNode(), ilvl, val); }
public Ind getInd(NumPr numPr) { //, StyleDefinitionsPart sdp, String styleId) { String ilvlString = "0"; if (numPr.getIlvl()!=null) ilvlString = numPr.getIlvl().getVal().toString(); if (numPr.getNumId()==null) { if(log.isWarnEnabled()) { log.warn("numPr without numId: " + XmlUtils.marshaltoString(numPr, true, true)); } return null; } else { return getInd(numPr.getNumId().getVal().toString(), ilvlString ); } }
ListNumberingDefinition lnd = getInstanceListDefinitions().get(numId ); if (lnd==null) { log.debug("couldn't find list for numId: " + numId); if (jaxbOverrideLvl!=null) { Ind ind = getIndFromLvl(jaxbOverrideLvl); if (ind!=null) { log.debug("Got it.."); Ind ind = getIndFromLvl(abstractLvl);
int nextId = getAbstractListDefinitions().size(); do { nextId++; } while (getAbstractListDefinitions().containsKey( "" + nextId )); abstractNum.setAbstractNumId( BigInteger.valueOf(nextId) ); this.getJaxbElement().getAbstractNum().add(abstractNum); num.setAbstractNumId(abstractNumId); nextId = getInstanceListDefinitions().size(); do { nextId++; } while (getInstanceListDefinitions().containsKey( "" + nextId )); num.setNumId( BigInteger.valueOf(nextId) ); this.getJaxbElement().getNum().add(num);
Part numberingPart = new org.docx4j.openpackaging.parts.WordprocessingML.NumberingDefinitionsPart(); final Numbering numbering = (Numbering) XmlUtils.unmarshalString(NUMBERING_XML.getFrom(options)); ((org.docx4j.openpackaging.parts.WordprocessingML.NumberingDefinitionsPart) numberingPart).setJaxbElement(numbering);
listItemStateStack.peek().concreteList = ndp.addAbstractListNumberingDefinition(abstractList); ndp.addAbstractListNumberingDefinitionLevel(abstractList, createLevel(level, cssMap)); long newNumId = ndp.restart(getConcreteList().getNumId().longValue(), ilvl, /* restart at */ 1); ListNumberingDefinition listDef = ndp.getInstanceListDefinitions().get(""+newNumId);
public Part CreateNumberingPartObject(String partName) throws InvalidFormatException { return new NumberingDefinitionsPart(new PartName(partName)); }
for (Numbering.AbstractNum abstractNum : getJaxbElement().getAbstractNum() ) { ListNumberingDefinition lnd = getInstanceListDefinitions().get(concreteListId.toString()); if (lnd==null) { log.warn("No ListNumberingDefinition entry with ID " + concreteListId.toString());
Emulator em = numberingPart.getEmulator(); if (numberingPart.getInstanceListDefinitions().containsKey(numId) && numberingPart.getInstanceListDefinitions().get(numId).LevelExists( levelId)) { numberingPart.getInstanceListDefinitions().get(numId).IncrementCounter( levelId); triple.numString = numberingPart.getInstanceListDefinitions().get(numId) .GetCurrentNumberString(levelId); String font = numberingPart.getInstanceListDefinitions().get(numId) .GetFont(levelId); if (numberingPart.getInstanceListDefinitions().get(numId).IsBullet(levelId)) { triple.bullet = numberingPart.getInstanceListDefinitions().get(numId).getLevel(levelId).getLevelText(); triple.lvl = numberingPart.getInstanceListDefinitions().get(numId).getLevel(levelId).getJaxbAbstractLvl(); } else if (!numberingPart.getInstanceListDefinitions().containsKey(numId)){ } else if (!numberingPart.getInstanceListDefinitions().get(numId).LevelExists( levelId)){
ListNumberingDefinition lnd = ndp.getInstanceListDefinitions().get(numId.toString()); if (lnd==null) {
if (node == node.getParent().getFirstChild()) { newNum = listOptions.isOrderedListManualStart() ? ((OrderedList) node.getParent()).getStartNumber() : 1; numId = ndp.restart(numId, listLevel, newNum); ensureNumberedListLength(listLevel); numberedLists[listLevel] = numId; if (node == node.getParent().getFirstChild()) { newNum = 1; numId = ndp.restart(numId, listLevel, newNum); ensureBulletListLength(listLevel); bulletLists[listLevel] = numId;
public BigInteger getNumPrFor(BigInteger baseNumID, Color color) { RPr rPr = getResolver().getEffectiveRPr(myOptions.PREFORMATTED_TEXT_STYLE); if (rPr != null && rPr.getColor() != null) { if (keepDiff(rPr.getColor(), color) == null) { return baseNumID; } } String colorID = String.format("%s:%s", baseNumID.toString(), color.getVal()); final BigInteger numID = myNumPrColorMap.get(colorID); if (numID != null) { return numID; } // we create a copy of the baseNubPr and add the changed color property final NumberingDefinitionsPart ndp = myDocumentPart.getNumberingDefinitionsPart(); try { final Numbering numbering = ndp.getContents(); final List<Numbering.Num> num = numbering.getNum(); final List<Numbering.AbstractNum> abstractNumList = numbering.getAbstractNum(); for (Numbering.AbstractNum abstractNum : abstractNumList) { if (abstractNum.getAbstractNumId().compareTo(baseNumID) == 0) { // we have our list to copy // TODO: create a copy and set the color it the list's rpr. } } return null; } catch (Docx4JException e) { e.printStackTrace(); } return null; }
log.debug("No NumberingDefinitions part - so adding"); try { ndp = new NumberingDefinitionsPart(); wordMLPackage.getMainDocumentPart().addTargetPart(ndp); ndp.setJaxbElement( Context.getWmlObjectFactory().createNumbering() ); } catch (InvalidFormatException e1) {
int nextId = getAbstractListDefinitions().size(); do { nextId++; } while (getAbstractListDefinitions().containsKey( "" + nextId )); abstractNum.setAbstractNumId( BigInteger.valueOf(nextId) ); this.getJaxbElement().getAbstractNum().add(abstractNum); num.setAbstractNumId(abstractNumId); nextId = getInstanceListDefinitions().size(); do { nextId++; } while (getInstanceListDefinitions().containsKey( "" + nextId )); num.setNumId( BigInteger.valueOf(nextId) ); this.getJaxbElement().getNum().add(num);
public Part CreateNumberingPartObject(String partName) throws InvalidFormatException { return new NumberingDefinitionsPart(new PartName(partName)); }
ListNumberingDefinition lnd = getInstanceListDefinitions().get(numId ); if (lnd==null) { log.debug("couldn't find list for numId: " + numId); if (jaxbOverrideLvl!=null) { Ind ind = getIndFromLvl(jaxbOverrideLvl); if (ind!=null) { log.debug("Got it.."); Ind ind = getIndFromLvl(abstractLvl);
for (Numbering.AbstractNum abstractNum : getJaxbElement().getAbstractNum() ) { ListNumberingDefinition lnd = getInstanceListDefinitions().get(concreteListId.toString()); if (lnd==null) { log.warn("No ListNumberingDefinition entry with ID " + concreteListId.toString());
Emulator em = numberingPart.getEmulator(); if (numberingPart.getInstanceListDefinitions().containsKey(numId) && numberingPart.getInstanceListDefinitions().get(numId).LevelExists( levelId)) { numberingPart.getInstanceListDefinitions().get(numId).IncrementCounter( levelId); triple.numString = numberingPart.getInstanceListDefinitions().get(numId) .GetCurrentNumberString(levelId); String font = numberingPart.getInstanceListDefinitions().get(numId) .GetFont(levelId); if (numberingPart.getInstanceListDefinitions().get(numId).IsBullet(levelId)) { triple.bullet = numberingPart.getInstanceListDefinitions().get(numId).getLevel(levelId).getLevelText(); triple.lvl = numberingPart.getInstanceListDefinitions().get(numId).getLevel(levelId).getJaxbAbstractLvl(); } else if (!numberingPart.getInstanceListDefinitions().containsKey(numId)){ } else if (!numberingPart.getInstanceListDefinitions().get(numId).LevelExists( levelId)){
if (numberingPart.getInstanceListDefinitions().containsKey(numId) && numberingPart.getInstanceListDefinitions().get(numId).LevelExists( levelId)) { Lvl lvl = numberingPart.getInstanceListDefinitions().get(numId).getLevel(levelId).getJaxbAbstractLvl(); PPr ppr = lvl.getPPr();