diff options
| -rw-r--r-- | sw/source/ui/table/tautofmt.cxx | 20 | ||||
| -rw-r--r-- | sw/source/uibase/shells/basesh.cxx | 7 |
2 files changed, 9 insertions, 18 deletions
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(); |
