/*
 * SDK Pullenti Unitext, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software. 
 * This class is generated using the converter Unisharping (www.unisharping.ru) from Pullenti C# project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

package com.pullenti.unitext.internal.misc;

public class OdtHelper {

    private java.util.HashMap<String, OdtStyle> m_Styles = new java.util.HashMap<String, OdtStyle>();

    private java.util.HashMap<String, com.pullenti.unitext.internal.uni.UnitextGenNumStyle> m_Nums = new java.util.HashMap<String, com.pullenti.unitext.internal.uni.UnitextGenNumStyle>();

    private com.pullenti.unitext.internal.uni.UnitextGenNumStyle m_OutlineNum;

    public static class OdtStyle {
    
        public String name;
    
        public String parentName;
    
        public String fontFamily;
    
        public boolean isSuper;
    
        public boolean isSub;
    
        public boolean isWingdings;
    
        public boolean isSymbol;
    
        public String numStyleId;
    
        public String tableWidth;
    
        public double tableColumnWidth;
        public OdtStyle() {
        }
    }


    public com.pullenti.unitext.UnitextDocument createUni(org.w3c.dom.Node xml, org.w3c.dom.Node styles) {
        if (com.pullenti.unisharp.Utils.stringsNe(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "document-content")) 
            return null;
        com.pullenti.unitext.UnitextDocument doc = com.pullenti.unitext.UnitextDocument._new47(com.pullenti.unitext.FileFormat.ODT);
        com.pullenti.unitext.UnitextPagesection sect = new com.pullenti.unitext.UnitextPagesection();
        if (styles != null) {
            for (org.w3c.dom.Node x : (new com.pullenti.unisharp.XmlNodeListWrapper(styles.getChildNodes())).arr) {
                if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(x), "master-styles")) {
                    for (org.w3c.dom.Node xx : (new com.pullenti.unisharp.XmlNodeListWrapper(x.getChildNodes())).arr) {
                        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xx), "master-page")) {
                            for (org.w3c.dom.Node xxx : (new com.pullenti.unisharp.XmlNodeListWrapper(xx.getChildNodes())).arr) {
                                if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xxx), "header")) {
                                    com.pullenti.unitext.internal.uni.UnitextGen gg = new com.pullenti.unitext.internal.uni.UnitextGen();
                                    this._readGen0(xxx, gg, true, null, 0);
                                    sect.items.add(com.pullenti.unitext.UnitextPagesectionItem._new48(gg.finish(true, null)));
                                }
                                else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xxx), "footer")) {
                                    com.pullenti.unitext.internal.uni.UnitextGen gg = new com.pullenti.unitext.internal.uni.UnitextGen();
                                    this._readGen0(xxx, gg, true, null, 0);
                                    sect.items.add(com.pullenti.unitext.UnitextPagesectionItem._new49(true, gg.finish(true, null)));
                                }
                            }
                            break;
                        }
                    }
                }
                else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(x), "styles")) {
                    for (org.w3c.dom.Node xx : (new com.pullenti.unisharp.XmlNodeListWrapper(x.getChildNodes())).arr) {
                        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xx), "style")) 
                            this._readStyle(xx);
                        else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xx), "list-style")) 
                            this._readListStyle(xx);
                    }
                }
            }
        }
        if (sect.items.size() > 0) 
            doc.sections.add(sect);
        for (org.w3c.dom.Node x : (new com.pullenti.unisharp.XmlNodeListWrapper(xml.getChildNodes())).arr) {
            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(x), "automatic-styles")) {
                for (org.w3c.dom.Node xx : (new com.pullenti.unisharp.XmlNodeListWrapper(x.getChildNodes())).arr) {
                    if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xx), "style")) 
                        this._readStyle(xx);
                    else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xx), "list-style")) 
                        this._readListStyle(xx);
                }
            }
            else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(x), "body")) {
                com.pullenti.unitext.internal.uni.UnitextGen gen = new com.pullenti.unitext.internal.uni.UnitextGen();
                this._readGen0(x, gen, false, null, 0);
                doc.content = gen.finish(true, null);
            }
        }
        doc.optimize(false, null);
        if (doc.content == null) 
            return null;
        return doc;
    }

    private void _readStyle(org.w3c.dom.Node xx) {
        OdtStyle sty = new OdtStyle();
        if (xx.getAttributes() != null) {
            for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(xx.getAttributes())).arr) {
                if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "name")) 
                    sty.name = a.getNodeValue();
                else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "family")) 
                    sty.fontFamily = a.getNodeValue();
                else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "parent-style-name")) 
                    sty.parentName = a.getNodeValue();
                else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "list-style-name")) 
                    sty.numStyleId = a.getNodeValue();
            }
        }
        if (sty.name == null || m_Styles.containsKey(sty.name)) 
            return;
        m_Styles.put(sty.name, sty);
        for (org.w3c.dom.Node p : (new com.pullenti.unisharp.XmlNodeListWrapper(xx.getChildNodes())).arr) {
            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(p), "text-properties")) {
                if (p.getAttributes() != null) {
                    for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(p.getAttributes())).arr) {
                        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "text-position")) {
                            if (a.getNodeValue().startsWith("super")) 
                                sty.isSuper = true;
                            else if (a.getNodeValue().startsWith("sub")) 
                                sty.isSub = true;
                        }
                        else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "font-name")) {
                            if (com.pullenti.unisharp.Utils.stringsEq(a.getNodeValue(), "Wingdings")) 
                                sty.isWingdings = true;
                            else if (com.pullenti.unisharp.Utils.stringsEq(a.getNodeValue(), "Symbol")) 
                                sty.isSymbol = true;
                        }
                    }
                }
            }
            else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(p), "table-column-properties")) {
                if (p.getAttributes() != null) {
                    for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(p.getAttributes())).arr) {
                        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "column-width")) {
                            int dd = com.pullenti.unitext.internal.uni.UnitextGen.convertToMM(a.getNodeValue(), null);
                            if (dd > 0) {
                                sty.tableColumnWidth = (double)dd;
                                continue;
                            }
                            String vv = a.getNodeValue();
                            if (vv.endsWith("in")) 
                                vv = vv.substring(0, 0 + vv.length() - 2);
                            double d;
                            com.pullenti.unisharp.Outargwrapper<Double> wrapd108 = new com.pullenti.unisharp.Outargwrapper<Double>();
                            boolean inoutres109 = com.pullenti.util.MiscHelper.tryParseDouble(vv, wrapd108);
                            d = (wrapd108.value != null ? wrapd108.value : 0);
                            if (inoutres109) 
                                sty.tableColumnWidth = d;
                        }
                    }
                }
            }
            else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(p), "table-properties")) {
                if (p.getAttributes() != null) {
                    for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(p.getAttributes())).arr) {
                        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "width")) 
                            sty.tableWidth = a.getNodeValue();
                    }
                }
            }
        }
    }

    private void _readListStyle(org.w3c.dom.Node xx) {
        String nam = null;
        if (xx.getAttributes() != null) {
            for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(xx.getAttributes())).arr) {
                if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "name")) 
                    nam = a.getNodeValue();
            }
        }
        if (nam == null) 
            return;
        com.pullenti.unitext.internal.uni.UnitextGenNumStyle num = com.pullenti.unitext.internal.uni.UnitextGenNumStyle._new110(nam);
        this._readOdtNumStyle(num, xx);
        if (!m_Nums.containsKey(nam)) 
            m_Nums.put(nam, num);
    }

    private void _readOdtNumStyle(com.pullenti.unitext.internal.uni.UnitextGenNumStyle num, org.w3c.dom.Node xml) {
        for (org.w3c.dom.Node x : (new com.pullenti.unisharp.XmlNodeListWrapper(xml.getChildNodes())).arr) {
            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(x), "list-level-style-number")) {
                com.pullenti.unitext.internal.uni.UniTextGenNumLevel lev = new com.pullenti.unitext.internal.uni.UniTextGenNumLevel();
                num.levels.add(lev);
                String pref = null;
                String suf = null;
                String frm = "1";
                int cou = 1;
                if (x.getAttributes() != null) {
                    for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(x.getAttributes())).arr) {
                        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "num-suffix")) 
                            suf = a.getNodeValue();
                        else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "num-prefix")) 
                            pref = a.getNodeValue();
                        else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "num-format")) 
                            frm = a.getNodeValue();
                        else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "display-levels")) {
                            com.pullenti.unisharp.Outargwrapper<Integer> wrapcou111 = new com.pullenti.unisharp.Outargwrapper<Integer>();
                            com.pullenti.unisharp.Utils.parseInteger(a.getNodeValue(), 0, null, wrapcou111);
                            cou = (wrapcou111.value != null ? wrapcou111.value : 0);
                        }
                        else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "start-value")) {
                            int nn;
                            com.pullenti.unisharp.Outargwrapper<Integer> wrapnn112 = new com.pullenti.unisharp.Outargwrapper<Integer>();
                            boolean inoutres113 = com.pullenti.unisharp.Utils.parseInteger(a.getNodeValue(), 0, null, wrapnn112);
                            nn = (wrapnn112.value != null ? wrapnn112.value : 0);
                            if (inoutres113) 
                                lev.start = nn;
                        }
                    }
                }
                if (com.pullenti.unisharp.Utils.stringsEq(frm, "1")) 
                    lev.type = com.pullenti.unitext.internal.uni.UniTextGenNumType.DECIMAL;
                else if (com.pullenti.unisharp.Utils.stringsEq(frm, "a")) 
                    lev.type = com.pullenti.unitext.internal.uni.UniTextGenNumType.LOWERLETTER;
                else if (com.pullenti.unisharp.Utils.stringsEq(frm, "A")) 
                    lev.type = com.pullenti.unitext.internal.uni.UniTextGenNumType.UPPERLETTER;
                else if (com.pullenti.unisharp.Utils.stringsEq(frm, "i")) 
                    lev.type = com.pullenti.unitext.internal.uni.UniTextGenNumType.LOWERROMAN;
                else if (com.pullenti.unisharp.Utils.stringsEq(frm, "I")) 
                    lev.type = com.pullenti.unitext.internal.uni.UniTextGenNumType.UPPERROMAN;
                else if (frm.startsWith("А")) 
                    lev.type = com.pullenti.unitext.internal.uni.UniTextGenNumType.UPPERCYRLETTER;
                else if (frm.startsWith("а")) 
                    lev.type = com.pullenti.unitext.internal.uni.UniTextGenNumType.LOWERCYRLETTER;
                StringBuilder tmp = new StringBuilder();
                if (pref != null) 
                    tmp.append(pref);
                for (int i = (num.levels.size() + 1) - cou; i <= num.levels.size(); i++) {
                    String prevFrm = null;
                    if (i < num.levels.size()) 
                        prevFrm = num.levels.get(i - 1).format;
                    if (!com.pullenti.unisharp.Utils.isNullOrEmpty(prevFrm) && prevFrm.charAt(0) != '%') 
                        tmp.append(prevFrm.charAt(0));
                    tmp.append("%").append(i);
                    if (!com.pullenti.unisharp.Utils.isNullOrEmpty(prevFrm) && !Character.isDigit(prevFrm.charAt(prevFrm.length() - 1))) 
                        tmp.append(prevFrm.charAt(prevFrm.length() - 1));
                }
                if (suf != null) 
                    tmp.append(suf);
                lev.format = tmp.toString();
            }
            else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(x), "list-level-style-bullet")) {
                com.pullenti.unitext.internal.uni.UniTextGenNumLevel lev = com.pullenti.unitext.internal.uni.UniTextGenNumLevel._new114(com.pullenti.unitext.internal.uni.UniTextGenNumType.BULLET);
                if (x.getAttributes() != null) {
                    for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(x.getAttributes())).arr) {
                        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "bullet-char")) 
                            lev.format = a.getNodeValue();
                    }
                }
                num.levels.add(lev);
            }
        }
    }

    private void _readGen0(org.w3c.dom.Node xml, com.pullenti.unitext.internal.uni.UnitextGen gen, boolean pure, com.pullenti.unitext.internal.uni.UnitextGenNumStyle numStyle, int numLevel) {
        if (xml == null) 
            return;
        java.util.ArrayList<org.w3c.dom.Node> li = new java.util.ArrayList<org.w3c.dom.Node>();
        li.add(xml);
        this._readGen(li, gen, pure, numStyle, numLevel);
    }

    private void _readGen(java.util.ArrayList<org.w3c.dom.Node> xmlStack, com.pullenti.unitext.internal.uni.UnitextGen gen, boolean pure, com.pullenti.unitext.internal.uni.UnitextGenNumStyle numStyle, int numLevel) {
        org.w3c.dom.Node xml = xmlStack.get(xmlStack.size() - 1);
        if (!pure && com.pullenti.unisharp.Utils.stringsNe(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "#text")) {
            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "s")) {
                gen.appendText(" ", false);
                if (xml.getAttributes() != null) {
                    for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(xml.getAttributes())).arr) {
                        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "c")) {
                            int cou;
                            com.pullenti.unisharp.Outargwrapper<Integer> wrapcou115 = new com.pullenti.unisharp.Outargwrapper<Integer>();
                            boolean inoutres116 = com.pullenti.unisharp.Utils.parseInteger((String)com.pullenti.unisharp.Utils.notnull(a.getNodeValue(), ""), 0, null, wrapcou115);
                            cou = (wrapcou115.value != null ? wrapcou115.value : 0);
                            if (inoutres116) {
                                for (; cou > 1; cou--) {
                                    gen.appendText(" ", false);
                                }
                            }
                        }
                    }
                }
                return;
            }
            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "soft-page-break")) {
                gen.appendPagebreak();
                return;
            }
            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "line-break")) {
                gen.appendNewline(false, false);
                return;
            }
            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "table")) {
                com.pullenti.unitext.internal.uni.UnitextGenTable gt = new com.pullenti.unitext.internal.uni.UnitextGenTable();
                java.util.ArrayList<Double> colwi = new java.util.ArrayList<Double>();
                for (org.w3c.dom.Node r : (new com.pullenti.unisharp.XmlNodeListWrapper(xml.getChildNodes())).arr) {
                    if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(r), "table-row")) {
                        java.util.ArrayList<com.pullenti.unitext.internal.uni.UniTextGenCell> row = new java.util.ArrayList<com.pullenti.unitext.internal.uni.UniTextGenCell>();
                        gt.cells.add(row);
                        for (org.w3c.dom.Node c : (new com.pullenti.unisharp.XmlNodeListWrapper(r.getChildNodes())).arr) {
                            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(c), "table-cell")) {
                                com.pullenti.unitext.internal.uni.UniTextGenCell cel = new com.pullenti.unitext.internal.uni.UniTextGenCell();
                                row.add(cel);
                                if (c.getAttributes() != null) {
                                    for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(c.getAttributes())).arr) {
                                        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "number-rows-spanned")) {
                                            int nn;
                                            com.pullenti.unisharp.Outargwrapper<Integer> wrapnn117 = new com.pullenti.unisharp.Outargwrapper<Integer>();
                                            boolean inoutres118 = com.pullenti.unisharp.Utils.parseInteger(a.getNodeValue(), 0, null, wrapnn117);
                                            nn = (wrapnn117.value != null ? wrapnn117.value : 0);
                                            if (inoutres118) 
                                                cel.rowSpan = nn;
                                        }
                                        else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "number-columns-spanned")) {
                                            int nn;
                                            com.pullenti.unisharp.Outargwrapper<Integer> wrapnn119 = new com.pullenti.unisharp.Outargwrapper<Integer>();
                                            boolean inoutres120 = com.pullenti.unisharp.Utils.parseInteger(a.getNodeValue(), 0, null, wrapnn119);
                                            nn = (wrapnn119.value != null ? wrapnn119.value : 0);
                                            if (inoutres120) 
                                                cel.colSpan = nn;
                                        }
                                    }
                                }
                                com.pullenti.unitext.internal.uni.UnitextGen gg = new com.pullenti.unitext.internal.uni.UnitextGen();
                                xmlStack.add(c);
                                this._readGen(xmlStack, gg, true, numStyle, numLevel);
                                xmlStack.remove(xmlStack.size() - 1);
                                cel.content = gg.finish(true, null);
                            }
                        }
                    }
                    else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(r), "table-columns")) {
                        for (org.w3c.dom.Node x : (new com.pullenti.unisharp.XmlNodeListWrapper(r.getChildNodes())).arr) {
                            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(x), "table-column")) {
                                if (xml.getAttributes() != null) {
                                    for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(x.getAttributes())).arr) {
                                        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "style-name")) {
                                            OdtStyle sty1;
                                            com.pullenti.unisharp.Outargwrapper<OdtStyle> wrapsty1121 = new com.pullenti.unisharp.Outargwrapper<OdtStyle>();
                                            boolean inoutres122 = com.pullenti.unisharp.Utils.tryGetValue(m_Styles, a.getNodeValue(), wrapsty1121);
                                            sty1 = wrapsty1121.value;
                                            if (inoutres122) {
                                                if (sty1.tableColumnWidth > 0) 
                                                    colwi.add(sty1.tableColumnWidth);
                                            }
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(r), "table-column")) {
                        if (r.getAttributes() != null) {
                            for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(r.getAttributes())).arr) {
                                if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "style-name")) {
                                    OdtStyle sty1;
                                    com.pullenti.unisharp.Outargwrapper<OdtStyle> wrapsty1123 = new com.pullenti.unisharp.Outargwrapper<OdtStyle>();
                                    boolean inoutres124 = com.pullenti.unisharp.Utils.tryGetValue(m_Styles, a.getNodeValue(), wrapsty1123);
                                    sty1 = wrapsty1123.value;
                                    if (inoutres124) {
                                        if (sty1.tableColumnWidth > 0) 
                                            colwi.add(sty1.tableColumnWidth);
                                    }
                                    break;
                                }
                            }
                        }
                    }
                }
                double sum = 0.0;
                for (double w : colwi) {
                    sum += w;
                }
                if (sum > 0) {
                    for (double w : colwi) {
                        gt.m_ColWidth.add(((((Integer)((int)(((w * (100.0)) / sum)))).toString()) + "%"));
                    }
                }
                com.pullenti.unitext.UnitextTable tab = gt.convert();
                if (tab != null) {
                    gen.append(tab, null, -1, false);
                    return;
                }
            }
            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "a")) {
                String uri = null;
                if (xml.getAttributes() != null) {
                    for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(xml.getAttributes())).arr) {
                        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "href")) {
                            uri = a.getNodeValue();
                            break;
                        }
                    }
                }
                if (uri != null) {
                    com.pullenti.unitext.internal.uni.UnitextGen gg = new com.pullenti.unitext.internal.uni.UnitextGen();
                    xmlStack.add(xml);
                    this._readGen(xmlStack, gg, true, null, 0);
                    xmlStack.remove(xmlStack.size() - 1);
                    com.pullenti.unitext.UnitextItem it = gg.finish(true, null);
                    if (it != null) {
                        com.pullenti.unitext.UnitextHyperlink hr = com.pullenti.unitext.UnitextHyperlink._new59(uri);
                        hr.content = it;
                        gen.append(hr, null, -1, false);
                        return;
                    }
                }
            }
            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "note")) {
                com.pullenti.unitext.UnitextFootnote fn = new com.pullenti.unitext.UnitextFootnote();
                if (xml.getAttributes() != null) {
                    for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(xml.getAttributes())).arr) {
                        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "note-class") && com.pullenti.unisharp.Utils.stringsEq(a.getNodeValue(), "endnote")) 
                            fn.isEndnote = true;
                    }
                }
                for (org.w3c.dom.Node x : (new com.pullenti.unisharp.XmlNodeListWrapper(xml.getChildNodes())).arr) {
                    if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(x), "note-body")) {
                        com.pullenti.unitext.internal.uni.UnitextGen gg = new com.pullenti.unitext.internal.uni.UnitextGen();
                        xmlStack.add(x);
                        this._readGen(xmlStack, gg, true, null, 0);
                        xmlStack.remove(xmlStack.size() - 1);
                        fn.content = gg.finish(true, null);
                        break;
                    }
                }
                if (fn.content != null) 
                    gen.append(fn, null, -1, false);
                return;
            }
            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "bookmark-ref")) {
                com.pullenti.unitext.internal.uni.UnitextGen gg = new com.pullenti.unitext.internal.uni.UnitextGen();
                xmlStack.add(xml);
                this._readGen(xmlStack, gg, true, null, 0);
                xmlStack.remove(xmlStack.size() - 1);
                com.pullenti.unitext.UnitextPlaintext pl = (com.pullenti.unitext.UnitextPlaintext)com.pullenti.unisharp.Utils.cast(gg.finish(true, null), com.pullenti.unitext.UnitextPlaintext.class);
                if (pl != null) {
                    if (!gen.getLastText().endsWith(pl.text)) 
                        gen.appendText(pl.text, false);
                    return;
                }
            }
            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "annotation")) {
                com.pullenti.unitext.UnitextComment cmt = new com.pullenti.unitext.UnitextComment();
                com.pullenti.unitext.internal.uni.UnitextGen gg = new com.pullenti.unitext.internal.uni.UnitextGen();
                for (org.w3c.dom.Node x : (new com.pullenti.unisharp.XmlNodeListWrapper(xml.getChildNodes())).arr) {
                    if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(x), "creator")) 
                        cmt.author = x.getTextContent();
                    else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(x), "date")) {
                    }
                    else {
                        xmlStack.add(x);
                        this._readGen(xmlStack, gg, false, null, 0);
                        xmlStack.remove(xmlStack.size() - 1);
                    }
                }
                com.pullenti.unitext.UnitextItem it = gg.finish(true, null);
                if (it != null) {
                    StringBuilder tmp = new StringBuilder();
                    it.getPlaintext(tmp, null);
                    if (tmp.length() > 0) {
                        cmt.text = tmp.toString();
                        gen.append(cmt, null, -1, false);
                    }
                }
                return;
            }
            int outLineLevel = 0;
            com.pullenti.unitext.internal.uni.UnitextGenNumStyle numSty = null;
            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "p") || com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "h")) {
                if (xml.getAttributes() != null) {
                    for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(xml.getAttributes())).arr) {
                        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "outline-level")) {
                            com.pullenti.unisharp.Outargwrapper<Integer> wrapoutLineLevel126 = new com.pullenti.unisharp.Outargwrapper<Integer>();
                            com.pullenti.unisharp.Utils.parseInteger((String)com.pullenti.unisharp.Utils.notnull(a.getNodeValue(), ""), 0, null, wrapoutLineLevel126);
                            outLineLevel = (wrapoutLineLevel126.value != null ? wrapoutLineLevel126.value : 0);
                        }
                        else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "style-name")) {
                            OdtStyle sty1;
                            com.pullenti.unitext.internal.uni.UnitextGenNumStyle num0 = null;
                            if (com.pullenti.unisharp.Utils.stringsEq(a.getNodeValue(), "P5")) {
                            }
                            com.pullenti.unisharp.Outargwrapper<OdtStyle> wrapsty1130 = new com.pullenti.unisharp.Outargwrapper<OdtStyle>();
                            boolean inoutres131 = com.pullenti.unisharp.Utils.tryGetValue(m_Styles, a.getNodeValue(), wrapsty1130);
                            sty1 = wrapsty1130.value;
                            if (!inoutres131) 
                                continue;
                            for (int kk = 0; kk < 10; kk++) {
                                if (sty1.numStyleId != null) {
                                    com.pullenti.unisharp.Outargwrapper<com.pullenti.unitext.internal.uni.UnitextGenNumStyle> wrapnum0127 = new com.pullenti.unisharp.Outargwrapper<com.pullenti.unitext.internal.uni.UnitextGenNumStyle>();
                                    com.pullenti.unisharp.Utils.tryGetValue(m_Nums, sty1.numStyleId, wrapnum0127);
                                    num0 = wrapnum0127.value;
                                    break;
                                }
                                if (sty1.parentName == null) 
                                    break;
                                com.pullenti.unisharp.Outargwrapper<OdtStyle> wrapsty1128 = new com.pullenti.unisharp.Outargwrapper<OdtStyle>();
                                boolean inoutres129 = com.pullenti.unisharp.Utils.tryGetValue(m_Styles, sty1.parentName, wrapsty1128);
                                sty1 = wrapsty1128.value;
                                if (!inoutres129) 
                                    break;
                            }
                            if (num0 == null) 
                                continue;
                            numSty = num0;
                        }
                    }
                }
            }
            if (outLineLevel > 0 || numSty != null) {
                if (m_OutlineNum == null && numSty == null) {
                    m_OutlineNum = new com.pullenti.unitext.internal.uni.UnitextGenNumStyle();
                    m_OutlineNum.levels.add(com.pullenti.unitext.internal.uni.UniTextGenNumLevel._new132(com.pullenti.unitext.internal.uni.UniTextGenNumType.DECIMAL, "%1."));
                    m_OutlineNum.levels.add(com.pullenti.unitext.internal.uni.UniTextGenNumLevel._new132(com.pullenti.unitext.internal.uni.UniTextGenNumType.DECIMAL, "%1.%2."));
                    m_OutlineNum.levels.add(com.pullenti.unitext.internal.uni.UniTextGenNumLevel._new132(com.pullenti.unitext.internal.uni.UniTextGenNumType.DECIMAL, "%1.%2.%3."));
                    m_OutlineNum.levels.add(com.pullenti.unitext.internal.uni.UniTextGenNumLevel._new132(com.pullenti.unitext.internal.uni.UniTextGenNumType.DECIMAL, "%1.%2.%3.%4."));
                    m_OutlineNum.levels.add(com.pullenti.unitext.internal.uni.UniTextGenNumLevel._new132(com.pullenti.unitext.internal.uni.UniTextGenNumType.DECIMAL, "%1.%2.%3.%4.%5."));
                    m_OutlineNum.levels.add(com.pullenti.unitext.internal.uni.UniTextGenNumLevel._new132(com.pullenti.unitext.internal.uni.UniTextGenNumType.DECIMAL, "%1.%2.%3.%4.%5.%6."));
                }
                com.pullenti.unitext.UnitextList li = com.pullenti.unitext.UnitextList._new63(outLineLevel - 1);
                com.pullenti.unitext.internal.uni.UnitextGen gg = new com.pullenti.unitext.internal.uni.UnitextGen();
                for (org.w3c.dom.Node x : (new com.pullenti.unisharp.XmlNodeListWrapper(xml.getChildNodes())).arr) {
                    xmlStack.add(x);
                    this._readGen(xmlStack, gg, false, (numSty == null ? m_OutlineNum : numStyle), numLevel);
                    xmlStack.remove(xmlStack.size() - 1);
                }
                gen.appendNewline(true, false);
                gen.append(gg.finish(true, null), (numSty == null ? m_OutlineNum : numSty), outLineLevel - 1, false);
                gen.appendNewline(false, false);
                gen.append(li, null, -1, false);
                return;
            }
            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "list")) {
                com.pullenti.unitext.UnitextList li = com.pullenti.unitext.UnitextList._new63(numLevel);
                com.pullenti.unitext.internal.uni.UnitextGenNumStyle num0 = null;
                boolean contNum = false;
                String styleName = null;
                if (xml.getAttributes() != null) {
                    for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(xml.getAttributes())).arr) {
                        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "style-name")) {
                            OdtStyle sty1;
                            com.pullenti.unisharp.Outargwrapper<OdtStyle> wrapsty1145 = new com.pullenti.unisharp.Outargwrapper<OdtStyle>();
                            boolean inoutres146 = com.pullenti.unisharp.Utils.tryGetValue(m_Styles, a.getNodeValue(), wrapsty1145);
                            sty1 = wrapsty1145.value;
                            if (inoutres146) {
                                if (sty1.numStyleId != null) {
                                    com.pullenti.unisharp.Outargwrapper<com.pullenti.unitext.internal.uni.UnitextGenNumStyle> wrapnum0140 = new com.pullenti.unisharp.Outargwrapper<com.pullenti.unitext.internal.uni.UnitextGenNumStyle>();
                                    com.pullenti.unisharp.Utils.tryGetValue(m_Nums, (styleName = sty1.numStyleId), wrapnum0140);
                                    num0 = wrapnum0140.value;
                                }
                                else if (sty1.parentName != null) {
                                    OdtStyle sty2;
                                    com.pullenti.unisharp.Outargwrapper<OdtStyle> wrapsty2142 = new com.pullenti.unisharp.Outargwrapper<OdtStyle>();
                                    boolean inoutres143 = com.pullenti.unisharp.Utils.tryGetValue(m_Styles, sty1.parentName, wrapsty2142);
                                    sty2 = wrapsty2142.value;
                                    if (inoutres143) {
                                        if (sty2.numStyleId != null) {
                                            com.pullenti.unisharp.Outargwrapper<com.pullenti.unitext.internal.uni.UnitextGenNumStyle> wrapnum0141 = new com.pullenti.unisharp.Outargwrapper<com.pullenti.unitext.internal.uni.UnitextGenNumStyle>();
                                            com.pullenti.unisharp.Utils.tryGetValue(m_Nums, (styleName = sty2.numStyleId), wrapnum0141);
                                            num0 = wrapnum0141.value;
                                        }
                                    }
                                }
                            }
                            else {
                                com.pullenti.unisharp.Outargwrapper<com.pullenti.unitext.internal.uni.UnitextGenNumStyle> wrapnum0144 = new com.pullenti.unisharp.Outargwrapper<com.pullenti.unitext.internal.uni.UnitextGenNumStyle>();
                                com.pullenti.unisharp.Utils.tryGetValue(m_Nums, (styleName = a.getNodeValue()), wrapnum0144);
                                num0 = wrapnum0144.value;
                                if (com.pullenti.unisharp.Utils.stringsEq(styleName, "L9")) {
                                }
                            }
                        }
                        else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "continue-numbering")) 
                            contNum = true;
                    }
                }
                if (numStyle == null || num0 != null) {
                    numStyle = num0;
                    numLevel = 0;
                }
                if (numStyle == null) {
                    numStyle = new com.pullenti.unitext.internal.uni.UnitextGenNumStyle();
                    numStyle.levels.add(com.pullenti.unitext.internal.uni.UniTextGenNumLevel._new132(com.pullenti.unitext.internal.uni.UniTextGenNumType.DECIMAL, "%1."));
                    numStyle.levels.add(com.pullenti.unitext.internal.uni.UniTextGenNumLevel._new132(com.pullenti.unitext.internal.uni.UniTextGenNumType.DECIMAL, "%1.%2."));
                    numStyle.levels.add(com.pullenti.unitext.internal.uni.UniTextGenNumLevel._new132(com.pullenti.unitext.internal.uni.UniTextGenNumType.DECIMAL, "%1.%2.%3."));
                    numStyle.levels.add(com.pullenti.unitext.internal.uni.UniTextGenNumLevel._new132(com.pullenti.unitext.internal.uni.UniTextGenNumType.DECIMAL, "%1.%2.%3.%4."));
                    numStyle.levels.add(com.pullenti.unitext.internal.uni.UniTextGenNumLevel._new132(com.pullenti.unitext.internal.uni.UniTextGenNumType.DECIMAL, "%1.%2.%3.%4.%5."));
                    numStyle.levels.add(com.pullenti.unitext.internal.uni.UniTextGenNumLevel._new132(com.pullenti.unitext.internal.uni.UniTextGenNumType.DECIMAL, "%1.%2.%3.%4.%5.%6."));
                    numLevel = 0;
                    if (styleName != null && !m_Nums.containsKey(styleName)) 
                        m_Nums.put(styleName, numStyle);
                }
                for (org.w3c.dom.Node x : (new com.pullenti.unisharp.XmlNodeListWrapper(xml.getChildNodes())).arr) {
                    if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(x), "list-item")) {
                        int n0 = 0;
                        if (x.getAttributes() != null) {
                            for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(x.getAttributes())).arr) {
                                if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "start-value")) {
                                    com.pullenti.unisharp.Outargwrapper<Integer> wrapn0153 = new com.pullenti.unisharp.Outargwrapper<Integer>();
                                    com.pullenti.unisharp.Utils.parseInteger(a.getNodeValue(), 0, null, wrapn0153);
                                    n0 = (wrapn0153.value != null ? wrapn0153.value : 0);
                                }
                            }
                        }
                        boolean startSubList = false;
                        for (org.w3c.dom.Node xx : (new com.pullenti.unisharp.XmlNodeListWrapper(x.getChildNodes())).arr) {
                            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xx), "list")) 
                                startSubList = true;
                            break;
                        }
                        if (n0 > 0 && (numLevel < numStyle.levels.size())) 
                            numStyle.levels.get(numLevel).current = n0;
                        com.pullenti.unitext.internal.uni.UnitextGen gg = new com.pullenti.unitext.internal.uni.UnitextGen();
                        xmlStack.add(x);
                        this._readGen(xmlStack, gg, true, numStyle, numLevel + 1);
                        xmlStack.remove(xmlStack.size() - 1);
                        gen.appendNewline(true, false);
                        if (startSubList) 
                            gen.append(gg.finish(true, null), null, 0, false);
                        else 
                            gen.append(gg.finish(true, null), numStyle, numLevel, false);
                    }
                    else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(x), "list-header")) {
                        com.pullenti.unitext.internal.uni.UnitextGen gg = new com.pullenti.unitext.internal.uni.UnitextGen();
                        xmlStack.add(x);
                        this._readGen(xmlStack, gg, true, numStyle, numLevel + 1);
                        xmlStack.remove(xmlStack.size() - 1);
                        gen.appendNewline(true, false);
                        gen.append(gg.finish(true, null), null, 0, false);
                    }
                }
                gen.append(li, null, -1, false);
                return;
            }
            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "custom-shape")) {
                com.pullenti.unitext.internal.uni.UnitextGen gg = new com.pullenti.unitext.internal.uni.UnitextGen();
                xmlStack.add(xml);
                this._readGen(xmlStack, gg, true, null, 0);
                xmlStack.remove(xmlStack.size() - 1);
                com.pullenti.unitext.UnitextItem it = gg.finish(true, null);
                if (it == null) 
                    return;
                if (it instanceof com.pullenti.unitext.UnitextContainer) 
                    ((com.pullenti.unitext.UnitextContainer)com.pullenti.unisharp.Utils.cast(it, com.pullenti.unitext.UnitextContainer.class)).typ = com.pullenti.unitext.UnitextContainerType.SHAPE;
                else {
                    com.pullenti.unitext.UnitextContainer cnt = com.pullenti.unitext.UnitextContainer._new94(com.pullenti.unitext.UnitextContainerType.SHAPE);
                    cnt.children.add(it);
                    it = cnt.optimize(false, null);
                }
                if (it != null) 
                    gen.append(it, null, -1, false);
                return;
            }
            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "image")) {
                com.pullenti.unitext.UnitextImage img = new com.pullenti.unitext.UnitextImage();
                if (xml.getAttributes() != null) {
                    for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(xml.getAttributes())).arr) {
                        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "href")) {
                            img.id = a.getNodeValue();
                            break;
                        }
                    }
                }
                if (img.id != null) {
                    gen.append(img, null, -1, false);
                    xmlStack.add(xml);
                    for (int jj = xmlStack.size() - 1; jj >= 0; jj--) {
                        org.w3c.dom.Node pp = xmlStack.get(jj);
                        if (pp.getAttributes() == null) 
                            continue;
                        for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(pp.getAttributes())).arr) {
                            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "width") && img.width == null) 
                                img.width = com.pullenti.unitext.internal.uni.UnitextGen.convertToPt(a.getNodeValue(), null);
                            else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "height") && img.height == null && a.getNodeValue() != null) 
                                img.height = com.pullenti.unitext.internal.uni.UnitextGen.convertToPt(a.getNodeValue(), null);
                        }
                        if (img.width != null || img.height != null) 
                            break;
                    }
                    xmlStack.remove(xmlStack.size() - 1);
                }
                return;
            }
            OdtStyle sty = null;
            if (xml.getAttributes() != null) {
                for (org.w3c.dom.Node a : (new com.pullenti.unisharp.XmlAttrListWrapper(xml.getAttributes())).arr) {
                    if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(a), "style-name")) {
                        com.pullenti.unisharp.Outargwrapper<OdtStyle> wrapsty156 = new com.pullenti.unisharp.Outargwrapper<OdtStyle>();
                        com.pullenti.unisharp.Utils.tryGetValue(m_Styles, a.getNodeValue(), wrapsty156);
                        sty = wrapsty156.value;
                        if (com.pullenti.unisharp.Utils.stringsEq(a.getNodeValue(), "T53")) {
                        }
                        if (sty != null && ((sty.isSuper || sty.isSub))) {
                            com.pullenti.unitext.internal.uni.UnitextGen gg = new com.pullenti.unitext.internal.uni.UnitextGen();
                            xmlStack.add(xml);
                            this._readGen(xmlStack, gg, true, null, 0);
                            xmlStack.remove(xmlStack.size() - 1);
                            com.pullenti.unitext.UnitextItem it = gg.finish(true, null);
                            if (it == null) 
                                continue;
                            StringBuilder tmp = new StringBuilder();
                            it.getPlaintext(tmp, null);
                            String tt = tmp.toString().trim();
                            if (tt.length() > 0 && (tt.length() < 100)) {
                                gen.append(com.pullenti.unitext.UnitextPlaintext._new58(tt, (sty.isSuper ? com.pullenti.unitext.UnitextPlaintextType.SUB : com.pullenti.unitext.UnitextPlaintextType.SUP)), null, -1, false);
                                return;
                            }
                        }
                        if (sty != null && ((sty.isWingdings || sty.isSymbol))) {
                            com.pullenti.unitext.internal.uni.UnitextGen gg = new com.pullenti.unitext.internal.uni.UnitextGen();
                            xmlStack.add(xml);
                            this._readGen(xmlStack, gg, true, null, 0);
                            xmlStack.remove(xmlStack.size() - 1);
                            com.pullenti.unitext.UnitextItem it = gg.finish(true, null);
                            if (it == null) 
                                continue;
                            StringBuilder tmp = new StringBuilder();
                            it.getPlaintext(tmp, null);
                            String tt = (sty.isSymbol ? SymbolHelper.getUnicodeString(tmp.toString().trim()) : WingdingsHelper.getUnicodeString(tmp.toString().trim()));
                            if (tt.length() > 0) 
                                gen.appendText(tt, false);
                            return;
                        }
                    }
                }
            }
        }
        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "p")) 
            gen.appendNewline(true, false);
        else if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "h")) 
            gen.appendNewline(false, false);
        if (xml.getChildNodes().getLength() == 0 && xml.getTextContent() != null) {
            String txt = xml.getTextContent();
            if (txt.indexOf((char)0xAD) >= 0) 
                txt = txt.replace(((String.valueOf((char)0xAD))), "");
            if (txt.length() == 1 && ((int)txt.charAt(0)) >= 0xF000) 
                gen.appendText(((String.valueOf((char)((((int)txt.charAt(0)) - 0xF000))))), false);
            else 
                gen.appendText(txt, false);
        }
        else 
            for (org.w3c.dom.Node x : (new com.pullenti.unisharp.XmlNodeListWrapper(xml.getChildNodes())).arr) {
                xmlStack.add(x);
                this._readGen(xmlStack, gen, false, numStyle, numLevel);
                xmlStack.remove(xmlStack.size() - 1);
            }
        if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "p") || com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "h")) {
            gen.appendNewline(false, false);
            if (com.pullenti.unisharp.Utils.stringsEq(com.pullenti.unisharp.Utils.getXmlLocalName(xml), "h")) 
                gen.appendNewline(false, false);
        }
    }
    public OdtHelper() {
    }
    public static OdtHelper _globalInstance;
    
    static {
        try { _globalInstance = new OdtHelper(); } 
        catch(Exception e) { }
    }
}
