[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Thu Mar 1 22:13:26 UTC 2018


 sc/source/ui/view/viewfun2.cxx |   25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

New commits:
commit c348476a2ca16d6c32d2d17a2cae5f59e967bf6d
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Mar 1 23:12:12 2018 +0100

    Related: tdf#54197 copy AutoSpellData from adjacent if no selection
    
    Change-Id: I82223a64f5c5ec3c98dba390d88af8369a322bd7

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());
             }
 


More information about the Libreoffice-commits mailing list