sw/source/uibase/shells/basesh.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
New commits: commit 1dc25980171ff79345484631882d6ea0eb6f9388 Author: Jim Raykowski <rayk...@gmail.com> AuthorDate: Tue Feb 26 00:05:52 2019 -0900 Commit: Jim Raykowski <rayk...@gmail.com> CommitDate: Fri Mar 1 03:44:12 2019 +0100 tdf#123516 Speed up insert of large tables with auto format table style This patch replaces SwFEShell::SetTableStyle use to resolve tdf#108227 with SwTable::SetTableStyleName. The gain in insert speed is a result of eliminating SwFEShell::SetTableStyle call to the time consuming SwFEShell::UpdateTableStyleFormatting function which is somewhat redundant when inserting a table. Change-Id: Ide1e003d9709a6758e021b52fcf9e40a7b0fcba0 Reviewed-on: https://gerrit.libreoffice.org/68372 Tested-by: Jenkins Reviewed-by: Jim Raykowski <rayk...@gmail.com> diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index e78e91fa76eb..fa22a93d72ff 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -111,6 +111,7 @@ #include <SwStyleNameMapper.hxx> #include <poolfmt.hxx> +#include <shellres.hxx> FlyMode SwBaseShell::eFrameMode = FLY_DRAG_END; @@ -2695,8 +2696,14 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest ) if( !aTableName.isEmpty() && !rSh.GetTableStyle( aTableName ) ) rSh.GetTableFormat()->SetName( aTableName ); - if( pTAFormat != nullptr && aAutoName != SwStyleNameMapper::GetUIName( RES_POOLTABSTYLE_DEFAULT, OUString() ) ) - rSh.SetTableStyle( aAutoName ); + if( pTAFormat != nullptr && !aAutoName.isEmpty() + && aAutoName != SwStyleNameMapper::GetUIName( RES_POOLTABSTYLE_DEFAULT, OUString() ) + && aAutoName != SwViewShell::GetShellRes()->aStrNone ) + { + SwTableNode* pTableNode = const_cast<SwTableNode*>( rSh.IsCursorInTable() ); + if ( pTableNode ) + pTableNode->GetTable().SetTableStyleName( aAutoName ); + } rSh.EndAllAction(); rTempView.AutoCaption(TABLE_CAP); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits