function(id) {
    // if the style doesn't exist return null
    var style = this.model.styles[id];
    if (!style) return null;

    // have we built this model before?
    var model = this.index.model[id];
    if (model) return model;

    // build a new model
    model = this.index.model[id] = {};

    // -------------------------------------------------------
    // number format
    if (style.numFmtId) {
      var numFmt = this.index.numFmt[style.numFmtId] || NumFmtXform.getDefaultFmtCode(style.numFmtId);
      if (numFmt) {
        model.numFmt = numFmt;
      }
    }

    function addStyle(name, group, styleId) {
      if (styleId) {
        var part = group[styleId];
        if (part) {
          model[name] = part;
        }
      }
    }

    addStyle('font', this.model.fonts, style.fontId);
    addStyle('border', this.model.borders, style.borderId);
    addStyle('fill', this.model.fills, style.fillId);

    // -------------------------------------------------------
    // alignment
    if (style.alignment) {
      model.alignment = style.alignment;
    }

    return model;
  }
function(id) {
    // if the style doesn't exist return null
    var style = this.model.styles[id];
    if (!style) return null;

    // have we built this model before?
    var model = this.index.model[id];
    if (model) return model;

    // build a new model
    model = this.index.model[id] = {};

    // -------------------------------------------------------
    // number format
    if (style.numFmtId) {
      var numFmt = this.index.numFmt[style.numFmtId] || NumFmtXform.getDefaultFmtCode(style.numFmtId);
      if (numFmt) {
        model.numFmt = numFmt;
      }
    }

    function addStyle(name, group, styleId) {
      if (styleId) {
        var part = group[styleId];
        if (part) {
          model[name] = part;
        }
      }
    }

    addStyle('font', this.model.fonts, style.fontId);
    addStyle('border', this.model.borders, style.borderId);
    addStyle('fill', this.model.fills, style.fillId);

    // -------------------------------------------------------
    // alignment
    if (style.alignment) {
      model.alignment = style.alignment;
    }

    return model;
  }
function ( id ) { // if the style doesn't exist return null var style = this . model . styles [ id ] ; if ( ! style ) return null ; // have we built this model before? var model = this . index . model [ id ] ; if ( model ) return model ; // build a new model model = this . index . model [ id ] = { } ; // ------------------------------------------------------- // number format if ( style . numFmtId ) { var numFmt = this . index . numFmt [ style . numFmtId ] || NumFmtXform . getDefaultFmtCode ( style . numFmtId ) ; if ( numFmt ) { model . numFmt = numFmt ; } } function addStyle ( name , group , styleId ) { if ( styleId ) { var part = group [ styleId ] ; if ( part ) { model [ name ] = part ; } } } addStyle ( 'font' , this . model . fonts , style . fontId ) ; addStyle ( 'border' , this . model . borders , style . borderId ) ; addStyle ( 'fill' , this . model . fills , style . fillId ) ; // ------------------------------------------------------- // alignment if ( style . alignment ) { model . alignment = style . alignment ; } return model ; }
given a styleId (i.e. s="n"), get the cell's style model objects are shared where possible.
given a styleId ( i . e . s = n ) get the cell s style model objects are shared where possible .
returns a model for the given id