summaryrefslogtreecommitdiff
path: root/sw/source/uibase/shells/tabsh.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2018-09-20 17:16:14 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-10-11 09:23:23 +0200
commit59ed21b1720db5fd0326e1b723483b288725e662 (patch)
treec7fd92c1dd7a7a1f96c34c6069447f764156c843 /sw/source/uibase/shells/tabsh.cxx
parente4c7f31cf90850a986a6603b62192976567871b9 (diff)
tdf#64242 sw add minimize table col/row UI
A followup commit will modify the optimize functions, which currently function as a minimize, so lets make sure that the ability to minimize is still available. Minimize column width: Adjusts the width of the selected columns to fit the selected content. The table can shrink if necessary, but will not grow. (This is how Optimize column width worked in LO <= 6.1.) Minimize row height: Adjusts the height of the selected rows to fit the content, causing the table to shrink. (This is how Optimize row height worked in LO <= 6.1.) Change-Id: I2c0b8c7b7a05c31328f2feef464ef0e131318ff8 Reviewed-on: https://gerrit.libreoffice.org/60902 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/shells/tabsh.cxx')
-rw-r--r--sw/source/uibase/shells/tabsh.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 00f1df7a0e2b..75ec7e57c888 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -772,6 +772,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
break;
}
break;
+ case SID_TABLE_MINIMAL_COLUMN_WIDTH:
case FN_TABLE_ADJUST_CELLS:
case FN_TABLE_BALANCE_CELLS:
{
@@ -787,6 +788,13 @@ void SwTableShell::Execute(SfxRequest &rReq)
bCallDone = true;
break;
}
+ case SID_TABLE_MINIMAL_ROW_HEIGHT:
+ {
+ const SwFormatFrameSize aSz;
+ rSh.SetRowHeight( aSz );
+ bCallDone = true;
+ break;
+ }
case FN_TABLE_BALANCE_ROWS:
if ( rSh.BalanceRowHeight(true) )
rSh.BalanceRowHeight(false);
@@ -1221,9 +1229,10 @@ void SwTableShell::GetState(SfxItemSet &rSet)
if ( !rSh.IsTableMode() )
rSet.DisableItem(FN_TABLE_MERGE_CELLS);
break;
+ case SID_TABLE_MINIMAL_COLUMN_WIDTH:
case FN_TABLE_ADJUST_CELLS:
if ( !rSh.IsAdjustCellWidthAllowed() )
- rSet.DisableItem(FN_TABLE_ADJUST_CELLS);
+ rSet.DisableItem(nSlot);
break;
case FN_TABLE_BALANCE_CELLS:
@@ -1257,6 +1266,7 @@ void SwTableShell::GetState(SfxItemSet &rSet)
}
break;
+ case SID_TABLE_MINIMAL_ROW_HEIGHT:
case FN_TABLE_OPTIMAL_HEIGHT:
{
// Disable if auto height already is enabled.