Kaydet (Commit) fd641033 authored tarafından Tamas Bunth's avatar Tamas Bunth Kaydeden (comit) Tamás Bunth

oovbaapi: Allow copying of multiple selections

Change-Id: If098b44d2627d86795cea4e4211d357d1a562dba
Reviewed-on: https://gerrit.libreoffice.org/41176Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTamás Bunth <btomi96@gmail.com>
üst 014c30d1
...@@ -2491,10 +2491,11 @@ ScVbaRange::getMergeCells() ...@@ -2491,10 +2491,11 @@ ScVbaRange::getMergeCells()
void void
ScVbaRange::Copy(const ::uno::Any& Destination) 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() ) 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::Reference< excel::XRange > xRange( Destination, uno::UNO_QUERY_THROW );
uno::Any aRange = xRange->getCellRange(); uno::Any aRange = xRange->getCellRange();
uno::Reference< table::XCellRange > xCellRange; uno::Reference< table::XCellRange > xCellRange;
...@@ -2512,9 +2513,7 @@ ScVbaRange::Copy(const ::uno::Any& Destination) ...@@ -2512,9 +2513,7 @@ ScVbaRange::Copy(const ::uno::Any& Destination)
} }
else else
{ {
uno::Reference< frame::XModel > xModel = getModelFromRange( mxRange ); excel::implnCopy( getUnoModel() );
Select();
excel::implnCopy( xModel );
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment