Issue 7500 - Copying across fromulas from one merged cell to another.
Summary: Copying across fromulas from one merged cell to another.
Status: CLOSED FIXED
Alias: None
Product: Calc
Classification: Application
Component: ui (show other issues)
Version: OOo 1.0.1
Hardware: PC All
: P4 Trivial with 8 votes (vote)
Target Milestone: ---
Assignee: oc
QA Contact: issues@sc
URL:
Keywords: oooqa, rfe_eval_ok
: 8301 46166 61598 68784 (view as issue list)
Depends on:
Blocks:
 
Reported: 2002-09-04 14:07 UTC by Unknown
Modified: 2013-08-07 15:14 UTC (History)
14 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Clean Fix to copy-paste problem on merged cells (623 bytes, text/plain)
2007-02-07 23:42 UTC, mloiseleur
no flags Details
a better version, which unmerges the real dest range (721 bytes, text/plain)
2007-02-08 22:07 UTC, mloiseleur
no flags Details
A patch improved according to Niklas comments (2.53 KB, patch)
2007-10-27 15:15 UTC, mloiseleur
no flags Details | Diff
New version of the patch, more faster and robust (13.67 KB, patch)
2008-06-26 07:25 UTC, mloiseleur
no flags Details | Diff
The patch file is about i7500#-v1. (2.66 KB, text/plain)
2009-02-19 09:01 UTC, yonggang.mao
no flags Details
TestCaseSpecification (7.83 KB, text/html)
2009-05-14 08:52 UTC, oc
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Unknown 2002-09-04 14:07:12 UTC
I have merged three cells into one in a number of places. I have a formula in 
the first merged cell that I want to copy along to the others.

1) I can't copy and paste as it comes up with,

"Cell merge not possible if cells already merged!"

2) I want it to update the formula as it does from one normal cell to another, 
ie.
=VLOOKUP(I14;$Jobs.$A$1:$D$125;2)

in cell A1 becomes

=VLOOKUP(I15;$Jobs.$A$1:$D$125;2)

in cell A2. However, when I drag the bottom right as you normally would it re-
splits my cell into it's original 3 cells with the formula in each cell.

Help!!
Comment 1 prgmgr 2002-09-05 04:40:46 UTC
Stephen, thanks for taking the time to post this issue.

First of all, requests for support are best directed to the users 
mailing list.

IssueZilla is reserved for bugs or enhancement request for OO.


Okay, here's my responses to your two issues:

1.  When you copy a merged cell, OO copies the merge cell format
    as well.

    In short, just copy and paste to a regular cell and OO will
    handle the merging for you.

    For example, A1 and A2 are merged and contains the formula
    =SUM(C1;D1)

    Copy the merged cell, and paste into A3.  No need for you to
    merge the cells manually.


2.  I think you are referring to OO changing the values in the
    function relative to the new location.

    Using the example above, the formula in A3 will be =SUM(C3;D3)

    The way to work around this is to cut the contents of A1 and paste
    it back into A1 and A3 in order to preserve your formula.

Comment 2 oc 2003-06-06 12:57:37 UTC
Hi Bettina,
the handling of merged cells should be improved: it should be possible
to paste special with format unchecked with merged cells.
Comment 3 oc 2003-07-08 14:22:23 UTC
*** Issue 8301 has been marked as a duplicate of this issue. ***
Comment 4 rblackeagle 2003-07-23 00:47:21 UTC
Paste in any form will not work when copying and pasting from one set
of merged cells to an identical set of merged cells.

To reproduce:
Merge cells A1 and B1.  Merge cells A2 and B2.  Enter a formula into
the merged A1:B1 cell.  Select the merged cells and Ctrl-C (copy).
Move cursor to the merged A2:B2 cell.  Paste (with Ctrl-P or cursor
selection).  You get "Cannot copy to merged cells."

