/** * Resolve original style for Sheet. * * @param fods * @param table * @return Style display name. */ public static String getTopParentStyleName(Workbook fods, Sheet table) { String result = table.getStyleName(); if (result == null) { return null; } // Look for automatic style for (AutomaticStyle s : fods.getAutomaticStyles()) { if (s.getName().equals(result)) { result = s.getMasterPageName(); break; } } // Next style should be a master style for (Style s : fods.getMasterStyles()) { if (s.getName().equals(result)) { result = s.getDisplayName(); break; } } return result; }