'@todo: docstring'

def processDict(self, rules, parent, row, col, matrix, action='rows'):

    startcol = col
    startrow = row
    endcol = col
    endrow = row
    if ('boxOpen' in rules):
        return self.processBox(rules, row, col, matrix, action)
    if ('heading' in rules):
        text = rules['heading']
        if (len(parent) == 1):
            width = (min(len(text), matrix.lastCol) + 1)
            height = 1
            styleName = 'styleSectionHeading'
        else:
            width = 11
            height = ((len(text) / (2 * width)) + 1)
            styleName = 'styleSubHeader'
        cell = survey_MatrixElement(row, col, text, style=styleName)
        cell.merge(horizontal=(width - 1), vertical=(height - 1))
        try:
            matrix.addElement(cell)
        except Exception as msg:
            current.log.error(msg)
            return (row, col)
        endrow = (row + height)
        endcol = (col + width)
        if ('hint' in rules):
            text = rules['hint']
            cell = survey_MatrixElement(endrow, startcol, text, style='styleHint')
            height = (int((((len(text) / (2 * width)) * 0.75) + 0.5)) + 1)
            cell.merge(horizontal=(width - 1), vertical=(height - 1))
            try:
                matrix.addElement(cell)
            except Exception as msg:
                current.log.error(msg)
                return (row, col)
            endrow = (endrow + height)
    if ('labelLeft' in rules):
        self.labelLeft = rules['labelLeft']
    if ('columns' in rules):
        value = rules['columns']
        maxrow = startrow
        for rules in value:
            row = startrow
            self.nextrow = startrow
            col = endcol
            if isinstance(rules, list):
                (endrow, endcol) = self.processList(rules, row, col, matrix, 'columns')
            elif isinstance(rules, dict):
                (endrow, endcol) = self.processDict(rules, value, row, col, matrix, 'columns')
            if (endrow > maxrow):
                maxrow = endrow
            if (endcol > self.nextcol):
                self.nextcol = endcol
        self.nextrow = maxrow
        endrow = self.nextrow
        endcol = self.nextcol
    return (endrow, endcol)
