Skip to content

Trouble with updating runs in header table with data #759

@peterykt

Description

@peterykt

I think i find bug with getting table data in header
in class XWPFHeader
method
OnDocumentRead
when reading
headerFooter.Items
it should be

foreach (object o in headerFooter.Items)
                {
                    if (o is CT_SdtBlock)
                    {
                        foreach (object oo in ((CT_SdtBlock) o).sdtContent.Items)
                        {
                            if (oo is CT_P)
                            {
                                XWPFParagraph p = new XWPFParagraph((CT_P) oo, this);
                                paragraphs.Add(p);
                                bodyElements.Add(p);
                            }
                            if (oo is CT_Tbl)
                            {
                                XWPFTable t = new XWPFTable((CT_Tbl) oo, this);
                                tables.Add(t);
                                bodyElements.Add(t);
                            }
                            if (oo is CT_SdtBlock)
                            {
                                XWPFSDT c = new XWPFSDT((CT_SdtBlock) oo, this);
                                bodyElements.Add(c);
                            }
                        }
                    }
                }
            }

because it has CT_StdBlock
But i still has a bug - it create multiple headers (3 times) with one replaced header

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions