summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2018-03-13 19:04:44 -0800
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-03-15 18:00:39 +0100
commiteeb4a2ec37bf88b26a9f243cc5682e96c9e35df6 (patch)
tree2ffbc88d3789daf4bd59a5577d8ac71f2209d46e
parent6ef7c2729fb85959dfd76f028166f7631886399c (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. Change-Id: Ic33033235b9f5bfba15ec74fa88e94da2dc21b69 Reviewed-on: https://gerrit.libreoffice.org/51253 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--sw/source/ui/table/tautofmt.cxx21
-rw-r--r--sw/source/uibase/shells/basesh.cxx7
2 files changed, 9 insertions, 19 deletions
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index d66969e539cb..97034075c537 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -154,16 +154,6 @@ void SwAutoFormatDlg::UpdateChecks( const SwTableAutoFormat& rFormat, bool bEnab
m_xBtnAlignment->set_active(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 );
-}
-
SwTableAutoFormat* SwAutoFormatDlg::FillAutoFormatOfIndex() const
{
if( 255 != m_nIndex )
@@ -171,9 +161,7 @@ SwTableAutoFormat* SwAutoFormatDlg::FillAutoFormatOfIndex() const
return new SwTableAutoFormat( (*m_xTableTable)[ m_nIndex ] );
}
- SwTableAutoFormat* pRet = new SwTableAutoFormat( SwViewShell::GetShellRes()->aStrNone );
- lcl_SetProperties(pRet, false);
- return pRet;
+ return nullptr;
}
// Handler:
@@ -384,7 +372,12 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, SelFormatHdl, weld::TreeView&, void)
m_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 != m_nIndex)
m_xWndPreview->NotifyChange(aTmp);
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index ef2d61b7c73a..30898e79fcb6 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;
@@ -2689,7 +2688,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 ) );
@@ -2709,9 +2708,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();