def CalculateSlices(self, maxWidth, columnWidths):
        """
        Return a list of integer pairs, where each pair represents
        the left and right columns that can fit into the width of one page
        """
        firstColumn = 0

        # If a GroupListView has a column just for the expand/collapse, don't include it
        if hasattr(self.lv, "useExpansionColumn") and self.lv.useExpansionColumn:
            firstColumn = 1

        # If we are shrinking to fit or all the columns fit, just return all columns
        if self.IsShrinkToFit() or (sum(columnWidths)) <= maxWidth:
            return [ [firstColumn, len(columnWidths)-1] ]

        pairs = list()
        left = firstColumn
        right = firstColumn
        while right < len(columnWidths):
            if (sum(columnWidths[left:right+1])) > maxWidth:
                if left == right:
                    pairs.append([left, right])
                    left += 1
                    right += 1
                else:
                    pairs.append([left, right-1])
                    left = right
            else:
                right += 1

        if left < len(columnWidths):
            pairs.append([left, right-1])

        return pairs


#----------------------------------------------------------------------------
dataset/ETHPy150Open ODM2/ODMToolsPython/odmtools/lib/ObjectListView/ListCtrlPrinter.py/ListBlock.CalculateSlices/original