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

Henry Castro hcastro at collabora.com
Wed Aug 24 03:46:03 UTC 2016


 sc/source/ui/view/cellsh3.cxx |   30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

New commits:
commit 756c4ae5dcb948d6e675287e322720ab890c3e6b
Author: Henry Castro <hcastro at collabora.com>
Date:   Tue Aug 23 14:13:57 2016 -0400

    sc lok: fix re-sizing several rows/columns at once
    
    Reviewed-on: https://gerrit.libreoffice.org/28351
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    
    Conflicts:
    	sc/source/ui/view/cellsh3.cxx
    
    Change-Id: I7b3760432aa4b3120bfd586a1abc42a46fff0df8

diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 036c45e..32aa3cd 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -547,10 +547,19 @@ void ScCellShell::Execute( SfxRequest& rReq )
                                  pReqArgs->HasItem( FN_PARAM_2, &pHeight ) )
                 {
                     std::vector<sc::ColRowSpan> aRanges;
-                    SCCOLROW nRow = static_cast<const SfxInt16Item*>(pRow)->GetValue() - 1;
-                    sal_uInt16 nHeight = static_cast<const SfxInt16Item*>(pHeight)->GetValue();
+                    SCCOLROW nRow = static_cast<const SfxUInt16Item*>(pRow)->GetValue() - 1;
+                    sal_uInt16 nHeight = static_cast<const SfxUInt16Item*>(pHeight)->GetValue();
+                    ScMarkData& rMark = GetViewData()->GetMarkData();
+
+                    if ( rMark.IsRowMarked( static_cast<SCROW>(nRow) ) )
+                    {
+                        aRanges = rMark.GetMarkedRowSpans();
+                    }
+                    else
+                    {
+                        aRanges.push_back(sc::ColRowSpan(nRow, nRow));
+                    }
 
-                    aRanges.push_back(sc::ColRowSpan(nRow, nRow));
                     pTabViewShell->SetWidthOrHeight(false, aRanges, SC_SIZE_DIRECT, nHeight);
                 }
                 else if ( pReqArgs )
@@ -643,10 +652,19 @@ void ScCellShell::Execute( SfxRequest& rReq )
                                  pReqArgs->HasItem( FN_PARAM_2, &pWidth ) )
                 {
                     std::vector<sc::ColRowSpan> aRanges;
-                    SCCOLROW nColumn = static_cast<const SfxInt16Item*>(pColumn)->GetValue() - 1;
-                    sal_uInt16 nWidth = static_cast<const SfxInt16Item*>(pWidth)->GetValue();
+                    SCCOLROW nColumn = static_cast<const SfxUInt16Item*>(pColumn)->GetValue() - 1;
+                    sal_uInt16 nWidth = static_cast<const SfxUInt16Item*>(pWidth)->GetValue();
+                    ScMarkData& rMark = GetViewData()->GetMarkData();
+
+                    if ( rMark.IsColumnMarked( static_cast<SCCOL>(nColumn) ) )
+                    {
+                        aRanges = rMark.GetMarkedColSpans();
+                    }
+                    else
+                    {
+                        aRanges.push_back(sc::ColRowSpan(nColumn, nColumn));
+                    }
 
-                    aRanges.push_back(sc::ColRowSpan(nColumn, nColumn));
                     pTabViewShell->SetWidthOrHeight(true, aRanges, SC_SIZE_DIRECT, nWidth);
                 }
                 else if ( pReqArgs )


More information about the Libreoffice-commits mailing list