summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2017-10-31 15:48:07 -0800
committerYousuf Philips <philipz85@hotmail.com>2017-12-27 15:27:50 +0100
commit203b913155812706e9be14c5fe2b8f543cc4fdc7 (patch)
treee2233e80cbc67d0bf834d4eb716ff935cebe6d08 /sw/source/ui
parent023949fac0043408ac1b86dc67732666d041875e (diff)
tdf#107555 Apply 'Default Style' table style to newly inserted tables
Change-Id: Iac32542bdefc32b07c63cc41cf0f693cc2ca799d Reviewed-on: https://gerrit.libreoffice.org/44147 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 416f7578d6332b5b5a4445f26307d73925188e41) Reviewed-on: https://gerrit.libreoffice.org/46842 Reviewed-by: Yousuf Philips <philipz85@hotmail.com>
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/table/tautofmt.cxx20
1 files changed, 13 insertions, 7 deletions
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index a4e9080be0ed..7c2a2d66e602 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -262,6 +262,16 @@ 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 )
@@ -274,7 +284,8 @@ void SwAutoFormatDlg::FillAutoFormatOfIndex( SwTableAutoFormat*& rToFill ) const
else
{
delete rToFill;
- rToFill = nullptr;
+ rToFill = new SwTableAutoFormat( SwViewShell::GetShellRes()->aStrNone );
+ lcl_SetProperties( rToFill, false );
}
}
@@ -482,12 +493,7 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, SelFormatHdl, ListBox&, void)
nIndex = 255;
SwTableAutoFormat aTmp( SwViewShell::GetShellRes()->aStrNone );
- aTmp.SetFont( false );
- aTmp.SetJustify( false );
- aTmp.SetFrame( false );
- aTmp.SetBackground( false );
- aTmp.SetValueFormat( false );
- aTmp.SetWidthHeight( false );
+ lcl_SetProperties( &aTmp, false );
if( nOldIdx != nIndex )
m_pWndPreview->NotifyChange( aTmp );