return Collections.unmodifiableList(result);
}
+ /**
+ * @return document level settings
+ * @since POI 5.2.1
+ */
+ public XWPFSettings getSettings() {
+ return settings;
+ }
+
void registerPackagePictureData(XWPFPictureData picData) {
List<XWPFPictureData> list = packagePictures.computeIfAbsent(picData.getChecksum(), k -> new ArrayList<>(1));
if (!list.contains(picData)) {
while (workdays != 0) {
endDate.add(Calendar.DAY_OF_YEAR, direction);
excelEndDate += direction;
- if (endDate.get(Calendar.DAY_OF_WEEK) != Calendar.SATURDAY
- && endDate.get(Calendar.DAY_OF_WEEK) != Calendar.SUNDAY
- && !isHoliday(excelEndDate, holidays)) {
+ if (!isWeekend(endDate) && !isHoliday(excelEndDate, holidays)) {
workdays -= direction;
}
}
protected boolean isWeekend(double aDate) {
Calendar date = LocaleUtil.getLocaleCalendar();
date.setTime(DateUtil.getJavaDate(aDate));
- return date.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || date.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY;
+ return isWeekend(date);
+ }
+
+ private boolean isWeekend(Calendar date) {
+ return date.get(Calendar.DAY_OF_WEEK) != Calendar.SATURDAY
+ && date.get(Calendar.DAY_OF_WEEK) != Calendar.SUNDAY;
}
/**
protected boolean isInARange(double start, double end, double aDate) {
return aDate >= start && aDate <= end;
}
+
}