You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2019/03/02 16:30:12 UTC

[Bug 63221] Please methods getTopMargin(), getBottomMargin(), etc, to XSSFSheet

https://bz.apache.org/bugzilla/show_bug.cgi?id=63221

--- Comment #1 from David Gauntt <dm...@uab.edu> ---
I have refined the workaround:

        public static double getTopMargin(XSSFSheet sheet) {
                return getPageMargins(sheet).getTop();
        }

        public static double getBottomMargin(XSSFSheet sheet) {
                return getPageMargins(sheet).getBottom();
        }


        private static CTPageMargins getPageMargins(XSSFSheet sheet) {
                final CTWorksheet ctSheet = sheet.getCTWorksheet();
                if (ctSheet.isSetPageMargins()) {
                        return ctSheet.getPageMargins();
                } else {
                        return ctSheet.addNewPageMargins();
                }
        }

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