diff options
author | Justin Luth <justin_luth@sil.org> | 2018-09-06 12:17:47 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2018-09-21 16:48:13 +0200 |
commit | 73859a1c00d443714a1e5f2a1a8d16fe46877944 (patch) | |
tree | 20ec8312fef2cd36910989883cee6fd0e3b068da /include/svx | |
parent | f74b888244fcefa7c03fa25db4d42c839ebbf642 (diff) |
tdf#117721 draw ui: add .uno::SetOptimalColumnWidth
Optimize column width: Adjusts the width of the
selected columns to fit the content,
without changing the width of the table.
Any leftover space is distributed proportionately,
with thin columns growing slightly,
and wide columns growing much wider.
The implementation and results are different from how Writer
does it, but tables themselves are also very different in Draw.
So I don't think it needs to be handled identically.
Writer's implementation is really "minimalColumnWidth" anyway.
Change-Id: Ia10cfa9822d7eef3c4909a82c21535aa6668b143
Reviewed-on: https://gerrit.libreoffice.org/60078
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'include/svx')
-rw-r--r-- | include/svx/sdr/table/tablecontroller.hxx | 2 | ||||
-rw-r--r-- | include/svx/svdotable.hxx | 2 | ||||
-rw-r--r-- | include/svx/svxids.hrc | 7 |
3 files changed, 8 insertions, 3 deletions
diff --git a/include/svx/sdr/table/tablecontroller.hxx b/include/svx/sdr/table/tablecontroller.hxx index 130d57a6da3e..72cfac222818 100644 --- a/include/svx/sdr/table/tablecontroller.hxx +++ b/include/svx/sdr/table/tablecontroller.hxx @@ -75,7 +75,7 @@ public: SVX_DLLPRIVATE void onFormatTable( SfxRequest const & rReq ); SVX_DLLPRIVATE void MergeMarkedCells(); SVX_DLLPRIVATE void SplitMarkedCells(); - SVX_DLLPRIVATE void DistributeColumns(); + SVX_DLLPRIVATE void DistributeColumns( const bool bOptimize ); SVX_DLLPRIVATE void DistributeRows(); SVX_DLLPRIVATE void SetVertical( sal_uInt16 nSId ); diff --git a/include/svx/svdotable.hxx b/include/svx/svdotable.hxx index 72d5f25f627e..a874c166a229 100644 --- a/include/svx/svdotable.hxx +++ b/include/svx/svdotable.hxx @@ -113,7 +113,7 @@ public: void CropTableModelToSelection(const CellPos& rStart, const CellPos& rEnd); // Table stuff - void DistributeColumns( sal_Int32 nFirstColumn, sal_Int32 nLastColumn ); + void DistributeColumns( sal_Int32 nFirstColumn, sal_Int32 nLastColumn, const bool bOptimize ); void DistributeRows( sal_Int32 nFirstRow, sal_Int32 nLastRow ); css::uno::Reference< css::table::XTable > getTable() const; diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index 5e8cd7817534..e3e857637bed 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -469,6 +469,7 @@ class SfxStringItem; #define SID_ATTR_3D_INTERN ( SID_SVX_START + 422 ) #define SID_PSZ_FUNCTION ( SID_SVX_START + 423 ) +// CAUTION! <424 > used by sfxids (!) #define SID_TABLE_INSERT_COL_DLG ( SID_SVX_START + 426 ) #define SID_TABLE_INSERT_ROW_DLG ( SID_SVX_START + 427 ) #define SID_TABLE_PARAM_INSERT_AFTER ( SID_SVX_START + 428 ) @@ -970,8 +971,12 @@ class SfxStringItem; #define SID_MEASURE_DLG ( SID_SVX_START + 1176 ) +#define SID_TABLE_OPTIMAL_COLUMN_WIDTH ( SID_SVX_START + 1187 ) +#define SID_TABLE_OPTIMAL_ROW_HEIGHT ( SID_SVX_START + 1188 ) + + // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id -#define SID_SVX_FIRSTFREE ( SID_MEASURE_DLG + 1 ) +#define SID_SVX_FIRSTFREE ( SID_TABLE_OPTIMAL_ROW_HEIGHT + 1 ) // Overflow check for slot IDs #if SID_SVX_FIRSTFREE > SID_SVX_END |