add the merge flags to the item set dump

Change-Id: I5f8b73d7f1c7904c230f43fa4e9c7f62dff89b50
Reviewed-on: https://gerrit.libreoffice.org/36312
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx
index 414fdcd..de789fb 100644
--- a/sc/inc/attrib.hxx
+++ b/sc/inc/attrib.hxx
@@ -76,6 +76,8 @@ public:
                nRowMerge = rMerge.nRowMerge;
                return *this;
            }

    virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const override;
};

class SC_DLLPUBLIC ScMergeFlagAttr: public SfxInt16Item
@@ -99,6 +101,8 @@ public:

    bool    HasPivotButton() const;
    bool    HasPivotPopupButton() const;

    virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const override;
};

class SC_DLLPUBLIC ScProtectionAttr: public SfxPoolItem
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
index 8f10dff..dbd9c27 100644
--- a/sc/source/core/data/attrib.cxx
+++ b/sc/source/core/data/attrib.cxx
@@ -137,6 +137,15 @@ SfxPoolItem* ScMergeAttr::Create( SvStream& rStream, sal_uInt16 /* nVer */ ) con
    return new ScMergeAttr(static_cast<SCCOL>(nCol),static_cast<SCROW>(nRow));
}

void ScMergeAttr::dumpAsXml(xmlTextWriterPtr pWriter) const
{
    xmlTextWriterStartElement(pWriter, BAD_CAST("ScMergeAttr"));
    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("col-merge"), BAD_CAST(OString::number(GetColMerge()).getStr()));
    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("row-merge"), BAD_CAST(OString::number(GetRowMerge()).getStr()));
    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("merged"), BAD_CAST(OString::boolean(IsMerged()).getStr()));
    xmlTextWriterEndElement(pWriter);
}

/**
 * MergeFlag
 */
@@ -169,6 +178,19 @@ bool ScMergeFlagAttr::HasPivotPopupButton() const
    return bool(GetValue() & ScMF::ButtonPopup);
}

void ScMergeFlagAttr::dumpAsXml(xmlTextWriterPtr pWriter) const
{
    xmlTextWriterStartElement(pWriter, BAD_CAST("ScMergeFlagAttr"));
    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("overlapped"), BAD_CAST(OString::boolean(IsOverlapped()).getStr()));
    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("hor_overlapped"), BAD_CAST(OString::boolean(IsHorOverlapped()).getStr()));
    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("ver_overlapped"), BAD_CAST(OString::boolean(IsVerOverlapped()).getStr()));
    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("autofilter"), BAD_CAST(OString::boolean(HasAutoFilter()).getStr()));
    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("scenario"), BAD_CAST(OString::boolean(IsScenario()).getStr()));
    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("pivot-button"), BAD_CAST(OString::boolean(HasPivotButton()).getStr()));
    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("pivot-popup-button"), BAD_CAST(OString::boolean(HasPivotPopupButton()).getStr()));
    xmlTextWriterEndElement(pWriter);
}

/**
 * Protection
 */