Kaydet (Commit) 6274810b authored tarafından Markus Mohrhard's avatar Markus Mohrhard

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
üst c638b526
......@@ -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 )
......
......@@ -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;
......
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