diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-12-23 08:58:17 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-12-23 09:14:17 +0100 |
commit | 6274810bf61285a1ac27e4a6a19c7aa1566b0df8 (patch) | |
tree | aeb183720a1f9b89897bc6ca0042ee54546e9ed6 /sc | |
parent | adjust absolute refs to copied areas correctly (diff) | |
download | core-6274810bf61285a1ac27e4a6a19c7aa1566b0df8.tar.gz core-6274810bf61285a1ac27e4a6a19c7aa1566b0df8.zip |
fix copy/paste with whole column/row
this fix should restore the old copy/paste behavior in calc and still
only paste relevant entries to external programs
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/app/transobj.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun3.cxx | 19 |
2 files changed, 4 insertions, 19 deletions
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index c923fd6cbc1c..a61e5d3d8d9e 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -61,6 +61,7 @@ #include "scmod.hxx" #include "dragdata.hxx" #include "clipdata.hxx" +#include "clipparam.hxx" // for InitDocShell #include <editeng/paperinf.hxx> @@ -171,6 +172,9 @@ ScTransferObj::ScTransferObj( ScDocument* pClipDoc, const TransferableObjectDesc } OSL_ENSURE(!bFirst, "no sheet selected"); + if (!pDoc->GetClipParam().isMultiRange() && nTab1 == nTab2) + pDoc->ShrinkToDataArea( nTab1, nCol1, nRow1, nCol2, nRow2 ); + // only limit to used cells if whole sheet was marked // (so empty cell areas can be copied) if ( nCol2>=MAXCOL && nRow2>=MAXROW ) diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 68ccf215583c..bd133148e82e 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -277,28 +277,9 @@ sal_Bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, sal_Bool bCut, sal_Bool b { ScRange aRange; ScMarkType eMarkType = GetViewData()->GetSimpleArea( aRange ); - ScDocument* pDoc = GetViewData()->GetDocument(); ScMarkData& rMark = GetViewData()->GetMarkData(); sal_Bool bDone = sal_False; - if( !pClipDoc ) // System Copy - adjust the ranges. - { - SCCOL nCol1 = aRange.aStart.Col(); - SCCOL nCol2 = aRange.aEnd.Col(); - SCROW nRow1 = aRange.aStart.Row(); - SCROW nRow2 = aRange.aEnd.Row(); - pDoc->ShrinkToDataArea( aRange.aStart.Tab(), nCol1, nRow1, nCol2, nRow2 ); - if( aRange.aStart.Col() == 0 && aRange.aEnd.Col() == MAXCOL ) - { - aRange.aStart.SetCol( nCol1 ); - aRange.aEnd.SetCol( nCol2 ); - } - if( aRange.aStart.Row() == 0 && aRange.aEnd.Row() == MAXROW ) - { - aRange.aStart.SetRow( nRow1 ); - aRange.aEnd.SetRow( nRow2 ); - } - } if ( eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED ) { ScRangeList aRangeList; |