diff options
author | Tamas Bunth <tamas.bunth@collabora.co.uk> | 2017-08-15 15:52:36 +0200 |
---|---|---|
committer | Tamás Bunth <btomi96@gmail.com> | 2017-08-16 09:02:32 +0200 |
commit | fd64103319a28fedb44cdc0438887914dba396cb (patch) | |
tree | c2d5ab0d6b60190e584b06995d1467f6951d61e2 | |
parent | 014c30d12945f3c48e3b4758a01fa0721d1ec3c3 (diff) |
oovbaapi: Allow copying of multiple selections
Change-Id: If098b44d2627d86795cea4e4211d357d1a562dba
Reviewed-on: https://gerrit.libreoffice.org/41176
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 29944d78dccb..216e158729ee 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -2491,10 +2491,11 @@ ScVbaRange::getMergeCells() void ScVbaRange::Copy(const ::uno::Any& Destination) { - 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; @@ -2512,9 +2513,7 @@ ScVbaRange::Copy(const ::uno::Any& Destination) } else { - uno::Reference< frame::XModel > xModel = getModelFromRange( mxRange ); - Select(); - excel::implnCopy( xModel ); + excel::implnCopy( getUnoModel() ); } } |