summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-01-19 17:37:18 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-01-20 20:49:13 +0100
commitfc38cb55cc6bc2af12ed4f12d2e7fb1494c3376b (patch)
tree7ca3adf0ea1e21f01d9c64eb5250736c9b51632e /sw
parentc5f88f0dce63c4fb2d208c493c1b06e25318aa61 (diff)
ofz#5253 restore some sort of valid state on missing Restore
Change-Id: Ic12e1567f5a3370d1580d8c471ee38d3069568ce Reviewed-on: https://gerrit.libreoffice.org/48217 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/core/data/html/pass/ofz5353-1.html1
-rw-r--r--sw/source/filter/html/htmlctxt.cxx14
2 files changed, 15 insertions, 0 deletions
diff --git a/sw/qa/core/data/html/pass/ofz5353-1.html b/sw/qa/core/data/html/pass/ofz5353-1.html
new file mode 100644
index 000000000000..25cff17de584
--- /dev/null
+++ b/sw/qa/core/data/html/pass/ofz5353-1.html
@@ -0,0 +1 @@
+ <table><td></tr> <big> <td><table> <td></td><S STYLE= float:left;width:3 ><a STYLE="float:left; width:3 "> \ No newline at end of file
diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx
index 93e8c5f57f0c..95750dfae142 100644
--- a/sw/source/filter/html/htmlctxt.cxx
+++ b/sw/source/filter/html/htmlctxt.cxx
@@ -384,6 +384,20 @@ void SwHTMLParser::ClearContext( HTMLAttrContext *pContext )
OSL_ENSURE( !pContext->HasSaveDocContext(),
"Frame can no longer be exited" );
+ // like RestoreDocContext reset enough of this to not catastropically
+ // fail if we still have a SaveDocContext here
+ if (HTMLAttrContext_SaveDoc *pSave = pContext->GetSaveDocContext())
+ {
+ if (SIZE_MAX != pSave->GetContextStMin())
+ {
+ m_nContextStMin = pSave->GetContextStMin();
+ if (SIZE_MAX != pSave->GetContextStAttrMin())
+ m_nContextStAttrMin = pSave->GetContextStAttrMin();
+ }
+
+ pContext->ClearSaveDocContext();
+ }
+
// Restart PRE/LISTING/XMP environments
if( pContext->IsFinishPREListingXMP() )
FinishPREListingXMP();