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

Tamas Bunth tamas.bunth at collabora.co.uk
Wed Aug 16 13:56:15 UTC 2017


 sc/source/ui/vba/vbarange.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 38f5de12bade632d5c167ccb40bfbdd28761a49c
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
Date:   Tue Aug 15 15:52:36 2017 +0200

    oovbaapi: Allow copying of multiple selections
    
    Change-Id: If098b44d2627d86795cea4e4211d357d1a562dba
    Reviewed-on: https://gerrit.libreoffice.org/41176
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tamás Bunth <btomi96 at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/41211
    Reviewed-by: Aron Budea <aron.budea at collabora.com>
    Tested-by: Aron Budea <aron.budea at collabora.com>

diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 98f8bc3d4696..744473c80c70 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -2482,10 +2482,11 @@ ScVbaRange::getMergeCells() throw (script::BasicErrorException, uno::RuntimeExce
 void
 ScVbaRange::Copy(const ::uno::Any& Destination) throw (uno::RuntimeException, std::exception)
 {
-    if ( m_Areas->getCount() > 1 )
-        throw uno::RuntimeException("That command cannot be used on multiple selections" );
     if ( Destination.hasValue() )
     {
+        // TODO copy with multiple selections should work here too
+        if ( m_Areas->getCount() > 1 )
+            throw uno::RuntimeException("That command cannot be used on multiple selections" );
         uno::Reference< excel::XRange > xRange( Destination, uno::UNO_QUERY_THROW );
         uno::Any aRange = xRange->getCellRange();
         uno::Reference< table::XCellRange > xCellRange;
@@ -2503,9 +2504,7 @@ ScVbaRange::Copy(const ::uno::Any& Destination) throw (uno::RuntimeException, st
     }
     else
     {
-        uno::Reference< frame::XModel > xModel = getModelFromRange( mxRange );
-        Select();
-        excel::implnCopy( xModel );
+        excel::implnCopy( getUnoModel() );
     }
 }
 


More information about the Libreoffice-commits mailing list