Ejemplo n.º 1
0
ODe_Style_PageLayout* ODe_AutomaticStyles::addPageLayout() {
    ODe_Style_PageLayout* pStyle;
    UT_UTF8String styleName;
   
    UT_UTF8String_sprintf(styleName, "PLayout%d", m_pageLayouts.size() + 1);
    
    pStyle = new ODe_Style_PageLayout();
    pStyle->setName(styleName);
    
    m_pageLayouts.insert(styleName.utf8_str(), pStyle);
    
    return pStyle;
}
/**
 * Do all necessary work before starting to listen the AbiWord document.
 */
bool ODe_DocumentData::doPreListeningWork() {
    bool ok;
    
    ok = m_styles.fetchRegularStyleStyles();
    if (!ok) {
        return false;
    }


    /////
    // Creates a <style:page-layout> from the info that goes on the <pagesize>
    // tag of abw files.
    ODe_Style_PageLayout* pPageLayout;
    
    pPageLayout = new ODe_Style_PageLayout();
    pPageLayout->setName("Standard");
    
    m_stylesAutoStyles.addPageLayout(pPageLayout);

    pPageLayout->fetchAttributesFromAbiDoc(m_pAbiDoc);
    
    
    
    // Create the "Standard" master page style
    ODe_Style_MasterPage* pMPStyle;
    pMPStyle = new ODe_Style_MasterPage("Standard", "Standard");
    m_masterStyles.insert("Standard", pMPStyle);
    
    
    m_pOfficeTextTemp = gsf_output_memory_new();
    if (m_pOfficeTextTemp == NULL) {
        return false;
    }
    
    // If we've reached this point, everything is fine.
    return true;
}