Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cell.copyCellStyle(Cell) does only copy some part of the style #51

Open
drame1499 opened this issue Apr 14, 2016 · 8 comments
Open

Cell.copyCellStyle(Cell) does only copy some part of the style #51

drame1499 opened this issue Apr 14, 2016 · 8 comments
Labels

Comments

@drame1499
Copy link

The current implementation copies the border style for all borders from the top border of the source cell but preserves the left border if it was null.

Also it doesn't copy the font size but the font type and color.

I think that's not intuitive. Why not copy all the border styles seperately. Why not copy the font size?
The name of the Method suggests that it copies the style of the cell, so it should actually do this.

I wonder why this is. Is this some sort of historical behavior?

@dhorions dhorions added the bug label Apr 14, 2016
@dhorions
Copy link
Owner

Hi,

the left border is not set if it was null, because only the first cell in a row should have a left border.
The fontSize not being copied is a bug, and I'll fix it as soon as I can.

Thanks,

Dries

@drame1499
Copy link
Author

Thank you for your reply.
Your argument for keeping the left border null is logical.

For my use case where I defined two cells with a seperating border in the middle it would be great to have a copy Method that actually copies all the borders of the cell.
This way I could simply copy down the style of the two cells of the first row to the cells of all following cells.
Maybe an additional method copyCellStyle(Cell, boolean) would be possible, where the current copyCellStyle(Cell) would call copyCellStyle(Cell, false) and the new copyCellStyle(Cell, boolean) copies the border styles one by one if the boolean is true?

I also have another question unrelated to this one:
Is it possible to get the height of the table on the last page of a multi page table.
I need that height to insert a table with dynamic data possibly spanning multiple pages, but insert other things after the table.
There seems to be no method for this use case. I guess the Table class would need to keep track of how which rows where drawn on the last page and sum up the height of these rows including the drawn headers?

@dhorions
Copy link
Owner

The draw method should return the bottom position of your table. You should be able to work with that.

@dhorions
Copy link
Owner

float posY = table.draw();

@drame1499
Copy link
Author

Oh.
That's easy. Now I feel a little bit stupid, but in my defense there is no javadoc on this method. ;)
I wonder if you need help filling in javadoc. I only started using your library today and I'm constantly looking at the code to understand what the methods do and parameters mean.
More javadoc would help tremendously.

@drame1499
Copy link
Author

Thank you btw for the fast responses

@dhorions
Copy link
Owner

Well, there's multiple efforts going on :

Any help is always appreciated.

dhorions added a commit that referenced this issue Apr 15, 2016
@giofid
Copy link

giofid commented May 17, 2016

I think that the version 1.4 on Maven doesn't contain the fix on cell fontSize.

This library is fantastic.

Thanks,
Giorgio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants