summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodolfo Ribeiro Gomes <rodolforg@gmail.com>2016-05-08 12:05:58 -0300
committerMichael Stahl <mstahl@redhat.com>2016-05-30 13:17:40 +0000
commitea7de7b2d3dc62b2ae73c2184398b227f8a85890 (patch)
treef89b49c0e52b3892305953c54fadb6eb343753a4
parent8fec9e7e4ca97e14551a737583226f89b0c6eecd (diff)
fdo#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>
-rw-r--r--sw/source/uibase/shells/tabsh.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index ac84b529ed93..c8b9afde9501 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>
@@ -487,10 +488,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?" );