sc/inc/cellvalue.hxx              |    2 ++
 sc/source/core/data/cellvalue.cxx |   19 ++++++++++++-------
 svtools/source/svrtf/parrtf.cxx   |    2 +-
 3 files changed, 15 insertions(+), 8 deletions(-)

New commits:
commit 1ea097688f27ce1cfbceb2637437b0d60e61bc40
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Jun 27 16:02:15 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Jun 27 18:46:23 2022 +0200

    ofz#24932 Infinite loop
    
    Change-Id: I05770f0209aaee1b9af6b88f85764ec98e7fa5a5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136504
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index c6dcef7a0b69..24272800f49c 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -168,7 +168,7 @@ int SvRTFParser::GetNextToken_()
                             {
                                 nNextToken = GetNextToken_();
                             }
-                            while (nNextToken != '{' && nNextToken != 
sal_Unicode(EOF));
+                            while (nNextToken != '{' && nNextToken != 
sal_Unicode(EOF) && IsParserWorking());
 
                             SkipGroup();
                             GetNextToken_();  // overread the last bracket
commit e7b3c961e95fdf51557702f2e74db796a6bd2c09
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Jun 27 15:57:02 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Jun 27 18:46:04 2022 +0200

    cid#1506511 silence Uncaught exception
    
    and
    
    cid#1506512 Uncaught exception
    cid#1506513 Uncaught exception
    
    Change-Id: I964430a69ce4d4beb7f7a551d3ac454c8122a3fa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136503
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/inc/cellvalue.hxx b/sc/inc/cellvalue.hxx
index 75e144c77252..6db9dee493cf 100644
--- a/sc/inc/cellvalue.hxx
+++ b/sc/inc/cellvalue.hxx
@@ -33,6 +33,8 @@ struct SC_DLLPUBLIC ScCellValue
 private:
     /// std::monostate is there to indicate CellType::NONE
     std::variant<std::monostate, double, svl::SharedString, EditTextObject*, 
ScFormulaCell*> maData;
+
+    void reset_to_empty();
 public:
 
     ScCellValue();
diff --git a/sc/source/core/data/cellvalue.cxx 
b/sc/source/core/data/cellvalue.cxx
index 44fde8c7ed03..4330ea972992 100644
--- a/sc/source/core/data/cellvalue.cxx
+++ b/sc/source/core/data/cellvalue.cxx
@@ -277,10 +277,15 @@ ScCellValue::ScCellValue( const ScCellValue& r )
     }
 }
 
+void ScCellValue::reset_to_empty()
+{
+    suppress_fun_call_w_exception(maData = std::monostate()); // reset to 
empty;
+}
+
 ScCellValue::ScCellValue(ScCellValue&& r) noexcept
     : maData(std::move(r.maData))
 {
-    r.maData = std::monostate(); // reset to empty;
+    r.reset_to_empty();
 }
 
 ScCellValue::~ScCellValue()
@@ -308,17 +313,17 @@ void ScCellValue::clear() noexcept
     switch (getType())
     {
         case CELLTYPE_EDIT:
-            delete getEditText();
+            suppress_fun_call_w_exception(delete getEditText());
         break;
         case CELLTYPE_FORMULA:
-            delete getFormula();
+            suppress_fun_call_w_exception(delete getFormula());
         break;
         default:
             ;
     }
 
     // Reset to empty value.
-    maData = std::monostate();
+    reset_to_empty();
 }
 
 void ScCellValue::set( double fValue )
@@ -475,7 +480,7 @@ void ScCellValue::release( ScDocument& rDoc, const 
ScAddress& rPos )
             rDoc.SetEmptyCell(rPos);
     }
 
-    maData = std::monostate(); // reset to empty
+    reset_to_empty(); // reset to empty
 }
 
 void ScCellValue::release( ScColumn& rColumn, SCROW nRow, 
sc::StartListeningType eListenType )
@@ -503,7 +508,7 @@ void ScCellValue::release( ScColumn& rColumn, SCROW nRow, 
sc::StartListeningType
             rColumn.DeleteContent(nRow);
     }
 
-    maData = std::monostate(); // reset to empty
+    reset_to_empty(); // reset to empty
 }
 
 OUString ScCellValue::getString( const ScDocument& rDoc ) const
@@ -532,7 +537,7 @@ ScCellValue& ScCellValue::operator=(ScCellValue&& rCell) 
noexcept
 {
     clear();
     maData = std::move(rCell.maData);
-    rCell.maData = std::monostate(); // reset to empty;
+    rCell.reset_to_empty(); // reset to empty;
     return *this;
 }
 

Reply via email to