diff options
author | Eike Rathke <erack@redhat.com> | 2018-03-01 23:12:12 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-03-01 23:12:18 +0100 |
commit | c348476a2ca16d6c32d2d17a2cae5f59e967bf6d (patch) | |
tree | af2827c4b7f7b88ef7c5ca9d1407485eb5c300de | |
parent | 59587251357973dc9139e7c4038c1f1563b83be4 (diff) |
Related: tdf#54197 copy AutoSpellData from adjacent if no selection
Change-Id: I82223a64f5c5ec3c98dba390d88af8369a322bd7
-rw-r--r-- | sc/source/ui/view/viewfun2.cxx | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 606d7a0f7a48..a4406ad3cbaf 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -1286,10 +1286,27 @@ void ScViewFunc::FillSimple( FillDir eDir ) bool bDoAutoSpell = pDocSh->GetDocument().GetDocOptions().IsAutoSpell(); if ( bDoAutoSpell ) { - SCROW nFromRow = aRange.aStart.Row(); - if (nFromRow > 0 && nFromRow == aRange.aEnd.Row()) - --nFromRow; // copy AutoSpellData from row above if no selection - CopyAutoSpellData(eDir, aRange.aStart.Col(), nFromRow, aRange.aEnd.Col(), aRange.aEnd.Row(), + // Copy AutoSpellData from above(left/right/below) if no selection. + switch (eDir) + { + case FILL_TO_BOTTOM: + if (aRange.aStart.Row() > 0 && aRange.aStart.Row() == aRange.aEnd.Row()) + aRange.aStart.IncRow(-1); + break; + case FILL_TO_TOP: + if (aRange.aEnd.Row() < MAXROW && aRange.aStart.Row() == aRange.aEnd.Row()) + aRange.aEnd.IncRow(1); + break; + case FILL_TO_RIGHT: + if (aRange.aStart.Col() > 0 && aRange.aStart.Col() == aRange.aEnd.Col()) + aRange.aStart.IncCol(-1); + break; + case FILL_TO_LEFT: + if (aRange.aEnd.Col() < MAXCOL && aRange.aStart.Col() == aRange.aEnd.Col()) + aRange.aEnd.IncCol(1); + break; + } + CopyAutoSpellData(eDir, aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row(), ::std::numeric_limits<sal_uLong>::max()); } |