sc/source/core/data/clipcontext.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+)
New commits: commit f463c4890df7677f157e5f8510f91225a76fc6ed Author: Eike Rathke <[email protected]> Date: Wed Jan 4 21:47:20 2017 +0100 handle paste special of single formula cell if IsEmptyDisplayedAsString() Similar to CopyCellsFromClipHandler. Change-Id: I7da8a55c3648c6f04c5f3b11459764fd42f51399 (cherry picked from commit 3afe82bd63fde41d2a88418fb64e4ff587b05436) Reviewed-on: https://gerrit.libreoffice.org/32743 Reviewed-by: Eike Rathke <[email protected]> Tested-by: Jenkins <[email protected]> diff --git a/sc/source/core/data/clipcontext.cxx b/sc/source/core/data/clipcontext.cxx index 784437f..b03f164 100644 --- a/sc/source/core/data/clipcontext.cxx +++ b/sc/source/core/data/clipcontext.cxx @@ -219,6 +219,11 @@ void CopyFromClipContext::setSingleCell( const ScAddress& rSrcPos, const ScColum rSrcCell.set(pErrCell); } } + else if (rSrcCell.mpFormula->IsEmptyDisplayedAsString()) + { + // Empty stays empty and doesn't become 0. + rSrcCell.clear(); + } else if (rSrcCell.mpFormula->IsValue()) { bool bPaste = isDateCell(rSrcCol, rSrcPos.Row()) ? bDateTime : bNumeric; commit 328d9f9781a3114693dbfbda442a28f9dc354b92 Author: Eike Rathke <[email protected]> Date: Wed Jan 4 21:23:40 2017 +0100 handle paste special of single formula cell with error result This apparently was never implemented, unlike in the block pasting code that handles it fine. Formula cells with error results were always copied as is if numeric was requested, even if formulas weren't requested. Change-Id: Id550c4e757b6bb2c06aa0637328216383cdf3d6b (cherry picked from commit 12ecd30476f17c6f6efde976f8e56d604eda0f1e) Reviewed-on: https://gerrit.libreoffice.org/32742 Reviewed-by: Eike Rathke <[email protected]> Tested-by: Jenkins <[email protected]> diff --git a/sc/source/core/data/clipcontext.cxx b/sc/source/core/data/clipcontext.cxx index 8b0ce0d..784437f 100644 --- a/sc/source/core/data/clipcontext.cxx +++ b/sc/source/core/data/clipcontext.cxx @@ -211,6 +211,13 @@ void CopyFromClipContext::setSingleCell( const ScAddress& rSrcPos, const ScColum if (!bNumeric) // Error code is treated as numeric value. Don't paste it. rSrcCell.clear(); + else + { + // Turn this into a formula cell with just the error code. + ScFormulaCell* pErrCell = new ScFormulaCell(mpClipDoc, rSrcPos); + pErrCell->SetErrCode(nErr); + rSrcCell.set(pErrCell); + } } else if (rSrcCell.mpFormula->IsValue()) { _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
