[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 2 commits - oox/source sd/qa
Tamas Bunth (via logerrit)
logerrit at kemper.freedesktop.org
Fri Nov 1 09:47:15 UTC 2019
oox/source/drawingml/textfield.cxx | 6 ++++++
sd/qa/unit/data/pptx/tdf126324.pptx |binary
sd/qa/unit/import-tests.cxx | 17 +++++++++++++++++
3 files changed, 23 insertions(+)
New commits:
commit 834fb2bf399d2fb1f2ab6f7a3f39c02b37744104
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
AuthorDate: Tue Oct 29 14:53:05 2019 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Nov 1 10:46:50 2019 +0100
tdf#126324 pptx unit test for custom date import
Add unit test for importing custom date field (<c:fld> element of type
"datetime")
Change-Id: Ifcb5641c99eeb79afe54b801750e68792880c000
Reviewed-on: https://gerrit.libreoffice.org/81687
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/sd/qa/unit/data/pptx/tdf126324.pptx b/sd/qa/unit/data/pptx/tdf126324.pptx
new file mode 100644
index 000000000000..d5540cdc4de4
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf126324.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 362d67814d91..0de7cf85963e 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -185,6 +185,7 @@ public:
void testTdf116899();
void testTdf77747();
void testTdf116266();
+ void testTdf126324();
bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected);
void testPatternImport();
@@ -269,6 +270,7 @@ public:
CPPUNIT_TEST(testTdf114913);
CPPUNIT_TEST(testTdf114821);
CPPUNIT_TEST(testTdf115394);
+ CPPUNIT_TEST(testTdf126324);
CPPUNIT_TEST(testTdf115394PPT);
CPPUNIT_TEST(testTdf51340);
CPPUNIT_TEST(testTdf116899);
@@ -2652,6 +2654,21 @@ void SdImportTest::testTdf120028b()
xDocShRef->DoClose();
}
+void SdImportTest::testTdf126324()
+{
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf126324.pptx"), PPTX);
+ uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(),
+ uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xDoc.is());
+ uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xPage.is());
+ uno::Reference<beans::XPropertySet> xShape(getShape(0, xPage));
+ CPPUNIT_ASSERT(xShape.is());
+ uno::Reference< text::XText > xText = uno::Reference< text::XTextRange>( xShape, uno::UNO_QUERY_THROW )->getText();
+ CPPUNIT_ASSERT_EQUAL(OUString{"17"}, xText->getString());
+}
+
void SdImportTest::testCropToShape()
{
sd::DrawDocShellRef xDocShRef
commit 43446b54a2642e367bddca63f14f1b6da58e2149
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
AuthorDate: Fri Oct 25 17:45:01 2019 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Nov 1 10:46:39 2019 +0100
tdf#126324 Import custom date as custom XTextField
Change-Id: I89f96490a47210e7daa3b21b2399e0dfe0cf3abf
Reviewed-on: https://gerrit.libreoffice.org/81513
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96 at gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/81662
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/oox/source/drawingml/textfield.cxx b/oox/source/drawingml/textfield.cxx
index a3e2bf4948c6..ae0672896e50 100644
--- a/oox/source/drawingml/textfield.cxx
+++ b/oox/source/drawingml/textfield.cxx
@@ -66,6 +66,12 @@ void lclCreateTextFields( std::vector< Reference< XTextField > > & aFields,
OString p( s.pData->buffer + 8 );
try
{
+ if(p.startsWith("'"))
+ {
+ xIface = xFactory->createInstance( "com.sun.star.text.TextField.Custom" );
+ aFields.emplace_back( xIface, UNO_QUERY );
+ return;
+ }
bool bIsDate = true;
int idx = p.toInt32();
sal_uInt16 nNumFmt;
More information about the Libreoffice-commits
mailing list