diff options
author | Jim Raykowski <raykowj@gmail.com> | 2018-03-13 19:04:44 -0800 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-03-28 16:36:27 +0200 |
commit | 55a27458831d1a7d203479c9d713d2f3e57c25a4 (patch) | |
tree | a76ff9e1be4d78645edd80691ee5b3757e34a274 | |
parent | 941527edd3345a657e0af458c1a9fad8247db90b (diff) |
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@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@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@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 30db8c9b1d9654e62c11657140fac24f0f52c547)
Reviewed-on: https://gerrit.libreoffice.org/51917
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-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(); |