Summary: | [Patch] Headers, Footers, Gridlines, and Print Setup | ||
---|---|---|---|
Product: | POI | Reporter: | Shawn Laubach <shawn.laubach> |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | CLOSED FIXED | ||
Severity: | normal | CC: | Philipp.Bolle, ramandeep21119 |
Priority: | P3 | ||
Version: | 2.0-dev | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | other | ||
Attachments: |
User model to the header record
User model to the footer record User model to the print setup record Test File for Gridlines Test File for Headers/Footers and PrintSetup But in previous HSSFPrintSetup. This fixes it. Updated HSSFSheet to not loop Updated Patch |
Description
Shawn Laubach
2002-04-25 14:14:50 UTC
Created attachment 1694 [details]
User model to the header record
Created attachment 1695 [details]
User model to the footer record
Created attachment 1696 [details]
User model to the print setup record
This is great stuff. I'll put it in my to-do queue if Glen doesn't beat me to it. Any chance we can get a unit test for this? (I know it seems like we're fanatics but so far we've found that those things that don't get unit tested get broken as the software gets patched....and no one tends to notice until much later). It should be fairly simple to figure out how to do one by going too src/testcases/org/apache/poi/hssf/..... and looking at a TestXXXX class. Just copy it and do the same for these features. If you don't, I will eventually, but I think there is a consensus among HSSF committers that no new un-unit-tested code should make it into a production release. (nothing official...just I think we agree ;-) ) Created attachment 1701 [details]
Test File for Gridlines
Created attachment 1702 [details]
Test File for Headers/Footers and PrintSetup
Created attachment 1703 [details]
But in previous HSSFPrintSetup. This fixes it.
will apply shortly. *** Bug 7864 has been marked as a duplicate of this bug. *** after puting this in I get this: Created dir: D:\andy\homestuff\jakarta-poi\build\testcases Compiling 87 source files to D:\andy\homestuff\jakarta-poi\build\testcases D:\andy\homestuff\jakarta-poi\src\testcases\org\apache\poi\hssf\usermodel\TestGr idlines.java:103: cannot resolve symbol symbol : method setPrintGridlines (boolean) location: class org.apache.poi.hssf.usermodel.HSSFSheet s.setPrintGridlines(true); ^ D:\andy\homestuff\jakarta-poi\src\testcases\org\apache\poi\hssf\usermodel\TestHe adersFootersPrintSetup.java:121: cannot resolve symbol symbol : method getHeader () location: class org.apache.poi.hssf.usermodel.HSSFSheet h = s.getHeader(); ^ D:\andy\homestuff\jakarta-poi\src\testcases\org\apache\poi\hssf\usermodel\TestHe adersFootersPrintSetup.java:126: cannot resolve symbol symbol : method getFooter () location: class org.apache.poi.hssf.usermodel.HSSFSheet f = s.getFooter(); ^ D:\andy\homestuff\jakarta-poi\src\testcases\org\apache\poi\hssf\usermodel\TestHe adersFootersPrintSetup.java:162: cannot resolve symbol symbol : method getPrintSetup () location: class org.apache.poi.hssf.usermodel.HSSFSheet ps = s.getPrintSetup(); ^ D:\andy\homestuff\jakarta-poi\src\testcases\org\apache\poi\hssf\usermodel\TestHe adersFootersPrintSetup.java:218: cannot resolve symbol symbol : method getPrintSetup () location: class org.apache.poi.hssf.usermodel.HSSFSheet ps = s.getPrintSetup(); ^ D:\andy\homestuff\jakarta-poi\src\testcases\org\apache\poi\hssf\usermodel\TestHe adersFootersPrintSetup.java:240: cannot resolve symbol symbol : method getFooter () location: class org.apache.poi.hssf.usermodel.HSSFSheet f = s.getFooter(); ^ 6 errors BUILD FAILED D:\andy\homestuff\jakarta-poi\tools\cents\junit.cent\xbuild.xml:27: Compile fail ed; see the compiler error output for details. Forget a file? Submit patch with "cvs diff -u" for HSSFSheet. Thanks -Andy The patch is part of the original bug comments. I can attach it as a file if needed. Sorry I'd overlooked that patch in that description. Okay I can't commit this as is. Here is the deal, shoving that looping code into HSSFSheet would drastically affect performance. The approach I would suggest is putting the code for dealing with the record in org.apache.poi.hssf.model.Sheet and have HSSFSheet access it from there. Furthermore, have the Sheet contain some reference variables that are loaded when the sheet is loaded or when a footer or header is created. There are more than one example (I think) on how to do this in that file. If you cna provide a patch that follows that convention versus looping through the records in the usermodel I'll apply it. thanks, -Andy if you do a "cvs update" -- the problem should take care of itself. Merge and conflicts and send the patch. Should happen mostly automatically as this code isn't in any rapidly changing code. Created attachment 1746 [details]
Updated HSSFSheet to not loop
I've added a new patch that updates Sheet and HSSFSheet to not do looping to grab the needed records. Did run into a problem with indention changing in my editor so that there are more diffs than necessary. I checked however and there was nothing that did more that change the spacing. yum that patch looks much better. After applying this TestHSSFSheet went into an infinite loop. Can you run ./build.sh clean compile test and see if you get the same? I'll check it out. When I run it, it gives me no errors and everything runs fine. Could it be because of the diff having more differences than are required? How do you indent the code? Could I try the same thing and see what I get for the diffs then? indent the code? Tell you what. Lets try this one more time. Attach a zip file with all of you current .java files, including the directory relative to jakarta-poi module (so src/java/org/apache/poi/hssf/usermodel/HSSFFooter). Then make sure your up to date. attach a patch of the deltas. Lastly try checking out clean and applying your own patch. run the clean compile tests targets in order. I swear even if I have to retype this we'll get this in! ;-). (I tried it pre-patch, then with patch and well with patch it hung on the unit tests) Created attachment 1757 [details]
Updated Patch
I've added the most resent patch that I based on the most recent code. I just copied the lines I added over and tested with everything. The original files attached are OK but the patch only tries to change the necessary lines. I've compiled and ran all the tests and they all passed OK. I hope this works this time. I created a new patch. I then did a new checkout and downloaded the files from the bug report. Next, I applied the patch, compiled the code and ran the tests. Everything worked just fine. applied....unit tests passed...please cross check... thanks for the patience -Andy Verified. |