def get_paragraph_ind()

in src/simplify_docx/utils/paragrapy_style.py [0:0]


def get_paragraph_ind(p, doc):
    """
    Gets the style according to the style hierarchy listed in section 17.3.1.27
    "pStyle (Referenced Paragraph Style)"

    This formatting is applied at the following location in the style hierarchy:
    * Document defaults
    * Table styles
    * Numbering styles
    * Paragraph styles (this element)
    * Character styles
    * Direct Formatting
    """

    if getattr(p, "pPr", None) is not None and\
            p.pPr.ind is not None:
        return p.pPr.ind

    num_style = get_num_style(p, doc)
    if num_style is not None and \
            num_style.pPr is not None and \
            num_style.pPr.ind is not None:
        return num_style.pPr.ind

    pStyle = get_pStyle(p, doc)
    if pStyle is not None and \
            pStyle.pPr is not None and \
            pStyle.pPr.ind is not None:
        return pStyle.pPr.ind
    return None