Example #1
0
static DFNode *WordBookmarkGet(WordGetData *get, DFNode *concrete)
{
    if (!WordBookmarkIsVisible2(concrete))
        return NULL;
    DFNode *abstract = WordConverterCreateAbstract(get,HTML_SPAN,concrete);
    DFSetAttribute(abstract,HTML_CLASS,DFBookmarkClass);
    WordContainerGet(get,&WordParagraphContentLens,abstract,concrete);
    return abstract;
}
Example #2
0
static DFNode *WordRunGet(WordGetData *get, DFNode *concrete)
{
    assert(concrete->tag == WORD_R);

    // First check the run to see if it's a footnote or endnote reference. These need to be handled specially,
    // as we place the actual content of the footnote or endnote in-line in the HTML output.
    DFNode *note = WordRunGetNote(get,concrete);
    if (note != NULL)
        return note;

    // If we didn't find a footnote or endnote reference, treat it as a normal content run
    assert(concrete->tag == WORD_R);
    DFNode *rPr = DFChildWithTag(concrete,WORD_RPR);
    CSSProperties *properties = CSSPropertiesNew();
    const char *styleId = NULL;
    if (rPr != NULL)
        WordGetRPr(rPr,properties,&styleId,get->conv->theme);;

    const char *selector = WordSheetSelectorForStyleId(get->conv->styles,"character",styleId);
    Tag elementName = (selector == NULL) ? HTML_SPAN : CSSSelectorGetTag(selector);
    char *className = (selector == NULL) ? NULL : CSSSelectorCopyClassName(selector);
    DFNode *abstract = WordConverterCreateAbstract(get,elementName,concrete);
    DFSetAttribute(abstract,HTML_CLASS,className);
    free(className);

    DFHashTable *collapsed = CSSCollapseProperties(properties);
    char *styleValue = CSSSerializeProperties(collapsed);
    DFHashTableRelease(collapsed);
    if (strlen(styleValue) > 0)
        DFSetAttribute(abstract,HTML_STYLE,styleValue);
    free(styleValue);

    CSSPropertiesRelease(properties);

    WordContainerGet(get,&WordRunContentLens,abstract,concrete);
    return abstract;
}
static DFNode *WordTcGet(WordGetData *get, DFNode *concrete)
{
    DFNode *abstract = WordTcCreateAbstractNode(get,concrete);
    WordContainerGet(get,&WordBlockLevelLens,abstract,concrete);
    return abstract;
}