This happens in 1.1RC1.
Comment 5 bettina.haberer 2003-12-04 18:56:11 UTC
Summary: Copying across formulas from one merged cell to another.
Comment 6 frank 2005-04-14 13:56:07 UTC
*** Issue 46166 has been marked as a duplicate of this issue. ***
Comment 7 Rainer Bielefeld 2006-02-04 10:08:36 UTC
*** Issue 61598 has been marked as a duplicate of this issue. ***
Comment 8 hansel 2006-06-01 20:45:35 UTC
This error is also generated when you try to use the Format Paintbrush from one
merged cell to another merged cell.
Comment 9 Rainer Bielefeld 2006-08-20 17:45:40 UTC
Pls. mention interesting comments in  Issue 68784!
Comment 10 Rainer Bielefeld 2006-08-20 17:46:03 UTC
*** Issue 68784 has been marked as a duplicate of this issue. ***
Comment 11 Rainer Bielefeld 2006-08-20 18:46:39 UTC
*** Issue 68784 has been marked as a duplicate of this issue. ***
Comment 12 officista 2006-10-06 19:36:43 UTC
found the same issue still on OOo 2.0.3:
Calc:
merge cells A1:A2
merge cells B1:B2
enter text "any text" in A1:A2
copy A1:A2
paste to B1:B2
Error message: "Zusammenfassen nicht verschachteln!" (german version).
This is VERY inconvinient!
Comment 13 natag 2007-01-04 10:16:13 UTC
I found the same issue in StarOffice 8.0 Product Patch 5.
This issue was not found in StarOffice 8.0 to StarOffice 8.0 Product Patch 4.

Calc:
merge cells A1:A2
merge cells B1:B2
enter text "any text" in A1:A2
copy A1:A2
paste to B1:B2
Error message: "Zusammenfassen nicht verschachteln!" (german version).
This is very inconvenient!

Is that a bug or has been this feature removed?
Comment 14 mloiseleur 2007-02-07 23:42:35 UTC
Created attachment 42843 [details]
Clean Fix to copy-paste problem on merged cells
Comment 15 mloiseleur 2007-02-07 23:45:18 UTC
Hello,


   Here is a rather simple fix to this problem. And it works well. 
   I have observed that copying merged cells works on unmerged cells. So I
unmerge it before the copy. It works very well, and I don't see any side effects. 
   It was what I was doing manually anyway, when I didn't know how to hack in
OOo ;).
Comment 16 mloiseleur 2007-02-07 23:45:40 UTC
Hello,


   Here is a rather simple fix to this problem. And it works well. 
   I have observed that copying merged cells works on unmerged cells. So I
unmerge it before the copy. It works very well, and I don't see any side effects. 
   It was what I was doing manually anyway, when I didn't know how to hack in
OOo ;).

   Can anyone confirm me if it's ok and when will it be included ?

Thanks,
Comment 17 mloiseleur 2007-02-07 23:45:51 UTC
Hello,


   Here is a rather simple fix to this problem. And it works well. 
   I have observed that copying merged cells works on unmerged cells. So I
unmerge it before the copy. It works very well, and I don't see any side effects. 
   It was what I was doing manually anyway, when I didn't know how to hack in
OOo ;).

   Can anyone confirm me if it's ok  ?

Thanks,
Comment 18 mloiseleur 2007-02-08 22:07:46 UTC
Created attachment 42870 [details]
a better version, which unmerges the real dest range
Comment 19 sgautier.ooo 2007-02-13 08:47:55 UTC
adding me to cc - Sophie
Comment 20 surbun 2007-05-11 10:51:06 UTC
Hello,
I'm using OOo since June 2006 and find very much inconvenient and handicaping 
not to be able to insert a row or colomn when cells are merged. I got OOo 2.3.0 
for testing and this lack of flexibility is still there. May be this will be 
fixed since, as for me, it can be a matter to go back to ms excel. very bad. 
Please can this feature be fixed in the next version of OOo

Thanks
Comment 21 frank 2007-09-19 14:52:55 UTC
Hi Niklas,

please have a look at this one as it is a PATCH now.

Frank
Comment 22 mrsao 2007-10-10 13:27:26 UTC
This serious problem exists for more than 5 years!!!! I'm shocked. :(
Comment 23 clippka 2007-10-10 14:47:33 UTC
cl->nn: Can you document the reason why this patch is not applied or apply it?
Comment 24 niklas.nebel 2007-10-16 17:01:13 UTC
The patch doesn't add undo for unmerging, and it can lead to invalid attribute
state: Merge B1:B3, merge C1:D1, copy C1, paste in A2.
Comment 25 mloiseleur 2007-10-16 20:09:03 UTC
->nn : 
   I am not sure I get your point. 
   You just have to change second parameter to  from "FALSE" to "TRUE" in this 2
lines patch, in order to have a ScUndoUnmerge done by UnmergeCells.

   And, for your use case, the result seems graphically coherent with what the
users tried to do.
   Maybe I can force the paste share the same start point that the copy, but I
do not see why. Can you light me a little, please ?

Thanks,
Comment 26 niklas.nebel 2007-10-17 09:39:44 UTC
A cell can only be part of one set of merged cells. To allow "layered" merging,
more has to be changed (repaint, for example), and even then, it would probably
me more confusing than helpful.
Comment 27 mloiseleur 2007-10-27 15:15:34 UTC
Created attachment 49194 [details]
A patch improved according to Niklas comments
Comment 28 mloiseleur 2007-10-27 15:20:19 UTC
mloiseleur->nn:
  I come with this idea, since OpenOffice is not ready yet to play with
