sw/qa/extras/odfimport/data/tdf123968.odt |binary sw/qa/extras/odfimport/odfimport.cxx | 17 +++++++++++++++++ 2 files changed, 17 insertions(+)
New commits: commit 053b1417137b0cdec4e4fed7ae0c57cf67ff2698 Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Thu Apr 18 11:07:48 2019 +0200 Commit: Samuel Mehrbrodt <[email protected]> CommitDate: Tue Apr 23 11:01:16 2019 +0200 tdf#123968 Test that imported field is editable Change-Id: I2dbcc6fa8ee9c469cfc038a2622962b8939ec174 Reviewed-on: https://gerrit.libreoffice.org/70921 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <[email protected]> diff --git a/sw/qa/extras/odfimport/data/tdf123968.odt b/sw/qa/extras/odfimport/data/tdf123968.odt new file mode 100644 index 000000000000..1c081619ea30 Binary files /dev/null and b/sw/qa/extras/odfimport/data/tdf123968.odt differ diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 0679815ba500..ac8d7aedb45f 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -28,6 +28,7 @@ #include <view.hxx> #include <edtwin.hxx> #include <olmenu.hxx> +#include <hintids.hxx> typedef std::map<OUString, css::uno::Sequence< css::table::BorderLine> > AllBordersMap; typedef std::pair<OUString, css::uno::Sequence< css::table::BorderLine> > StringSequencePair; @@ -930,6 +931,22 @@ DECLARE_ODFIMPORT_TEST(testTdf113289, "tdf113289.odt") getProperty<sal_Int8>(aPageStyle, "FootnoteLineStyle")); } +DECLARE_ODFIMPORT_TEST(testTdf123968, "tdf123968.odt") +{ + // The test doc is special in that it starts with a table and it also has a header. + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell(); + SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); + + pWrtShell->SelAll(); + SwTextNode& rStart = dynamic_cast<SwTextNode&>(pShellCursor->Start()->nNode.GetNode()); + + // The field is now editable like any text, thus the field content "New value" shows up for the cursor. + CPPUNIT_ASSERT_EQUAL(OUString("inputfield: " + OUStringLiteral1(CH_TXT_ATR_INPUTFIELDSTART) + + "New value" + OUStringLiteral1(CH_TXT_ATR_INPUTFIELDEND)), + rStart.GetText()); +} CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
