diff options
author | Tamás Gulácsi <tgulacsi78@gmail.com> | 2016-11-11 21:11:01 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-11-12 14:43:22 +0000 |
commit | 96175a4bc6687c3adc31b9e0246fe49db2b7675e (patch) | |
tree | 2cefbbe0c0f8be5a0b4ad5c402fd80bab80bbdf5 | |
parent | f57502e75cae1020f3fcfa5919802a78a6ccb6ff (diff) |
tdf#69981 - sc: blank empty cells in TextToColumns
If the string is empty, we must delete the destination cell.
This is done, iff we don't return early (rStr.isEmpty() check).
Instead, add a fast path for the empty string.
Change-Id: I950db5012e7e9337f2efd576e58198b1b49eaa0c
Reviewed-on: https://gerrit.libreoffice.org/30778
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | sc/source/ui/docshell/impex.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 9cfe424225fa..35527ff8ce7a 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -957,8 +957,15 @@ static bool lcl_PutString( { ScDocument* pDoc = &rDocImport.getDoc(); bool bMultiLine = false; - if ( nColFormat == SC_COL_SKIP || rStr.isEmpty() || !ValidCol(nCol) || !ValidRow(nRow) ) + if ( nColFormat == SC_COL_SKIP || !ValidCol(nCol) || !ValidRow(nRow) ) return bMultiLine; + if ( rStr.isEmpty() ) { + if ( bUseDocImport ) + rDocImport.setAutoInput(ScAddress(nCol, nRow, nTab), rStr ); + else + pDoc->SetString( nCol, nRow, nTab, rStr ); + return false; + } if ( nColFormat == SC_COL_TEXT ) { |