summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-12-23 08:58:17 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-12-23 09:15:30 +0100
commit49a1737b7d3d61304e749c6c164165b8bf68790e (patch)
treec834a9a8e9d44ab1442738602acdb1a3bf6a7410
parent62b9587a0d62a02aaab2ac7a4b34efb2ade16d7b (diff)
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
-rw-r--r--sc/source/ui/app/transobj.cxx4
-rw-r--r--sc/source/ui/view/viewfun3.cxx19
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;