summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/uiwriter/data/tdf105625.fodt1
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx12
2 files changed, 10 insertions, 3 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf105625.fodt b/sw/qa/extras/uiwriter/data/tdf105625.fodt
index 44c0577d301b..9a1d573d033f 100644
--- a/sw/qa/extras/uiwriter/data/tdf105625.fodt
+++ b/sw/qa/extras/uiwriter/data/tdf105625.fodt
@@ -3,6 +3,7 @@
<office:body>
<office:text>
<text:p><field:fieldmark field:type="vnd.oasis.opendocument.field.FORMCHECKBOX"/></text:p>
+ <text:p><field:fieldmark-start field:type="vnd.oasis.opendocument.field.FORMTEXT"/>Field<field:fieldmark-end/></text:p>
</office:text>
</office:body>
</office:document> \ No newline at end of file
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index eb49924ee181..309791efeebd 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -4273,18 +4273,24 @@ void SwUiWriterTest::testTdf105417()
void SwUiWriterTest::testTdf105625()
{
- // We should be able to edit at positions adjacent to fields.
- // Check if the start and the end of the only paragraph are not protected
- // (they are adjacent to FORMCHECKBOX)
SwDoc* pDoc = createDoc("tdf105625.fodt");
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
uno::Reference<uno::XComponentContext> xComponentContext(comphelper::getProcessComponentContext());
// Ensure correct initial setting
comphelper::ConfigurationHelper::writeDirectKey(xComponentContext, "org.openoffice.Office.Writer/", "Cursor/Option", "IgnoreProtectedArea", css::uno::Any(false), comphelper::EConfigurationModes::Standard);
+ // We should be able to edit at positions adjacent to fields.
+ // Check if the start and the end of the 1st paragraph are not protected
+ // (they are adjacent to FORMCHECKBOX)
pWrtShell->SttPara();
CPPUNIT_ASSERT_EQUAL(false, pWrtShell->HasReadonlySel());
pWrtShell->EndPara();
CPPUNIT_ASSERT_EQUAL(false, pWrtShell->HasReadonlySel());
+ // 2nd paragraph - FORMTEXT
+ pWrtShell->Down(/*bSelect=*/false);
+ // Check selection across FORMTEXT field boundary - must be read-only
+ pWrtShell->SttPara();
+ pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false);
+ CPPUNIT_ASSERT_EQUAL(true, pWrtShell->HasReadonlySel());
}
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);