From 143ec7cbbe1c89691401de1646162234e8247333 Mon Sep 17 00:00:00 2001 From: Simon Steiner Date: Thu, 27 Oct 2022 12:12:28 +0000 Subject: [PATCH] FOP-3103: NPE when using a footnote on redo of layout git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1904884 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/layoutmgr/PageBreaker.java | 6 +- .../standard-testcases/footnote_lastpage.xml | 508 ++++++++++++++++++ 2 files changed, 512 insertions(+), 2 deletions(-) create mode 100644 fop/test/layoutengine/standard-testcases/footnote_lastpage.xml diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/PageBreaker.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/PageBreaker.java index b1babb12a..cd9b7f363 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/PageBreaker.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/PageBreaker.java @@ -451,8 +451,10 @@ public class PageBreaker extends AbstractBreaker { int optimalPageCount = algRestart.findBreakingPoints(effectiveList, newStartPos, 1, true, BreakingAlgorithm.ALL_BREAKS); - log.debug("restart: optimalPageCount= " + optimalPageCount - + " pageBreaks.size()= " + algRestart.getPageBreaks().size()); + if (algRestart.getPageBreaks() != null) { + log.debug("restart: optimalPageCount= " + optimalPageCount + + " pageBreaks.size()= " + algRestart.getPageBreaks().size()); + } boolean fitsOnePage = optimalPageCount <= pslm.getCurrentPV() diff --git a/fop/test/layoutengine/standard-testcases/footnote_lastpage.xml b/fop/test/layoutengine/standard-testcases/footnote_lastpage.xml new file mode 100644 index 000000000..b4b286bba --- /dev/null +++ b/fop/test/layoutengine/standard-testcases/footnote_lastpage.xml @@ -0,0 +1,508 @@ + + + + + +

+ This test checks that footnote content is properly reset when the algorithm has to restart + page breaking after a too short/long node. +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This leaflet provides a summary of the significant features, benefits and limitations of the cover provided by the Insurance plc Contract Works Construction policy. The full terms, conditions and exclusions are shown in the policy document. If you want to see full details of the cover, please refer to the policy document. + + + + + + + + + + + + + Type of insurance and cover + This policy offers ‘All Risks’ protection for materials usually referred to as ‘contract works’. It can also cover owned and hired-in contractors’ plant and employees’ personal tools and effects. + + + + The duration of this non-investment insurance contract is 12 months or the period of the construction project to be covered. + + + + Significant features and benefits + + + + • + + + a + + + + + • + + + b + + + + + • + + + Up to 12 months restricted cover following handover during the maintenance or defects liability period where required by contract. + + + + + • + + + c + + + + + • + + + d + + + + + • + + + e + + + + + • + + + f + + + + + • + + + g + + + + + • + + + h + + + + + • + + + i + + + + + • + + + j + + + + + • + + + k + + + + + • + + + l + + + + + + + Optional covers available + + + + • + + + a + + + + + • + + + b + + + + + • + + + c + + + + + + + Significant and unusual exclusions or limitations + + + + • + + + a + + + + + • + + + Property defective in material or workmanship design, plan or specification and subsequent damage caused whilst enabling repair. + + + + + • + + + c + + + + + • + + + Theft of unfixed non-ferrous metals of any description unless at the time of the theft either: + + + - + + + e + + + + + - + + + f + + + + + + + + + • + + + Normal wear and tear. + + + + + • + + + a + + + + + • + + + b + + + + + • + + + c + + + + + • + + + d + + + + + • + + + e + + + + + • + + + f + + + + + + + Insurance Act 2015 + This policy is compliant with the principles of the Insurance Act 2015 law reforms. It also incorporates an ‘opt out’ which aims to promote good customer outcomes. We have opted-out of the ‘proportionate reduction of claim remedy’ available to insurers under the Act. This means that in cases of non-disclosure or misrepresentation which are neither deliberate nor reckless, if we would have charged an additional premium had we known the relevant facts, we will charge that premium and pay any claims in full rather than reducing claims payments in proportion to the amount of premium that would have been charged. + + + + We believe that our ‘additional premium approach’ should, in most situations, be more favourable to our customers when compared to the proportionate reduction of claim remedy. Our additional premium approach does not affect our right to apply the other remedies available under the Act for non-disclosure or misrepresentation. + + + + Cancellation Rights + This policy dos not entitle you to a cooling-off period. + + + + Claims + + + + + + + + + + + + + + + + + + + To make a claim online visit: + + + + + + + a + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Call us on: + + + + + b + + + + + + + + + Our complaints procedure + We are committed to providing a high level of customer service. If you do not feel we have delivered this, we would welcome the opportunity to put things right for you. + + + + Many concerns can be resolved straight away. Therefore in the first instance, please get in touch with your usual contact at or your broker or insurance intermediary, as they will generally be able to provide you with a prompt response to your satisfaction. Contact details will be provided on correspondence that we or our representatives have sent you. + + + + If we can resolve your complaint to your satisfaction within the first few days of receipt, we will do so. Otherwise, we will keep you updated with progress and will provide you with our decision as quickly as possible. + + + + If you are not happy with the outcome of your complaint, you may be able to ask the Financial Ombudsman Service to review your case. + + + + We will let you know if we believe the ombudsman service can consider your complaint when we provide you with our decision. The service they provide is free and impartial, but you would need to contact them within 6 months of the date of our decision. + + + + More information about the ombudsman and the type of complaints they can review is available via their website www.financial-ombudsman.org.uk. + + + + You can also contact them as follows: + + + + + + + + + + + Post: + + + a + + + + + Telephone: + + + b + + + + + Email: + + + c + + + + + + + + + If the Financial Ombudsman Service is unable to consider your complaint, you may wish to obtain advice from the Citizens Advice Bureau or seek legal advice. + + + + The Financial Services Compensation Scheme (FSCS) + We are covered by the Financial Services Compensation Scheme (FSCS) which means that you may be entitled to compensation if we are unable to meet our obligations to you. Further information is available on www.fscs.org.uk or by contacting the FSCS directly on 0800 678 1100. + + + + + + + + A public limited company incorporated in Ireland. Registration No. 13460.Registered Office: House, Ballsbridge Park, Dublin 4, Ireland.UK Branch registered in England and Wales Registration No. BR7985.UK Branch Head Office: The Centre, 3000 Parkway, Whiteley, Fareham, Hampshire PO15 7JZ. + Insurance plc is authorised and regulated by the Central Bank of Ireland. Authorised by the Regulation Authority and with deemed variation of permission. Subject to regulation by theFinancial Conduct Authority and limited regulation by the Regulation Authority. Details ofthe Temporary Permissions Regime, which allows EEA-based firms to operate in the UK for a limitedperiod while seeking full authorisation, are available on the Financial Conduct Authority’s website.Our FCA Firm Reference Number is 203093. + Communications may be monitored or recorded to improve our service and for security andregulatory purposes. + ZCYB387.17 (06/22) + + + + + + + + + + + +
-- 2.39.5