[email protected] wrote:
> Author: leuven
> Date: Sat Jun 5 09:44:44 2010
> New Revision: 34598
> URL: http://www.lyx.org/trac/changeset/34598
>
> Log:
> add support for decimal alignment in tables
Edwin, few remarks on the documentation...
> ####################################################################
> # Private helper functions
>
> +def remove_option(document, m, option):
> + l = document.body[m].find(option)
> + if l != -1:
> + val = document.body[m][l:].split('"')[1]
> + document.body[m] = document.body[m][:l-1] +
> document.body[m][l+len(option + '="' + val + '"'):]
> + return l
> +
some comment about what exactly is the function supposed to do?
>
> +def revert_align_decimal(document):
> + l = 0
> + while True:
> + l = document.body[l].find('alignment=decimal')
> + if l == -1:
> + break
> + remove_option(document, l, 'decimal_point')
> + document.body[l].replace('decimal', 'center')
the particular strings addition(/removal) should be part of FORMAT file
> Modified: lyx-devel/trunk/src/insets/InsetTabular.cpp
> ==============================================================================
> --- lyx-devel/trunk/src/insets/InsetTabular.cpp Sat Jun 5 00:53:44
> 2010 (r34597)
> +++ lyx-devel/trunk/src/insets/InsetTabular.cpp Sat Jun 5 09:44:44
> 2010 (r34598)
> @@ -125,6 +125,7 @@
> { Tabular::ALIGN_RIGHT, "align-right", false },
> { Tabular::ALIGN_CENTER, "align-center", false },
> { Tabular::ALIGN_BLOCK, "align-block", false },
> + { Tabular::ALIGN_DECIMAL, "align-decimal", false },
> { Tabular::VALIGN_TOP, "valign-top", false },
> { Tabular::VALIGN_BOTTOM, "valign-bottom", false },
> { Tabular::VALIGN_MIDDLE, "valign-middle", false },
> @@ -174,6 +175,7 @@
> { Tabular::LONGTABULAR_ALIGN_LEFT, "longtabular-align-left", false },
> { Tabular::LONGTABULAR_ALIGN_CENTER, "longtabular-align-center", false
> },
> { Tabular::LONGTABULAR_ALIGN_RIGHT, "longtabular-align-right", false },
> + { Tabular::SET_DECIMAL_POINT, "set-decimal-point", true },
these options should be added to doxies in LyXAction.cpp...
pavel