[Libreoffice-commits] core.git: Branch 'libreoffice-6-0-3' - sw/source

Jim Raykowski raykowj at gmail.com
Wed Mar 28 14:36:51 UTC 2018


 sw/source/ui/table/tautofmt.cxx    |   20 +++++++-------------
 sw/source/uibase/shells/basesh.cxx |    7 ++-----
 2 files changed, 9 insertions(+), 18 deletions(-)

New commits:
commit 55a27458831d1a7d203479c9d713d2f3e57c25a4
Author: Jim Raykowski <raykowj at gmail.com>
Date:   Tue Mar 13 19:04:44 2018 -0800

    tdf#115573 Revert: tdf#107555 Apply 'Default Style' table style
    
    ...to newly inserted tables
    
    Revert due to tables with autoformat style not able to persist direct
    formatting.
    
    Reviewed-on: https://gerrit.libreoffice.org/51253
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit eeb4a2ec37bf88b26a9f243cc5682e96c9e35df6)
    
    Conflicts:
            sw/source/ui/table/tautofmt.cxx
    
    Change-Id: Ic33033235b9f5bfba15ec74fa88e94da2dc21b69
    Reviewed-on: https://gerrit.libreoffice.org/51362
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 30db8c9b1d9654e62c11657140fac24f0f52c547)
    Reviewed-on: https://gerrit.libreoffice.org/51917
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index 530b05850106..d9cb9f92d209 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -262,16 +262,6 @@ void SwAutoFormatDlg::UpdateChecks( const SwTableAutoFormat& rFormat, bool bEnab
     m_pBtnAlignment->Check( rFormat.IsJustify() );
 }
 
-static void lcl_SetProperties( SwTableAutoFormat* pTableAutoFormat, bool bVal )
-{
-    pTableAutoFormat->SetFont( bVal );
-    pTableAutoFormat->SetJustify( bVal );
-    pTableAutoFormat->SetFrame( bVal );
-    pTableAutoFormat->SetBackground( bVal );
-    pTableAutoFormat->SetValueFormat( bVal );
-    pTableAutoFormat->SetWidthHeight( bVal );
-}
-
 void SwAutoFormatDlg::FillAutoFormatOfIndex( SwTableAutoFormat*& rToFill ) const
 {
     if( 255 != nIndex )
@@ -284,8 +274,7 @@ void SwAutoFormatDlg::FillAutoFormatOfIndex( SwTableAutoFormat*& rToFill ) const
     else
     {
         delete rToFill;
-        rToFill = new SwTableAutoFormat( SwViewShell::GetShellRes()->aStrNone );
-        lcl_SetProperties( rToFill, false );
+        rToFill = nullptr;
     }
 }
 
@@ -493,7 +482,12 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, SelFormatHdl, ListBox&, void)
         nIndex = 255;
 
         SwTableAutoFormat aTmp( SwViewShell::GetShellRes()->aStrNone );
-        lcl_SetProperties( &aTmp, false );
+        aTmp.SetFont( false );
+        aTmp.SetJustify( false );
+        aTmp.SetFrame( false );
+        aTmp.SetBackground( false );
+        aTmp.SetValueFormat( false );
+        aTmp.SetWidthHeight( false );
 
         if( nOldIdx != nIndex )
             m_pWndPreview->NotifyChange( aTmp );
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index b938767159bb..81df7be4048c 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -109,7 +109,6 @@
 
 #include <SwStyleNameMapper.hxx>
 #include <poolfmt.hxx>
-#include <shellres.hxx>
 
 FlyMode SwBaseShell::eFrameMode = FLY_DRAG_END;
 
@@ -2688,7 +2687,7 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
             {
                 // record before shell change
                 _rRequest.AppendItem( SfxStringItem( FN_INSERT_TABLE, aTableName ) );
-                if ( !aAutoName.isEmpty() && aAutoName != SwViewShell::GetShellRes()->aStrNone )
+                if ( !aAutoName.isEmpty() )
                     _rRequest.AppendItem( SfxStringItem( FN_PARAM_2, aAutoName ) );
                 _rRequest.AppendItem( SfxUInt16Item( SID_ATTR_TABLE_COLUMN, nCols ) );
                 _rRequest.AppendItem( SfxUInt16Item( SID_ATTR_TABLE_ROW, nRows ) );
@@ -2708,9 +2707,7 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
                 if( !aTableName.isEmpty() && !rSh.GetTableStyle( aTableName ) )
                     rSh.GetTableFormat()->SetName( aTableName );
 
-                if( pTAFormat == nullptr )
-                    rSh.SetTableStyle( SwStyleNameMapper::GetUIName( RES_POOLTABSTYLE_DEFAULT, OUString() ) );
-                else
+                if( pTAFormat != nullptr && aAutoName != SwStyleNameMapper::GetUIName( RES_POOLTABSTYLE_DEFAULT, OUString() ) )
                     rSh.SetTableStyle( aAutoName );
 
                 rSh.EndAllAction();


More information about the Libreoffice-commits mailing list