/** * Sets the custom properties. * * @param customProperties The custom properties */ public void setCustomProperties(final CustomProperties customProperties) { ensureSection2(); final Section section = getSections().get(1); final Map<Long,String> dictionary = customProperties.getDictionary(); // section.clear(); /* Set the codepage. If both custom properties and section have a * codepage, the codepage from the custom properties wins, else take the * one that is defined. If none is defined, take ISO-8859-1. */ int cpCodepage = customProperties.getCodepage(); if (cpCodepage < 0) { cpCodepage = section.getCodepage(); } if (cpCodepage < 0) { cpCodepage = Property.DEFAULT_CODEPAGE; } customProperties.setCodepage(cpCodepage); section.setCodepage(cpCodepage); section.setDictionary(dictionary); for (CustomProperty p : customProperties.properties()) { section.setProperty(p); } }
/** * <p>Sets the custom properties.</p> * * @param customProperties The custom properties */ public void setCustomProperties(final CustomProperties customProperties) { ensureSection2(); final MutableSection section = (MutableSection) getSections().get(1); final Map<Long,String> dictionary = customProperties.getDictionary(); section.clear(); /* Set the codepage. If both custom properties and section have a * codepage, the codepage from the custom properties wins, else take the * one that is defined. If none is defined, take Unicode. */ int cpCodepage = customProperties.getCodepage(); if (cpCodepage < 0) cpCodepage = section.getCodepage(); if (cpCodepage < 0) cpCodepage = Constants.CP_UNICODE; customProperties.setCodepage(cpCodepage); section.setCodepage(cpCodepage); section.setDictionary(dictionary); for (final Iterator<CustomProperty> i = customProperties.values().iterator(); i.hasNext();) { final Property p = i.next(); section.setProperty(p); } }
/** * <p>Sets the custom properties.</p> * * @param customProperties The custom properties */ public void setCustomProperties(final CustomProperties customProperties) { ensureSection2(); final MutableSection section = (MutableSection) getSections().get(1); final Map<Long,String> dictionary = customProperties.getDictionary(); section.clear(); /* Set the codepage. If both custom properties and section have a * codepage, the codepage from the custom properties wins, else take the * one that is defined. If none is defined, take Unicode. */ int cpCodepage = customProperties.getCodepage(); if (cpCodepage < 0) cpCodepage = section.getCodepage(); if (cpCodepage < 0) cpCodepage = Constants.CP_UNICODE; customProperties.setCodepage(cpCodepage); section.setCodepage(cpCodepage); section.setDictionary(dictionary); for (final Iterator<CustomProperty> i = customProperties.values().iterator(); i.hasNext();) { final Property p = i.next(); section.setProperty(p); } }
/** * Sets the custom properties. * * @param customProperties The custom properties */ public void setCustomProperties(final CustomProperties customProperties) { ensureSection2(); final Section section = getSections().get(1); final Map<Long,String> dictionary = customProperties.getDictionary(); // section.clear(); /* Set the codepage. If both custom properties and section have a * codepage, the codepage from the custom properties wins, else take the * one that is defined. If none is defined, take ISO-8859-1. */ int cpCodepage = customProperties.getCodepage(); if (cpCodepage < 0) { cpCodepage = section.getCodepage(); } if (cpCodepage < 0) { cpCodepage = Property.DEFAULT_CODEPAGE; } customProperties.setCodepage(cpCodepage); section.setCodepage(cpCodepage); section.setDictionary(dictionary); for (CustomProperty p : customProperties.properties()) { section.setProperty(p); } }