Re: OpenDocument - Second Header/Footer patch

From: Dom Lachowicz <domlachowicz_at_yahoo.com>
Date: Wed Aug 10 2005 - 03:44:38 CEST

Hi Daniel,

I've committed both of your patches. I had to make a
few small changes to the first one for it to compile
using GCC 3.4.

These patches look pretty good - I really liked this
last one. Keep up the nice work :)

Best,
Dom

--- Daniel d'Andrada Tenório de Carvalho
<daniel.carvalho@indt.org.br> wrote:

> Hi guys,
>
> Here is the next header/footer patch. It now
> supports different
> header/footer on facing pages.
>
> It think that's it for headers and footers, at least
> for now. So, I will
> start the work on lists.
>
> Best Regards,
> Daniel d'Andrada T. de Carvalho - INdT
> > diff -u -N -r
>
./OpenDocument-2005-08-08/xp/OD_ContentStream_ListenerState.cpp
>
./AbiWord-CVS-20050621/abiword-plugins/wp/impexp/OpenDocument/xp/OD_ContentStream_ListenerState.cpp
> ---
>
./OpenDocument-2005-08-08/xp/OD_ContentStream_ListenerState.cpp
> 2005-08-03 18:28:11.000000000 -0300
> +++
>
./AbiWord-CVS-20050621/abiword-plugins/wp/impexp/OpenDocument/xp/OD_ContentStream_ListenerState.cpp
> 2005-08-09 16:50:11.163612240 -0300
> @@ -80,7 +80,7 @@
> if (!UT_strcmp("office:automatic-styles",
>
> m_elementStack.getStartTag(0)->getName())) {
>
> - pStyle = m_pStyles->addStyle(ppAtts,
> true);
> + pStyle = m_pStyles->addStyle(ppAtts,
> true, true);
> rAction.pushState(pStyle, false);
>
> } else {
> diff -u -N -r
> ./OpenDocument-2005-08-08/xp/OD_Office_Styles.cpp
>
./AbiWord-CVS-20050621/abiword-plugins/wp/impexp/OpenDocument/xp/OD_Office_Styles.cpp
> ---
> ./OpenDocument-2005-08-08/xp/OD_Office_Styles.cpp
> 2005-08-03 17:59:14.000000000 -0300
> +++
>
./AbiWord-CVS-20050621/abiword-plugins/wp/impexp/OpenDocument/xp/OD_Office_Styles.cpp
> 2005-08-09 13:44:39.869826112 -0300
> @@ -40,7 +40,50 @@
> * Destructor
> */
> OD_Office_Styles::~OD_Office_Styles() {
> +
> + UT_GenericVector<OD_Style_Style*>*
> pStyleVector;
> + UT_GenericVector<OD_Style_PageLayout*>*
> pPageLayoutVector;
> + UT_GenericVector<OD_Style_MasterPage*>*
> pMasterPageVector;
> + UT_uint32 i, count;
> +
> +
> UT_VECTOR_PURGEALL(UT_UTF8String*,
> m_removedParagraphStyles);
> +
> + pStyleVector = m_textStyleStyles.enumerate();
> + count = pStyleVector->getItemCount();
> + for (i=0; i<count; i++) {
> + delete (*pStyleVector)[i];
> + }
> +
> +
> + pStyleVector =
> m_paragraphStyleStyles.enumerate();
> + count = pStyleVector->getItemCount();
> + for (i=0; i<count; i++) {
> + delete (*pStyleVector)[i];
> + }
> +
> +
> + pStyleVector =
> m_sectionStyleStyles.enumerate();
> + count = pStyleVector->getItemCount();
> + for (i=0; i<count; i++) {
> + delete (*pStyleVector)[i];
> + }
> +
> +
> + pPageLayoutVector =
> m_pageLayoutStyles.enumerate();
> + count = pPageLayoutVector->getItemCount();
> + for (i=0; i<count; i++) {
> + delete (*pPageLayoutVector)[i];
> + }
> +
> +
> + pMasterPageVector =
> m_masterPageStyles.enumerate();
> + count = pMasterPageVector->getItemCount();
> + for (i=0; i<count; i++) {
> + delete (*pMasterPageVector)[i];
> + }
> +
> + DELETEP(m_pParagraphDefaultStyle);
> }
>
>
> @@ -56,7 +99,7 @@
> * specified style is not currently
> supported (like graphic styles).
> */
> OD_Style_Style* OD_Office_Styles::addStyle(const
> XML_Char** ppAtts,
> - bool
> bAutomatic) {
> + bool
> bAutomatic, bool bOnContentStream) {
>
> const XML_Char* pAttrValue;
> OD_Style_Style* pStyle;
> @@ -65,27 +108,56 @@
> pAttrValue = UT_getAttribute("style:family",
> ppAtts);
> UT_ASSERT(pAttrValue);
>
> - if(!UT_strcmp(pAttrValue, "text")) {
> -
> - pStyle = new OD_Style_Style(bAutomatic);
> - pAttrValue = UT_getAttribute("style:name",
> ppAtts);
> - ok = m_textStyleStyles.insert(pAttrValue,
> pStyle);
> -
> - } else if(!UT_strcmp(pAttrValue, "paragraph"))
> {
> -
> - pStyle = new OD_Style_Style(bAutomatic);
> - pAttrValue = UT_getAttribute("style:name",
> ppAtts);
> - ok =
> m_paragraphStyleStyles.insert(pAttrValue, pStyle);
> -
> - } else if(!UT_strcmp(pAttrValue, "section")) {
> + if (bOnContentStream) {
> +
> + if(!UT_strcmp(pAttrValue, "text")) {
> +
> + pStyle = new
> OD_Style_Style(bAutomatic);
> + pAttrValue =
> UT_getAttribute("style:name", ppAtts);
> + ok =
> m_textStyleStyles_contentStream.insert(pAttrValue,
> pStyle);
> +
> + } else if(!UT_strcmp(pAttrValue,
> "paragraph")) {
> +
> + pStyle = new
> OD_Style_Style(bAutomatic);
> + pAttrValue =
> UT_getAttribute("style:name", ppAtts);
> + ok =
>
m_paragraphStyleStyles_contentStream.insert(pAttrValue,
> pStyle);
> +
> + } else if(!UT_strcmp(pAttrValue,
> "section")) {
> +
> + pStyle = new
> OD_Style_Style(bAutomatic);
> + pAttrValue =
> UT_getAttribute("style:name", ppAtts);
> + ok =
>
m_sectionStyleStyles_contentStream.insert(pAttrValue,
> pStyle);
> +
> + } else {
> + // We don't recognize it, yet.
> + return NULL;
> + }
> +
> + } else {
>
> - pStyle = new OD_Style_Style(bAutomatic);
> - pAttrValue = UT_getAttribute("style:name",
> ppAtts);
> - ok =
> m_sectionStyleStyles.insert(pAttrValue, pStyle);
> + if(!UT_strcmp(pAttrValue, "text")) {
> +
> + pStyle = new
> OD_Style_Style(bAutomatic);
> + pAttrValue =
> UT_getAttribute("style:name", ppAtts);
> + ok =
> m_textStyleStyles.insert(pAttrValue, pStyle);
> +
> + } else if(!UT_strcmp(pAttrValue,
> "paragraph")) {
> +
> + pStyle = new
> OD_Style_Style(bAutomatic);
> + pAttrValue =
> UT_getAttribute("style:name", ppAtts);
> + ok =
> m_paragraphStyleStyles.insert(pAttrValue, pStyle);
> +
> + } else if(!UT_strcmp(pAttrValue,
> "section")) {
> +
> + pStyle = new
> OD_Style_Style(bAutomatic);
> + pAttrValue =
> UT_getAttribute("style:name", ppAtts);
> + ok =
> m_sectionStyleStyles.insert(pAttrValue, pStyle);
> +
> + } else {
>
=== message truncated ===

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Received on Wed Aug 10 03:44:23 2005

This archive was generated by hypermail 2.1.8 : Wed Aug 10 2005 - 03:44:24 CEST