summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-01-22 12:49:03 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-01-22 15:22:53 +0100
commit8f81535faf6a5d80d5e4d522768c7537e0ca5d21 (patch)
treebfc96a16456ced0d02a5108933c3798961942669
parentMysql/MariaDB: Clean mysqlc_catalog + remove using (diff)
downloadcore-8f81535faf6a5d80d5e4d522768c7537e0ca5d21.tar.gz
core-8f81535faf6a5d80d5e4d522768c7537e0ca5d21.zip
ofz#43949 Timeout
Change-Id: Ia1691d30e754924314d39d733135614db4c56834 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128768 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--lotuswordpro/source/filter/lwptablelayout.cxx25
1 files changed, 14 insertions, 11 deletions
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index 70a387781394..c3d027e91008 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -111,22 +111,24 @@ LwpTableLayout* LwpSuperTableLayout::GetTableLayout()
{
LwpObjectID *pID = &GetChildTail();
- while(pID && !pID->IsNull())
+ o3tl::sorted_vector<LwpObjectID*> aSeen;
+ while (pID && !pID->IsNull())
{
+ bool bAlreadySeen = !aSeen.insert(pID).second;
+ if (bAlreadySeen)
+ throw std::runtime_error("loop in conversion");
+
LwpLayout* pLayout = dynamic_cast<LwpLayout*>(pID->obj().get());
if (!pLayout)
- {
break;
- }
if (pLayout->GetLayoutType() == LWP_TABLE_LAYOUT)
- {
return dynamic_cast<LwpTableLayout *>(pLayout);
- }
pID = &pLayout->GetPrevious();
}
return nullptr;
}
+
/**
* @short Get effective heading table layout, the one just before table layout is the only one which is effective
* @return LwpTableHeadingLayout* - pointer to table heading layout
@@ -135,23 +137,24 @@ LwpTableHeadingLayout* LwpSuperTableLayout::GetTableHeadingLayout()
{
LwpObjectID *pID = &GetChildTail();
- while(pID && !pID->IsNull())
+ o3tl::sorted_vector<LwpObjectID*> aSeen;
+ while (pID && !pID->IsNull())
{
+ bool bAlreadySeen = !aSeen.insert(pID).second;
+ if (bAlreadySeen)
+ throw std::runtime_error("loop in conversion");
+
LwpLayout * pLayout = dynamic_cast<LwpLayout *>(pID->obj().get());
if (!pLayout)
- {
break;
- }
-
if (pLayout->GetLayoutType() == LWP_TABLE_HEADING_LAYOUT)
- {
return dynamic_cast<LwpTableHeadingLayout *>(pLayout);
- }
pID = &pLayout->GetPrevious();
}
return nullptr;
}
+
/**
* @short Register super table layout style
*/