fpspreadsheet: Fix pasting from LibreOffice clipboard.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5066 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-08-02 13:58:08 +00:00
parent d5fb5a417e
commit cb4466eef7

View File

@ -8595,6 +8595,7 @@ begin
end; end;
end; end;
// Select all copied cells // Select all copied cells
sel := Range(Cardinal(-1), Cardinal(-1), Cardinal(-1), Cardinal(-1));
SetLength(selArray, nselS); SetLength(selArray, nselS);
for i := 0 to nselS-1 do for i := 0 to nselS-1 do
begin begin
@ -8615,14 +8616,15 @@ begin
r := sel.Row2; r := sel.Row2;
c := sel.Col2; c := sel.Col2;
end; end;
ActiveWorksheet.SelectCell(r + dr, c + dc); if (r <> -1) and (c <> -1) then
ActiveWorksheet.SelectCell(r + dr, c + dc);
end end
else else
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Case (2): Source is a single block (not necessarily a cell), Dest can be // Case (2): Source is a single block (not necessarily a cell), Dest can be
// any shape --> source is tiled into destination // any shape --> source is tiled into destination
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
if nselS = 1 then // if nselS = 1 then
begin begin
// size of source block // size of source block
with clipsheet do with clipsheet do
@ -8672,13 +8674,15 @@ begin
end; // while r... end; // while r...
end; // for i end; // for i
// No need to select copied cells - they already are. // No need to select copied cells - they already are.
end end ;
{
else else
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Other arrangements of source and destination are not supported // Other arrangements of source and destination are not supported
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
raise Exception.Create('This arrangement of source and destination '+ raise Exception.Create('This arrangement of source and destination '+
'cells in not supported for copy & paste'); 'cells in not supported for copy & paste');
}
finally finally
clipbook.Free; clipbook.Free;
end; end;