diff --git a/sw/qa/core/text/itrform2.cxx b/sw/qa/core/text/itrform2.cxx index b8c9107a8ae3..6a02317ad084 100644 --- a/sw/qa/core/text/itrform2.cxx +++ b/sw/qa/core/text/itrform2.cxx @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include #include @@ -208,7 +210,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCheckedCheckboxContentControlPDF) if (!pPDFium) return; - SwExportFormFieldsGuard g; + ScopedConfigValue aCfg(true); // Given a file with a checked checkbox content control: createSwDoc(); SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); @@ -244,7 +246,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlPDFFontColor) if (!pPDFium) return; - SwExportFormFieldsGuard g; + ScopedConfigValue aCfg(true); // Given a document with a custom orange font color and a content control: createSwDoc(); SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); @@ -277,7 +279,7 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlPDFDropDownText) if (!pPDFium) return; - SwExportFormFieldsGuard g; + ScopedConfigValue aCfg(true); // Given a document with a dropdown: custom default text and 3 items: createSwDoc(); uno::Reference xMSF(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx index 565889bbdda0..75680d8c7ad8 100644 --- a/sw/qa/core/text/text.cxx +++ b/sw/qa/core/text/text.cxx @@ -29,6 +29,8 @@ #include #include #include +#include +#include #include #include @@ -220,7 +222,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf159924) CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf159336) { - SwExportFormFieldsGuard g; + ScopedConfigValue aCfg(true); createSwDoc("tdf159336.odt"); save(TestFilter::PDF_WRITER); @@ -1036,7 +1038,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDF) if (!pPDFium) return; - SwExportFormFieldsGuard g; + ScopedConfigValue aCfg(true); // Given a file with a content control: createSwDoc(); SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); @@ -1083,7 +1085,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPlaceholderPDF) if (!pPDFium) return; - SwExportFormFieldsGuard g; + ScopedConfigValue aCfg(true); // Given a file with a content control, in placeholder mode: createSwDoc(); SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); @@ -1111,7 +1113,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testCheckboxContentControlPDF) if (!pPDFium) return; - SwExportFormFieldsGuard g; + ScopedConfigValue aCfg(true); // Given a file with a checkbox content control: createSwDoc(); SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); @@ -1141,7 +1143,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testDropdownContentControlPDF) if (!pPDFium) return; - SwExportFormFieldsGuard g; + ScopedConfigValue aCfg(true); // Given a file with a dropdown content control: createSwDoc(); SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); @@ -1171,7 +1173,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testDropdownContentControlPDF2) if (!pPDFium) return; - SwExportFormFieldsGuard g; + ScopedConfigValue aCfg(true); createSwDoc("tdf153040.docx"); save(TestFilter::PDF_WRITER); @@ -1196,7 +1198,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testDateContentControlPDF) if (!pPDFium) return; - SwExportFormFieldsGuard g; + ScopedConfigValue aCfg(true); // Given a file with a date content control: createSwDoc(); SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); @@ -1229,7 +1231,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDFFont) if (!pPDFium) return; - SwExportFormFieldsGuard g; + ScopedConfigValue aCfg(true); // Given a document with a custom 24pt font size and a content control: createSwDoc(); SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); @@ -1261,7 +1263,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testComboContentControlPDF) if (!pPDFium) return; - SwExportFormFieldsGuard g; + ScopedConfigValue aCfg(true); // Given a file with a combo box content control: createSwDoc(); SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); @@ -1292,7 +1294,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRichContentControlPDF) if (!pPDFium) return; - SwExportFormFieldsGuard g; + ScopedConfigValue aCfg(true); // Given a file with a rich content control, its value set to "xxxyyy": createSwDoc(); SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); @@ -1328,7 +1330,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testPlaceholderFieldPDF) if (!pPDFium) return; - SwExportFormFieldsGuard g; + ScopedConfigValue aCfg(true); // Given a file with a text-type placeholder field: createSwDoc("placeholder.fodt"); diff --git a/sw/qa/inc/swmodeltestbase.hxx b/sw/qa/inc/swmodeltestbase.hxx index 11967d327dd5..51c2efafbef4 100644 --- a/sw/qa/inc/swmodeltestbase.hxx +++ b/sw/qa/inc/swmodeltestbase.hxx @@ -47,10 +47,6 @@ #define DECLARE_WW8EXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, TestFilter::DOC) class SwXTextDocument; -namespace comphelper -{ -class ConfigurationChanges; -} namespace vcl { namespace pdf @@ -59,16 +55,6 @@ class PDFiumDocument; } } -/// Temporarily enables the ExportFormFields setting. -class SWQAHELPER_DLLPUBLIC SwExportFormFieldsGuard -{ - std::shared_ptr m_pBatch; - bool m_bValue; -public: - SwExportFormFieldsGuard(); - ~SwExportFormFieldsGuard(); -}; - /// Base class for filter tests loading or roundtripping a document, then asserting the document model. class SWQAHELPER_DLLPUBLIC SwModelTestBase : public UnoApiXmlTest { diff --git a/sw/qa/unit/swmodeltestbase.cxx b/sw/qa/unit/swmodeltestbase.cxx index e149687a9cf1..7a1c0d5609ad 100644 --- a/sw/qa/unit/swmodeltestbase.cxx +++ b/sw/qa/unit/swmodeltestbase.cxx @@ -24,8 +24,6 @@ #include #include #include -#include -#include #include #include @@ -485,18 +483,4 @@ void SwModelTestBase::emulateTyping(std::u16string_view rStr) } } -SwExportFormFieldsGuard::SwExportFormFieldsGuard() -{ - m_pBatch = comphelper::ConfigurationChanges::create(); - m_bValue = officecfg::Office::Common::Filter::PDF::Export::ExportFormFields::get(); - officecfg::Office::Common::Filter::PDF::Export::ExportFormFields::set(true, m_pBatch); - m_pBatch->commit(); -} - -SwExportFormFieldsGuard::~SwExportFormFieldsGuard() -{ - officecfg::Office::Common::Filter::PDF::Export::ExportFormFields::set(m_bValue, m_pBatch); - m_pBatch->commit(); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */