You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Tim Wilkins <ti...@mediatel.co.uk> on 2004/03/01 14:14:10 UTC

HSSFCellStyle not clonable, darn!!!

Hi there,

Is there a reason why the class HSSFCellStyle is not cloneable? I really 
need this object to be clonable as I'm attempting to create my own merge 
from an existing HSSFCell object and want to create copies of its 
existing HSSFCellStyle so I can modify the copies and apply them to the 
new sibling cells that will make up the merge.

In the mean time I'll submit a bug report and modify the source code so 
I can clone HSSFCellStyle but I want to check that this is an oversight 
and not a reasoned decision to omit the clone() method.

Those in the know can you let me know, cheers :)

Tim




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: HSSFCellStyle not clonable, darn!!!

Posted by Tim Wilkins <ti...@mediatel.co.uk>.
Ok, I think I know why the HSSFCellStyle class does not implement the 
clone() method, simply because it would be no good for the purpose of 
copying a whole cell style with all it's containers (had to refresh 
myself with the old shallow vs deep copy concepts).

What I have done is to implement a deep copy via serialisation. To do 
this however I have had to alter the HSSFCellStyle and 
ExtendedFormatRecord classes to implement java.io.Serializable.

I'm prepared to submit my changes to the project but I have to confess 
I've never done anything like this before so could a kind soul point me 
in the right direction.

Many thanks,

Tim

Tim Wilkins wrote:

> Hi there,
>
> Is there a reason why the class HSSFCellStyle is not cloneable? I 
> really need this object to be clonable as I'm attempting to create my 
> own merge from an existing HSSFCell object and want to create copies 
> of its existing HSSFCellStyle so I can modify the copies and apply 
> them to the new sibling cells that will make up the merge.
>
> In the mean time I'll submit a bug report and modify the source code 
> so I can clone HSSFCellStyle but I want to check that this is an 
> oversight and not a reasoned decision to omit the clone() method.
>
> Those in the know can you let me know, cheers :)
>
> Tim
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org