chart2/qa/extras/chart2geometry.cxx | 3 ++- compilerplugins/clang/unusedvariableplus.cxx | 3 --- desktop/qa/desktop_lib/test_desktop_lib.cxx | 3 +-- include/unotest/macros_test.hxx | 24 ------------------------ sc/qa/unit/subsequent_export_test.cxx | 7 ++++--- sd/qa/unit/SVGExportTests.cxx | 3 ++- sd/qa/unit/export-tests.cxx | 3 ++- sw/qa/extras/autocorrect/autocorrect.cxx | 3 ++- sw/qa/extras/globalfilter/globalfilter.cxx | 3 ++- sw/qa/extras/layout/layout6.cxx | 25 +++++++++++-------------- xmloff/qa/unit/draw.cxx | 14 +++++++------- xmloff/qa/unit/style.cxx | 11 ++++++----- xmlsecurity/qa/unit/signing/signing.cxx | 3 ++- xmlsecurity/qa/unit/signing/signing2.cxx | 5 +++-- 14 files changed, 44 insertions(+), 66 deletions(-)
New commits: commit d0e23db89a28b356d41222d466095956f5ade041 Author: Mike Kaganski <[email protected]> AuthorDate: Sun Feb 1 14:57:53 2026 +0500 Commit: Mike Kaganski <[email protected]> CommitDate: Sun Feb 1 19:38:44 2026 +0100 Drop MacrosTest::Resetter, and use comphelper::ScopeGuard Change-Id: I2214724567a58174b175a17fbabec7a5249e4df8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198482 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/chart2/qa/extras/chart2geometry.cxx b/chart2/qa/extras/chart2geometry.cxx index 0df5f707f925..a49abdb13580 100644 --- a/chart2/qa/extras/chart2geometry.cxx +++ b/chart2/qa/extras/chart2geometry.cxx @@ -14,6 +14,7 @@ #include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/drawing/LineStyle.hpp> +#include <comphelper/scopeguard.hxx> #include <unotools/saveopt.hxx> #include <string_view> @@ -462,7 +463,7 @@ void Chart2GeometryTest::testTdf135366LabelExport() void Chart2GeometryTest::testTdf135366_CustomLabelText() { - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); // Error was, that custom text in a data label was only exported in ODF extended, // although the used <chart:data-label> element exists since ODF 1.2. diff --git a/compilerplugins/clang/unusedvariableplus.cxx b/compilerplugins/clang/unusedvariableplus.cxx index 128da01f1d7b..1e77efe4db0d 100644 --- a/compilerplugins/clang/unusedvariableplus.cxx +++ b/compilerplugins/clang/unusedvariableplus.cxx @@ -347,7 +347,6 @@ public: "std::unique_ptr<class SfxObjectShell::LockAllViewsGuard>", "std::unique_ptr<class SwDocShell::LockAllViewsGuard>", "std::unique_ptr<class SwSaveFootnoteHeight>", - "std::unique_ptr<class SwModelTestBase::Resetter>", "StreamExceptionsEnabler", "SvAddressParser_Impl", "svl::undo::impl::LockGuard", @@ -378,9 +377,7 @@ public: "SwFontSave", "SwFootnoteSave", "SwFrameDeleteGuard", - "SwModelTestBase::Resetter", "std::unique_ptr<class ScTokenArray>", // ScCompiler::CompileString has nasty semantics - "Resetter", "SwFrameSwapper", "SwFlyNotify", "SwForbidFollowFormat", diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index b445cda0b499..142427b58ebe 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -3771,8 +3771,7 @@ void DesktopLOKTest::testSpellcheckerMultiView() comphelper::LibreOfficeKit::setLanguageTag(LanguageTag(aLangISO, true)); auto aSavedSettings = Application::GetSettings(); - std::unique_ptr<Resetter> pResetter( - new Resetter([&]() { Application::SetSettings(aSavedSettings); })); + comphelper::ScopeGuard g([&]() { Application::SetSettings(aSavedSettings); }); AllSettings aSettings(aSavedSettings); aSettings.SetLanguageTag(aLangISO, true); Application::SetSettings(aSettings); diff --git a/include/unotest/macros_test.hxx b/include/unotest/macros_test.hxx index d660505c63de..63d0ccf8a948 100644 --- a/include/unotest/macros_test.hxx +++ b/include/unotest/macros_test.hxx @@ -51,30 +51,6 @@ namespace unotest class OOO_DLLPUBLIC_UNOTEST MacrosTest { public: - class Resetter - { - private: - std::function<void()> m_Func; - - public: - Resetter(std::function<void()> aFunc) - : m_Func(std::move(aFunc)) - { - } - ~Resetter() - { - try - { - m_Func(); - } - catch (...) // has to be reliable - { - fprintf(stderr, "resetter failed with exception "); - abort(); - } - } - }; - MacrosTest(); ~MacrosTest(); diff --git a/sc/qa/unit/subsequent_export_test.cxx b/sc/qa/unit/subsequent_export_test.cxx index 6cacb6923bc3..e0f3b22b7d5e 100644 --- a/sc/qa/unit/subsequent_export_test.cxx +++ b/sc/qa/unit/subsequent_export_test.cxx @@ -25,6 +25,7 @@ #include <postit.hxx> #include <validat.hxx> +#include <comphelper/scopeguard.hxx> #include <svx/svdpage.hxx> #include <tabprotection.hxx> #include <editeng/wghtitem.hxx> @@ -612,7 +613,7 @@ static auto verifySpreadsheet13(char const* const pTestName, ScDocument& rDoc) - CPPUNIT_TEST_FIXTURE(ScExportTest, testODF13) { - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); // import createScDoc("ods/spreadsheet13e.ods"); @@ -1027,7 +1028,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf162963) CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf162963_ODF) { - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); // Verify, that calcext:contains-footer is only written in extended file format versions. // The parameter in DefaultVersion::set need to be adapted, when attribute contains-footer @@ -1067,7 +1068,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testTdf162177_EastersundayODF14) { // EASTERSUNDAY was added to ODFF in ODF 1.4. LibreOffice has written it as // ORG.OPENOFFICE.EASTERSUNDAY for ODF 1.2 and ODF 1.3. - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); createScDoc("fods/tdf162177_Eastersunday.fods"); // File has it as ORG.OPENOFFICE.EASTERSUNDAY in ODF 1.3. Test, that it is read correctly. diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx index 5f73bad89f3b..6ce614adedbd 100644 --- a/sd/qa/unit/SVGExportTests.cxx +++ b/sd/qa/unit/SVGExportTests.cxx @@ -12,6 +12,7 @@ #include <string_view> #include <test/unoapixml_test.hxx> +#include <comphelper/scopeguard.hxx> #include <sal/macros.h> #include <unotools/syslocaleoptions.hxx> #include <vcl/svapp.hxx> @@ -269,7 +270,7 @@ public: aSysLocaleOptions.SetUILocaleConfigString(aLangISO); auto aSavedSettings = Application::GetSettings(); - Resetter aResetter([&]() { Application::SetSettings(aSavedSettings); }); + comphelper::ScopeGuard g([&]() { Application::SetSettings(aSavedSettings); }); AllSettings aSettings(aSavedSettings); aSettings.SetLanguageTag(aLangISO, true); Application::SetSettings(aSettings); diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 9e32e2ffbc7e..5e7f2344ac68 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -12,6 +12,7 @@ #include "sdmodeltestbase.hxx" #include <sdpage.hxx> +#include <comphelper/scopeguard.hxx> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/sequence.hxx> #include <editeng/editobj.hxx> @@ -1486,7 +1487,7 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, testPageWithTransparentBackground) CPPUNIT_TEST_FIXTURE(SdExportTest, testTextRotation) { // Save behavior depends on whether ODF strict or extended is used. - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); // The contained shape has a text rotation vert="vert" which corresponds to // loext:writing-mode="tb-rl90" in the graphic-properties of the style of the shape in ODF 1.3 diff --git a/sw/qa/extras/autocorrect/autocorrect.cxx b/sw/qa/extras/autocorrect/autocorrect.cxx index 2668f7661140..096702635df9 100644 --- a/sw/qa/extras/autocorrect/autocorrect.cxx +++ b/sw/qa/extras/autocorrect/autocorrect.cxx @@ -10,6 +10,7 @@ #include <swmodeltestbase.hxx> #include <comphelper/configuration.hxx> +#include <comphelper/scopeguard.hxx> #include <docsh.hxx> #include <editeng/acorrcfg.hxx> #include <ndtxt.hxx> @@ -87,7 +88,7 @@ CPPUNIT_TEST_FIXTURE(SwAutoCorrectTest, tdfTdf44293) CPPUNIT_TEST_FIXTURE(SwAutoCorrectTest, testTdf151801) { - Resetter resetter([]() { + comphelper::ScopeGuard g([]() { std::shared_ptr<comphelper::ConfigurationChanges> pBatch( comphelper::ConfigurationChanges::create()); officecfg::Office::Common::AutoCorrect::SingleQuoteAtStart::set(0, pBatch); diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index e7f132ea20a0..3d980b914b7e 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -25,6 +25,7 @@ #include <vcl/vectorgraphicdata.hxx> #include <sfx2/linkmgr.hxx> #include <comphelper/propertysequence.hxx> +#include <comphelper/scopeguard.hxx> #include <comphelper/sequenceashashmap.hxx> #include <unotxdoc.hxx> #include <docsh.hxx> @@ -958,7 +959,7 @@ auto Test::verifyText13(char const*const pTestName) -> void // test ODF 1.3 new text document features void Test::testODF13() { - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); // import createSwDoc("text13e.odt"); diff --git a/sw/qa/extras/layout/layout6.cxx b/sw/qa/extras/layout/layout6.cxx index f8b68d65ac50..854f33c44704 100644 --- a/sw/qa/extras/layout/layout6.cxx +++ b/sw/qa/extras/layout/layout6.cxx @@ -9,6 +9,7 @@ #include <swmodeltestbase.hxx> #include <comphelper/propertysequence.hxx> +#include <comphelper/scopeguard.hxx> #include <com/sun/star/drawing/XDrawPageSupplier.hpp> #include <com/sun/star/linguistic2/XHyphenator.hpp> #include <com/sun/star/text/WrapTextMode.hpp> @@ -1539,13 +1540,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter6, testHiddenParagraphFollowFrame) { createSwDoc("hidden-para-follow-frame.fodt"); - uno::Any aOldValue{ queryDispatchStatus(mxComponent, m_xContext, ".uno:ShowHiddenParagraphs") }; - - Resetter g([this, aOldValue] { - uno::Sequence<beans::PropertyValue> argsSH( - comphelper::InitPropertySequence({ { "ShowHiddenParagraphs", aOldValue } })); - dispatchCommand(mxComponent, ".uno:ShowHiddenParagraphs", argsSH); - }); + comphelper::ScopeGuard g( + [ this, old = queryDispatchStatus(mxComponent, m_xContext, ".uno:ShowHiddenParagraphs") ] { + auto args(comphelper::InitPropertySequence({ { "ShowHiddenParagraphs", old } })); + dispatchCommand(mxComponent, ".uno:ShowHiddenParagraphs", args); + }); { // disable Field Names warning dialog @@ -1588,13 +1587,11 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter6, testHiddenParagraphFlys) { createSwDoc("hidden-para-as-char-fly.fodt"); - uno::Any aOldValue{ queryDispatchStatus(mxComponent, m_xContext, ".uno:ShowHiddenParagraphs") }; - - Resetter g([this, aOldValue] { - uno::Sequence<beans::PropertyValue> argsSH( - comphelper::InitPropertySequence({ { "ShowHiddenParagraphs", aOldValue } })); - dispatchCommand(mxComponent, ".uno:ShowHiddenParagraphs", argsSH); - }); + comphelper::ScopeGuard g( + [ this, old = queryDispatchStatus(mxComponent, m_xContext, ".uno:ShowHiddenParagraphs") ] { + auto args(comphelper::InitPropertySequence({ { "ShowHiddenParagraphs", old } })); + dispatchCommand(mxComponent, ".uno:ShowHiddenParagraphs", args); + }); { // disable Field Names warning dialog diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx index 7ef59337d4c8..fda9fc0aa78f 100644 --- a/xmloff/qa/unit/draw.cxx +++ b/xmloff/qa/unit/draw.cxx @@ -528,7 +528,7 @@ void lcl_assertMetalProperties(std::string_view sInfo, uno::Reference<drawing::X CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionMetalTypeExtended) { - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); loadFromFile(u"tdf145700_3D_metal_type_MSCompatible.doc"); // verify properties uno::Reference<drawing::XShape> xShape(getShape(0)); @@ -569,7 +569,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionMetalTypeExtended) CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionMetalTypeStrict) { - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); loadFromFile(u"tdf145700_3D_metal_type_MSCompatible.doc"); // save in ODF 1.4 strict and test that new attribute is written. @@ -592,7 +592,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionMetalTypeStrict) CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionMetalTypeODF) { - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); loadFromFile(u"tdf162686_3D_metal_type_ODF.fods"); // verify properties uno::Reference<drawing::XShape> xShape(getShape(0)); @@ -640,7 +640,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionMetalTypeODF) CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testHandlePosition) { - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); loadFromFile(u"tdf162691_handle_position.fodt"); save(TestFilter::ODT); @@ -666,7 +666,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testHandlePosition) CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testHandlePolar) { - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); loadFromFile(u"tdf162691_handle_polar.fodt"); save(TestFilter::ODT); @@ -717,7 +717,7 @@ void lcl_assertSpecularityProperty(std::string_view sInfo, uno::Reference<drawin CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionSpecularityExtended) { - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); loadFromFile(u"tdf147580_extrusion-specularity.doc"); // verify property uno::Reference<drawing::XShape> xShape(getShape(0)); @@ -761,7 +761,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionSpecularity) CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionSpecularityStrict) { - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); loadFromFile(u"tdf147580_extrusion-specularity.doc"); // The file has c3DSpecularAmt="80000" which results internally in specularity=122%. diff --git a/xmloff/qa/unit/style.cxx b/xmloff/qa/unit/style.cxx index 03c3a3069433..7286b5de0c21 100644 --- a/xmloff/qa/unit/style.cxx +++ b/xmloff/qa/unit/style.cxx @@ -20,6 +20,7 @@ #include <com/sun/star/drawing/XShape.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> +#include <comphelper/scopeguard.hxx> #include <rtl/character.hxx> #include <unotools/saveopt.hxx> @@ -170,7 +171,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testRtlGutter) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testWritingModeBTLR) { - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); // Load document. It has a frame style with writing-mode bt-lr. // In ODF 1.3 extended it is written as loext:writing-mode="bt-lr". @@ -212,7 +213,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testWritingModeBTLR) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testPosRelBottomMargin) { - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); // Load document. It has a frame position with vertical position relative to bottom margin. // In ODF 1.3 extended it is written as loext:vertical-rel="page-content-bottom". @@ -256,7 +257,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testPosRelBottomMargin) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testPosRelTopMargin) { - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); // Load document. It has a frame position with vertical position relative to top margin. // In ODF 1.3 extended it is written as loext:vertical-rel="page-content-top". @@ -532,7 +533,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testMCGR_threeStops) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testBorderRestoration) { - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); // Load document. It has a shape with color gradient build from color stop yellow at offset 0.5 // and color stop red at offset 1.0. For better backward compatibility such gradient has to be @@ -569,7 +570,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testBorderRestoration) CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testTransparencyBorderRestoration) { - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); // Load document. It has a shape with transparency gradient build from transparency 100% at // offset 0, transparency 100% at offset 0.4 and transparency 10% at offset 1.0. For better diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx index 9938780541f7..ade0030d4798 100644 --- a/xmlsecurity/qa/unit/signing/signing.cxx +++ b/xmlsecurity/qa/unit/signing/signing.cxx @@ -33,6 +33,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/propertysequence.hxx> +#include <comphelper/scopeguard.hxx> #include <unotools/tempfile.hxx> #include <unotools/saveopt.hxx> #include <unotools/ucbstreamhelper.hxx> @@ -1502,7 +1503,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testDropMacroTemplateSignature) CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature10) { // set ODF version 1.0 / 1.1 as default - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); SetODFDefaultVersion(SvtSaveOptions::ODFVER_011); const TestFilter aFormats[] = { TestFilter::ODT, TestFilter::OTT }; diff --git a/xmlsecurity/qa/unit/signing/signing2.cxx b/xmlsecurity/qa/unit/signing/signing2.cxx index e37fade87f6a..6fd6d1f2e549 100644 --- a/xmlsecurity/qa/unit/signing/signing2.cxx +++ b/xmlsecurity/qa/unit/signing/signing2.cxx @@ -29,6 +29,7 @@ #include <unotools/tempfile.hxx> #include <unotools/saveopt.hxx> #include <unotools/ucbstreamhelper.hxx> +#include <comphelper/scopeguard.hxx> #include <comphelper/storagehelper.hxx> #include <libxml/xpathInternals.h> @@ -128,7 +129,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, testPasswordPreserveMacroSignatureODF13) { // test the old, standard ODF 1.2/1.3/1.4 encryption - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); SetODFDefaultVersion(SvtSaveOptions::ODFVER_013); saveAndReload(TestFilter::ODT, "password"); @@ -313,7 +314,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, testPasswordPreserveMacroSignatureODFWholesom { // test the old, standard ODF 1.2/1.3/1.4 encryption - Resetter resetter([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); + comphelper::ScopeGuard g([]() { SetODFDefaultVersion(SvtSaveOptions::ODFVER_LATEST); }); SetODFDefaultVersion(SvtSaveOptions::ODFVER_013); saveAndReload(TestFilter::ODT, "password");