overlapping range : I unmerge all of them which are in the way.
  What do you think ? Is this new patch ok to get into mainline ? 


Regards,
Comment 29 niklas.nebel 2008-01-21 14:47:11 UTC
Not finished in time for 2.4, retargeting.
Comment 30 niklas.nebel 2008-06-25 11:54:25 UTC
Nested loops over individual columns/rows should be avoided. It's a performance
problem already for large selections, and will cause more problems if the
maximum column/row count is increased.

Otherwise, this seems to work and I'll try to get it into 3.1 (too late for 3.0).
Comment 31 mloiseleur 2008-06-26 07:25:00 UTC
Created attachment 54755 [details]
New version of the patch, more faster and robust
Comment 32 mloiseleur 2008-06-26 07:28:10 UTC
->nn: Then you can base your work on the last version of the patch. It fix
problems on infinite loop, but can still be improved on performance, if you
manage to remove call to MergeCells/UnmergeCells.
    The last problem on this patch is on a block insertion, it can screw up
totally the sheet.

Hope this helps you,
Regards,
Comment 33 risner 2009-02-17 06:15:18 UTC
Over a year since a patch was produced, and this still hasn't been fixed?  I run
into this bug daily, since I started using OO.  The "other" sheet doesn't have
this problem, since I'm very used to copy and paste merged cells.

I suppose you could say I make horrible spreadsheets, but I commonly use small
blocks and merge cells to make larger blocks.  So pretty much every sheet I
have, I see this error whenever I try to copy a cell.  I must first select the
exact number of cells in the target area, then cut the target area, then select
the source area, then copy, then select the top left cell and paste.  This is a
serious drain on workflow, and when I forget to follow the procedure, it is also
a waste of time to start all over.

One question I have about the proposed patch.  If you drag the cells to make
duplicates, does it handle making the duplicates merged cells as well?  Meaning
if I have A1:A2 merged, and I grab the lower right corner of A2 and drag it down
3 cells, do I end up with the only expected behaviour?  Do I end up with B1:B2,
C1:C2, and D1:D2 merged and copies of the formula from A1:A2 present?
Comment 34 yonggang.mao 2009-02-17 09:18:47 UTC
>mloiseleur:
the last pacth is about inserting merged cell's patch,it is wrong.the merged 
cell's issue is issue 8302.
Comment 35 mloiseleur 2009-02-17 10:01:57 UTC
maoyg: oops, you're right. Sorry for the mistake.
Comment 36 yonggang.mao 2009-02-19 03:50:19 UTC
>mloiseleur
I applied your patch about the copy-merged-cells,I don't completely understand 
your Nested loops,I think it can be removed,what do you think about it?
Comment 37 mloiseleur 2009-02-19 07:45:53 UTC
Hi maoyg,
   This nested loop was for a use case like this : 
* Fill B1 and B3 with a value
* Merge A2 -> C2 with a value
   In OOo 2.1.0, when you select the column from B1 to B3, the merged A2:C2
range was also selected. So I was forced to clean (ie : unmerge it) before
applying the copy. It does not seem to be the case anymore in recent versions of
OpenOffice.org. So Yes, I agree with you : it can be removed.

Regards, 
Comment 38 yonggang.mao 2009-02-19 08:02:58 UTC
Hi mloiseleur,
thanks for your comment!I think Niklas can integrate it in OOo3.2 version.
Comment 39 yonggang.mao 2009-02-19 08:13:55 UTC
Hi mloiseleur,
this patch exist some questions,you should see Niklas's comment in 2007/10/16 
16:01:13.
Comment 40 yonggang.mao 2009-02-19 09:01:30 UTC
Created attachment 60297 [details]
The patch file is about i7500#-v1.
Comment 41 yonggang.mao 2009-02-19 09:04:58 UTC
Accepted.
Comment 42 niklas.nebel 2009-03-12 10:27:12 UTC
I added the patch to CWS "calc49".
Comment 43 niklas.nebel 2009-04-03 08:59:29 UTC
reassigning to QA for verification
Comment 44 oc 2009-05-14 08:52:33 UTC
Created attachment 62256 [details]
TestCaseSpecification
Comment 45 oc 2009-05-14 08:53:51 UTC
verified in internal build cws_calc49
Comment 46 amy2008 2009-06-01 06:36:27 UTC
Fixed in DEV300m49 on WinXP 
Closing