diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-06-15 14:53:32 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-06-15 14:54:17 +0100 |
commit | 9e15697b5ec21114e32466762dab94cba1bfe97b (patch) | |
tree | 405b15687c8e0a37f34f226c43ea60dbdcfcc402 /lotuswordpro | |
parent | 901c7e55efbe66868bae937f232329beca489191 (diff) |
ofz: loop in layout
Change-Id: I8c1561f37f8b24258c95ec09edf8c4be61300959
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwppagelayout.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx index 66d58fc104eb..d4313c9e0e17 100644 --- a/lotuswordpro/source/filter/lwppagelayout.cxx +++ b/lotuswordpro/source/filter/lwppagelayout.cxx @@ -495,7 +495,13 @@ LwpHeaderLayout* LwpPageLayout::GetHeaderLayout() { if (xLay->GetLayoutType() == LWP_HEADER_LAYOUT) return dynamic_cast<LwpHeaderLayout*>(xLay.get()); - xLay.set(dynamic_cast<LwpVirtualLayout*>(xLay->GetNext().obj().get())); + rtl::Reference<LwpVirtualLayout> xNext(dynamic_cast<LwpVirtualLayout*>(xLay->GetNext().obj().get())); + if (xNext == xLay) + { + SAL_WARN("lwp", "loop in layout"); + break; + } + xLay = xNext; } return nullptr; } @@ -507,7 +513,13 @@ LwpFooterLayout* LwpPageLayout::GetFooterLayout() { if (xLay->GetLayoutType() == LWP_FOOTER_LAYOUT) return dynamic_cast<LwpFooterLayout*>(xLay.get()); - xLay.set(dynamic_cast<LwpVirtualLayout*>(xLay->GetNext().obj().get())); + rtl::Reference<LwpVirtualLayout> xNext(dynamic_cast<LwpVirtualLayout*>(xLay->GetNext().obj().get())); + if (xNext == xLay) + { + SAL_WARN("lwp", "loop in layout"); + break; + } + xLay = xNext; } return nullptr; } |