diff options
-rw-r--r-- | sw/qa/uibase/fldui/fldui.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/fields/docufld.cxx | 3 |
2 files changed, 20 insertions, 3 deletions
diff --git a/sw/qa/uibase/fldui/fldui.cxx b/sw/qa/uibase/fldui/fldui.cxx index 78b2fcedd42a..0bf6bfa33fb6 100644 --- a/sw/qa/uibase/fldui/fldui.cxx +++ b/sw/qa/uibase/fldui/fldui.cxx @@ -121,6 +121,26 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertRefmark) CPPUNIT_ASSERT_EQUAL(OUString("aaabbbccc"), pTextNode->GetText()); } +CPPUNIT_TEST_FIXTURE(Test, testTdf68364InsertConditionalFieldWithTwoDots) +{ + // Create an empty document + createSwDoc(); + SwDoc* pDoc = getSwDoc(); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + + // Insert a conditional field containing exactly two dots for its condition + SwFieldMgr aFieldMgr(pWrtShell); + SwInsertField_Data aFieldData(SwFieldTypesEnum::ConditionalText, 0, "true", "19.12.2023", 0); + CPPUNIT_ASSERT(aFieldMgr.InsertField(aFieldData)); + pWrtShell->SttEndDoc(true); + + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 19.12.2023 + // - Actual : + CPPUNIT_ASSERT_EQUAL(OUString("19.12.2023"), + pWrtShell->GetCurField()->ExpandField(true, nullptr)); +} + CPPUNIT_TEST_FIXTURE(Test, testInsertRefmarkSelection) { // Given a document with a single selected word: diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 37249555a0e4..ba5f45beceec 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -1389,9 +1389,6 @@ void SwHiddenTextField::Evaluate(SwDoc& rDoc) GetLanguage(), m_aContent, &fNumber ); m_bValid = true; } - else if( !sDBName.isEmpty() && !sDataSource.isEmpty() && - !sDataTableOrQuery.isEmpty() ) - m_bValid = true; } #endif } |