[Bug 60293] Handling illegal "Odd" footer in XWPF

2016-10-30 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60293

--- Comment #1 from Mark Murphy  ---
I would say that depends on what Microsoft Word does. Can you attach the
sample?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 57366] XWPFTable to Header / Footer

2016-10-30 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=57366

Mark Murphy  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #1 from Mark Murphy  ---
Fixed by r1767175. This contains a breaking change. Creating a new header of
footer no longer defaults to adding an empty paragraph when no paragraphs are
provided. This facilitates adding a Table as the first block element of the
header or footer. If no block elements are added to the header or footer, then
an empty paragraph will be added automatically when the document is saved to
prevent writing a corrupt document.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 57366] XWPFTable to Header / Footer

2016-10-30 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=57366

--- Comment #2 from Mark Murphy  ---
Created attachment 34411
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34411=edit
mylyn/context/zip

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



Re: Document validation hook in POIXMLDocument

2016-10-30 Thread Mark Murphy
That might work. for the validations I was talking about, I can just make
it right. but for things like Javen was talking about, there might need to
be a way to break out of the save, maybe a new Exception that inherits from
IOException would be the best onSave doesn't catch it, but it does pass
IOExceptions on to the caller.

On Sun, Oct 30, 2016 at 6:37 AM, Nick Burch  wrote:

> On Sun, 30 Oct 2016, Mark Murphy wrote:
>
>> Is there a validation hook in POIXMLDocument that will allow a document to
>> validate itself before it writes itself to disk?
>>
>
> Maybe prepareForCommit() ? (Need to call superclass too!)
>
> Here is the use case. An XWPFDocument header or footer must contain at
>> least an empty paragraph. If a header or footer is created without a
>> paragraph, this hook would let me determine this, and just put one in there
>> rather than generating a corrupt document.
>>
>
> You could do it in prepareForCommit or commit of XWPFHeaderFooter
>
> Nick
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
> For additional commands, e-mail: dev-h...@poi.apache.org
>
>


Re: Document validation hook in POIXMLDocument

2016-10-30 Thread Nick Burch

On Sun, 30 Oct 2016, Mark Murphy wrote:

Is there a validation hook in POIXMLDocument that will allow a document to
validate itself before it writes itself to disk?


Maybe prepareForCommit() ? (Need to call superclass too!)

Here is the use case. An XWPFDocument header or footer must contain at 
least an empty paragraph. If a header or footer is created without a 
paragraph, this hook would let me determine this, and just put one in 
there rather than generating a corrupt document.


You could do it in prepareForCommit or commit of XWPFHeaderFooter

Nick

-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org