summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-05-19 16:55:39 +0200
committerSzymon Kłos <eszkadev@gmail.com>2020-05-20 15:19:04 +0200
commitb76c00c642a861fd01a7c82ad1b1ee1bc88ebd7c (patch)
tree702e9293ebc587bb966db876058a8250c36568c1
parent10549444abc85e248ad3bff1b51b7c00ae345e98 (diff)
Make Insert Table dialog async fix
Change-Id: If3d9e7d40f227cb657b2a9ff9714017d04bd76d4
-rw-r--r--sw/source/uibase/shells/basesh.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index f34c8a802d50..44f5f0a53b38 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -2712,7 +2712,7 @@ static void InsertTableImpl(SwWrtShell& rSh,
sal_uInt16 nCols,
SwInsertTableOptions aInsTableOpts,
const OUString& aAutoName,
- std::unique_ptr<SwTableAutoFormat> pTAFormat)
+ std::unique_ptr<SwTableAutoFormat>& pTAFormat)
{
rSh.StartUndo(SwUndoId::INSTABLE);
@@ -2755,6 +2755,7 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
bool bCallEndUndo = false;
if( !pArgs && rSh.IsSelection() && !rSh.IsInClickToEdit() &&
+ !rSh.IsTableMode() )
{
const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
SwInsertTableOptions aInsTableOpts = pModOpt->GetInsTableFlags(bHTMLMode);
@@ -2825,7 +2826,7 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
std::shared_ptr<weld::DialogController> pDialogController(pAbstractDialog->getDialogController());
weld::DialogController::runAsync(pDialogController,
- [pAbstractDialog, &rSh, &rTempView, aTableNameIn, nRowsIn, nColsIn, aInsTableOptsIn, aAutoNameIn, pTAFormatIn] (sal_Int32 nResult) {
+ [pAbstractDialog, &rSh, &rTempView, aTableNameIn, nRowsIn, nColsIn, aInsTableOptsIn, aAutoNameIn, &pTAFormatIn] (sal_Int32 nResult) {
if( RET_OK == nResult )
{
sal_uInt16 nCols = nColsIn;
@@ -2833,17 +2834,14 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
SwInsertTableOptions aInsTableOpts = aInsTableOptsIn;
OUString aTableName = aTableNameIn;
OUString aAutoName = aAutoNameIn;
- SwTableAutoFormat* pTAFormat = pTAFormatIn;
- pAbstractDialog->GetValues( aTableName, nRows, nCols, aInsTableOpts, aAutoName, pTAFormat );
+ pAbstractDialog->GetValues( aTableName, nRows, nCols, aInsTableOpts, aAutoName, pTAFormatIn );
if( nCols && nRows )
{
- InsertTableImpl( rSh, rTempView, aTableName, nRows, nCols, aInsTableOpts, aAutoName, pTAFormat );
+ InsertTableImpl( rSh, rTempView, aTableName, nRows, nCols, aInsTableOpts, aAutoName, pTAFormatIn );
EndUndo(rSh);
}
-
- delete pTAFormat;
}
}
);
@@ -2862,7 +2860,6 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
InsertTableImpl( rSh, rTempView, aTableNameIn, nRowsIn, nColsIn, aInsTableOptsIn, aAutoNameIn, pTAFormatIn );
bCallEndUndo = true;
- delete pTAFormatIn;
}
}