diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-03-18 18:34:51 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-03-18 18:38:13 +0100 |
commit | 0ee518863337fba9bce019e05e24f527617a4321 (patch) | |
tree | 4b315d802b29eff61f6a051b26cf1bbbda80116f /sc | |
parent | 90d84c6dcb48886f697b7b29f9673f782994ae95 (diff) |
also shrink used area for HTML in some cases, fdo#46230, n#677811
Hopefully this will allow pasting to external applications with whole
column/row selected while not affecting calc itself.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/app/transobj.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index b52ca6f7fa58..cb1fa540dacd 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -310,7 +310,20 @@ sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor ) sal_Bool bIncludeFiltered = pDoc->IsCutMode() || bUsedForLink; - ScImportExport aObj( pDoc, aBlock ); + ScRange aReducedBlock = aBlock; + if ( nFormat == SOT_FORMATSTR_ID_HTML && (aBlock.aEnd.Col() == MAXCOL || aBlock.aEnd.Row() == MAXROW) && aBlock.aStart.Tab() == aBlock.aEnd.Tab() ) + { + bool bShrunk = false; + //shrink the area to allow pasting to external applications + SCCOL aStartCol = aReducedBlock.aStart.Col(); + SCROW aStartRow = aReducedBlock.aStart.Row(); + SCCOL aEndCol = aReducedBlock.aEnd.Col(); + SCROW aEndRow = aReducedBlock.aEnd.Row(); + pDoc->ShrinkToUsedDataArea( bShrunk, aReducedBlock.aStart.Tab(), aStartCol, aStartRow, aEndCol, aEndRow, false); + aReducedBlock = ScRange(aStartCol, aStartRow, aReducedBlock.aStart.Tab(), aEndCol, aEndRow, aReducedBlock.aEnd.Tab()); + } + + ScImportExport aObj( pDoc, aReducedBlock ); ScExportTextOptions aTextOptions(ScExportTextOptions::None, 0, true); if ( bUsedForLink ) { |