[Libreoffice-commits] core.git: sw/source

Rodolfo Ribeiro Gomes rodolforg at gmail.com
Mon May 30 13:18:10 UTC 2016


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

New commits:
commit ea7de7b2d3dc62b2ae73c2184398b227f8a85890
Author: Rodolfo Ribeiro Gomes <rodolforg at gmail.com>
Date:   Sun May 8 12:05:58 2016 -0300

    fdo#34362 Setting table border from toolbar resets "spacing to content"
    
    Change-Id: Iec51c02ab389015d268849aa0dda870c11323f46
    Signed-off-by: Rodolfo Ribeiro Gomes <rodolforg at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/24764
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index ac84b52..c8b9afd 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?" );


More information about the Libreoffice-commits mailing list