[A] Added adding_strategy property to the tables

This commit is contained in:
seleznevae
2020-01-08 15:32:06 +03:00
parent 7d313ee078
commit 27e1102878
19 changed files with 823 additions and 94 deletions

View File

@@ -60,6 +60,17 @@ enum class row_type {
header = FT_ROW_HEADER
};
/**
* Adding strategy.
*
* Determines what happens with old content if current cell is not empty after
* adding data to it. Default strategy is 'replace'.
*/
enum class add_strategy {
replace = FT_STRATEGY_REPLACE,
insert = FT_STRATEGY_INSERT
};
/**
* Colors.
*/
@@ -893,6 +904,22 @@ public:
{
return FT_IS_SUCCESS(ft_set_tbl_prop(table_, FT_TPROP_BOTTOM_MARGIN, value));
}
/**
* Set table adding strategy.
*
* @param value
* Adding strategy.
* @return
* - true: Success; table property was changed.
* - false: In case of error.
*/
bool set_adding_strategy(fort::add_strategy value)
{
return FT_IS_SUCCESS(ft_set_tbl_prop(table_,
FT_TPROP_ADDING_STRATEGY,
static_cast<int>(value)));
}
private:
ft_table_t *table_;
mutable std::stringstream stream_;