[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 2 commits - sc/source xmloff/source

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Thu Aug 29 07:17:43 UTC 2019


 sc/source/ui/view/viewfun2.cxx  |   63 +++++++++++++++++++++++-----------------
 xmloff/source/text/txtexppr.cxx |    7 ++--
 2 files changed, 41 insertions(+), 29 deletions(-)

New commits:
commit c4e7271a58ceb3178cad2c2f686985ea7362d085
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Aug 7 18:49:24 2019 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Aug 29 09:17:17 2019 +0200

    tdf#125628: FORMATTING: Part of text loose yellow highlight reopening document
    
    Change-Id: Id42c33857537451c2dec17d24f65b10f9c16dfa2
    Reviewed-on: https://gerrit.libreoffice.org/77135
    Tested-by: Jenkins
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    (cherry picked from commit fa774e16b1dfe4844ec5eb3f9372d6468f6b8a56)
    Reviewed-on: https://gerrit.libreoffice.org/77183
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/77902
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx
index 8e963dbe9e0a..3d2acaff4209 100644
--- a/xmloff/source/text/txtexppr.cxx
+++ b/xmloff/source/text/txtexppr.cxx
@@ -1129,9 +1129,8 @@ void XMLTextExportPropertySetMapper::ContextFilter(
         pClip11State->mnIndex = -1;
 
     // When both background attributes are available export the visible one
-    if( pCharHighlight && pCharBackground )
+    if (pCharHighlight)
     {
-        assert(pCharBackgroundTransparency); // always together
         Color nColor = COL_TRANSPARENT;
         pCharHighlight->maValue >>= nColor;
         if( nColor == COL_TRANSPARENT )
@@ -1140,8 +1139,10 @@ void XMLTextExportPropertySetMapper::ContextFilter(
             // and we'd need another property CharHighlightTransparent for that
             pCharHighlight->mnIndex = -1;
         }
-        else
+        // When both background attributes are available export the visible one
+        else if(pCharBackground)
         {
+            assert(pCharBackgroundTransparency); // always together
             pCharBackground->mnIndex = -1;
             pCharBackgroundTransparency->mnIndex = -1;
         }
commit 44d56e25d6b68b0a8f37b9b8d4f0da68bbe285c2
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Thu Jun 20 18:02:38 2019 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Aug 29 09:17:02 2019 +0200

    Resolves: tdf#108209 let auto fill handle double click stop at existing data
    
    Also consolidate the code to take both, left and right, data areas
    into account, still preferring left if it exists.
    
    Change-Id: I3d46b32f3790fd367fe92712fbcab0c392294599
    Reviewed-on: https://gerrit.libreoffice.org/74462
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 7dd57a914be5f8fc2b53b7725c16625887cf7439)
    Reviewed-on: https://gerrit.libreoffice.org/77157
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/77901
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 565fa987e0e3..1b948b916746 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1630,40 +1630,51 @@ void ScViewFunc::FillCrossDblClick()
 
     if ( nEndY < MAXROW )
     {
-        if ( nStartX > 0 )
+        const bool bDataLeft = (nStartX > 0);
+        if (bDataLeft || nEndX < MAXCOL)
         {
-            SCCOL nMovX = nStartX - 1;
-            SCROW nMovY = nStartY;
+            // Check that there is
+            // 1) data immediately left (preferred) or right of start (row) of selection
+            // 2) data there below
+            // 3) no data immediately below selection
 
-            if ( pDoc->HasData( nMovX, nStartY, nTab ) &&
-                 pDoc->HasData( nMovX, nStartY + 1, nTab ) )
+            SCCOL nMovX = (bDataLeft ? nStartX - 1 : nEndX + 1);
+            SCROW nMovY = nStartY;
+            bool bDataFound = (pDoc->HasData( nMovX, nStartY, nTab) && pDoc->HasData( nMovX, nStartY + 1, nTab));
+            if (!bDataFound && bDataLeft && nEndX < MAXCOL)
             {
-                pDoc->FindAreaPos( nMovX, nMovY, nTab, SC_MOVE_DOWN );
-
-                if ( nMovY > nEndY )
-                {
-                    FillAuto( FILL_TO_BOTTOM, nStartX, nStartY, nEndX, nEndY,
-                              nMovY - nEndY );
-                    return;
-                }
+                nMovX = nEndX + 1;  // check right
+                bDataFound = (pDoc->HasData( nMovX, nStartY, nTab) && pDoc->HasData( nMovX, nStartY + 1, nTab));
             }
-        }
 
-        if ( nEndX < MAXCOL )
-        {
-            SCCOL nMovX = nEndX + 1;
-            SCROW nMovY = nStartY;
-
-            if ( pDoc->HasData( nMovX, nStartY, nTab ) &&
-                 pDoc->HasData( nMovX, nStartY + 1, nTab ) )
+            if (bDataFound && pDoc->IsBlockEmpty( nTab, nStartX, nEndY + 1, nEndX, nEndY + 1, true))
             {
-                pDoc->FindAreaPos( nMovX, nMovY, nTab, SC_MOVE_DOWN );
+                // Get end of data left or right.
+                pDoc->FindAreaPos( nMovX, nMovY, nTab, SC_MOVE_DOWN);
+                // Find minimum end row of below empty area and data right.
+                for (SCCOL nX = nStartX; nX <= nEndX; ++nX)
+                {
+                    SCROW nY = nEndY + 1;
+                    // Get next row with data in this column.
+                    pDoc->FindAreaPos( nX, nY, nTab, SC_MOVE_DOWN);
+                    if (nMovY == MAXROW && nY == MAXROW)
+                    {
+                        // FindAreaPos() returns MAXROW also if there is no
+                        // data at all from the start, so check if that
+                        // contains data if the nearby (left or right) data
+                        // ends there and increment if no data here, pretending
+                        // the next data would be thereafter so nMovY will not
+                        // be decremented.
+                        if (!pDoc->HasData( nX, nY, nTab))
+                            ++nY;
+                    }
+                    if (nMovY > nY - 1)
+                        nMovY = nY - 1;
+                }
 
-                if ( nMovY > nEndY )
+                if (nMovY > nEndY)
                 {
-                    FillAuto( FILL_TO_BOTTOM, nStartX, nStartY, nEndX, nEndY,
-                              nMovY - nEndY );
-                    return;
+                    FillAuto( FILL_TO_BOTTOM, nStartX, nStartY, nEndX, nEndY, nMovY - nEndY);
                 }
             }
         }


More information about the Libreoffice-commits mailing list