diff options
author | Jim Raykowski <raykowj@gmail.com> | 2019-02-26 00:05:52 -0900 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2019-03-01 03:44:12 +0100 |
commit | 1dc25980171ff79345484631882d6ea0eb6f9388 (patch) | |
tree | ed8b51fe590d053602ce949f3a9f0c93d991ada9 /sw | |
parent | 94d152054d8be172c56a2243f44a566c9a3e2215 (diff) |
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 <raykowj@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/shells/basesh.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
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); |