sw/source/uibase/shells/tabsh.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 0006c15d8a496b7544beb09ba4de6bde866c13b0
Author: Rodolfo Ribeiro Gomes <rodolf...@gmail.com>
Date:   Sun May 8 12:05:58 2016 -0300

    tdf#34362 Setting table border from toolbar resets "spacing to content"
    
    Change-Id: Iec51c02ab389015d268849aa0dda870c11323f46
    Signed-off-by: Rodolfo Ribeiro Gomes <rodolf...@gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/24764
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Michael Stahl <mst...@redhat.com>
    (cherry picked from commit ea7de7b2d3dc62b2ae73c2184398b227f8a85890)
    Reviewed-on: https://gerrit.libreoffice.org/25982
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/uibase/shells/tabsh.cxx 
b/sw/source/uibase/shells/tabsh.cxx
index ef4d98a..aee1703 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?" );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to