diff options
author | Rodolfo Ribeiro Gomes <rodolforg@gmail.com> | 2016-05-08 12:05:58 -0300 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-06-07 08:08:17 +0000 |
commit | 0006c15d8a496b7544beb09ba4de6bde866c13b0 (patch) | |
tree | 4abd3055f63a8d1b73f24ad915d7b02b6984afd6 | |
parent | 6b6ca45ad6ea62e8085ac017f5ee6a743191b900 (diff) |
tdf#34362 Setting table border from toolbar resets "spacing to content"
Change-Id: Iec51c02ab389015d268849aa0dda870c11323f46
Signed-off-by: Rodolfo Ribeiro Gomes <rodolforg@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/24764
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
(cherry picked from commit ea7de7b2d3dc62b2ae73c2184398b227f8a85890)
Reviewed-on: https://gerrit.libreoffice.org/25982
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/uibase/shells/tabsh.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index ef4d98abd9a7..aee17033808c 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -46,6 +46,7 @@ #include <sfx2/dispatch.hxx> #include <sfx2/objface.hxx> #include <sfx2/sidebar/EnumContext.hxx> +#include <o3tl/enumrange.hxx> #include <fmtornt.hxx> #include <fmtclds.hxx> @@ -480,10 +481,12 @@ void SwTableShell::Execute(SfxRequest &rReq) if ( pArgs->GetItemState(RES_BOX, true, &pBoxItem) == SfxItemState::SET ) { aBox = *static_cast<const SvxBoxItem*>(pBoxItem); + sal_uInt16 nDefValue = MIN_BORDER_DIST; if ( !rReq.IsAPI() ) - aBox.SetDistance( std::max(rCoreBox.GetDistance(),sal_uInt16(55)) ); - else if ( aBox.GetDistance() < MIN_BORDER_DIST ) - aBox.SetDistance( std::max(rCoreBox.GetDistance(),(sal_uInt16)MIN_BORDER_DIST) ); + nDefValue = 55; + if ( !rReq.IsAPI() || aBox.GetDistance() < MIN_BORDER_DIST ) + for( SvxBoxItemLine k : o3tl::enumrange<SvxBoxItemLine>() ) + aBox.SetDistance( std::max(rCoreBox.GetDistance(k), nDefValue) , k ); } else OSL_ENSURE( false, "where is BoxItem?" ); |