[Libreoffice-commits] core.git: 4 commits - sw/CppunitTest_sw_ooxmlimport.mk sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Mar 10 02:51:54 PDT 2014
sw/CppunitTest_sw_ooxmlimport.mk | 1
sw/qa/extras/ooxmlimport/data/strict-lockedcanvas.docx |binary
sw/qa/extras/ooxmlimport/data/strict.docx |binary
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 21 ++++++++++++++++-
writerfilter/source/ooxml/model.xml | 4 +++
5 files changed, 25 insertions(+), 1 deletion(-)
New commits:
commit c98d649117dc776ac51807be3376924d1fce2035
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Mar 10 10:33:54 2014 +0100
DOCX strict import: handle math
Change-Id: I8b1419cb71ef67f91bfa532faa283204dae0e25c
diff --git a/sw/CppunitTest_sw_ooxmlimport.mk b/sw/CppunitTest_sw_ooxmlimport.mk
index 1171001..2c4682b 100644
--- a/sw/CppunitTest_sw_ooxmlimport.mk
+++ b/sw/CppunitTest_sw_ooxmlimport.mk
@@ -69,6 +69,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_ooxmlimport,\
sw/util/swd \
sw/util/msword \
sfx2/util/sfx \
+ starmath/util/sm \
svl/source/fsstor/fsstorage \
svl/util/svl \
svtools/util/svt \
diff --git a/sw/qa/extras/ooxmlimport/data/strict.docx b/sw/qa/extras/ooxmlimport/data/strict.docx
index 8586f37..b46ce94 100644
Binary files a/sw/qa/extras/ooxmlimport/data/strict.docx and b/sw/qa/extras/ooxmlimport/data/strict.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index d09631be..f788f92 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1929,6 +1929,10 @@ DECLARE_OOXMLIMPORT_TEST(testStrict, "strict.docx")
// Chart was missing.
xServiceInfo.set(getShape(3), uno::UNO_QUERY);
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextEmbeddedObject"));
+
+ // Math was missing.
+ xServiceInfo.set(getShape(4), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextEmbeddedObject"));
}
DECLARE_OOXMLIMPORT_TEST(testStrictLockedcanvas, "strict-lockedcanvas.docx")
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index 12936ba..e0d3bb4 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -41,6 +41,7 @@
<namespace-alias name="http://schemas.openxmlformats.org/wordprocessingml/2006/main" alias="wordprocessingml" id="doc"/>
<namespace-alias name="http://purl.oclc.org/ooxml/wordprocessingml/main" alias="wordprocessingml" id="doc"/>
<namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/math" alias="math" id="officeMath"/>
+ <namespace-alias name="http://purl.oclc.org/ooxml/officeDocument/math" alias="math" id="officeMath"/>
<namespace-alias name="http://schemas.openxmlformats.org/schemaLibrary/2006/main" alias="schemaLibrary" id="schema"/>
<namespace-alias name="http://schemas.openxmlformats.org/markup-compatibility/2006" alias="mce" id="mce"/>
<namespace-alias name="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" alias="wp14" id="wp14"/>
commit d795fb224e52c66c4585ed1e079a2b7601a07eda
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Mar 10 10:10:21 2014 +0100
DOCX strict import: handle lockedCanvas
Change-Id: I44c936a8972e1ae101aeab62ace61f4470d92b34
diff --git a/sw/qa/extras/ooxmlimport/data/strict-lockedcanvas.docx b/sw/qa/extras/ooxmlimport/data/strict-lockedcanvas.docx
new file mode 100644
index 0000000..d31be7e
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/strict-lockedcanvas.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 8c7d97a..d09631be 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1931,6 +1931,12 @@ DECLARE_OOXMLIMPORT_TEST(testStrict, "strict.docx")
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextEmbeddedObject"));
}
+DECLARE_OOXMLIMPORT_TEST(testStrictLockedcanvas, "strict-lockedcanvas.docx")
+{
+ // locked canvas shape was missing.
+ getShape(1);
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index 97e9cfa..12936ba 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -32,6 +32,7 @@
<namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/diagram" alias="diagram" id="dmlDiagram"/>
<namespace-alias name="http://purl.oclc.org/ooxml/drawingml/diagram" alias="diagram" id="dmlDiagram"/>
<namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas" alias="lockedCanvas" id="dmlLockedCanvas"/>
+ <namespace-alias name="http://purl.oclc.org/ooxml/drawingml/lockedCanvas" alias="lockedCanvas" id="dmlLockedCanvas"/>
<namespace-alias name="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" alias="wps" id="wps"/>
<namespace-alias name="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" alias="wpg" id="wpg"/>
<namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/chart" alias="chart" id="dmlChart"/>
commit f5985685ddc519f760a7324fa60fd662f25404c1
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Mar 10 09:32:41 2014 +0100
DOCX strict import: handle SmartArt
Change-Id: I8c45f3153eafe882f3d9ee3be533c3c0e673527e
diff --git a/sw/qa/extras/ooxmlimport/data/strict.docx b/sw/qa/extras/ooxmlimport/data/strict.docx
index de71c3b..8586f37 100644
Binary files a/sw/qa/extras/ooxmlimport/data/strict.docx and b/sw/qa/extras/ooxmlimport/data/strict.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 1b147a7..8c7d97a 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1922,8 +1922,12 @@ DECLARE_OOXMLIMPORT_TEST(testStrict, "strict.docx")
uno::Reference<lang::XServiceInfo> xServiceInfo(getShape(1), uno::UNO_QUERY);
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextGraphicObject"));
- // Chart was missing.
+ // SmartArt was missing.
xServiceInfo.set(getShape(2), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"));
+
+ // Chart was missing.
+ xServiceInfo.set(getShape(3), uno::UNO_QUERY);
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextEmbeddedObject"));
}
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index 513902b..97e9cfa 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -30,6 +30,7 @@
<namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/picture" alias="picture" id="dmlPicture"/>
<namespace-alias name="http://purl.oclc.org/ooxml/drawingml/picture" alias="picture" id="dmlPicture"/>
<namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/diagram" alias="diagram" id="dmlDiagram"/>
+ <namespace-alias name="http://purl.oclc.org/ooxml/drawingml/diagram" alias="diagram" id="dmlDiagram"/>
<namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas" alias="lockedCanvas" id="dmlLockedCanvas"/>
<namespace-alias name="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" alias="wps" id="wps"/>
<namespace-alias name="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" alias="wpg" id="wpg"/>
commit 49c3aff8d8d3030b2acbffb6ff000b5d44445cc9
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Mar 10 09:11:09 2014 +0100
DOCX strict import: handle charts
Change-Id: I1933b3272ff735ae1ecb500fcd693e3ca99bf264
diff --git a/sw/qa/extras/ooxmlimport/data/strict.docx b/sw/qa/extras/ooxmlimport/data/strict.docx
index b48b708..de71c3b 100644
Binary files a/sw/qa/extras/ooxmlimport/data/strict.docx and b/sw/qa/extras/ooxmlimport/data/strict.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 8428f3f..1b147a7 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1918,8 +1918,13 @@ DECLARE_OOXMLIMPORT_TEST(testStrict, "strict.docx")
uno::Reference<text::XText> xHeaderText(xPageStyle->getPropertyValue("HeaderText"), uno::UNO_QUERY);
getParagraphOfText(1, xHeaderText, "This is a header.");
- // Picture was missing, this resulted in a lang::IndexOutOfBoundsException.
- getShape(1);
+ // Picture was missing.
+ uno::Reference<lang::XServiceInfo> xServiceInfo(getShape(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextGraphicObject"));
+
+ // Chart was missing.
+ xServiceInfo.set(getShape(2), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextEmbeddedObject"));
}
#endif
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index 34eb59d..513902b 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -34,6 +34,7 @@
<namespace-alias name="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" alias="wps" id="wps"/>
<namespace-alias name="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" alias="wpg" id="wpg"/>
<namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/chart" alias="chart" id="dmlChart"/>
+ <namespace-alias name="http://purl.oclc.org/ooxml/drawingml/chart" alias="chart" id="dmlChart"/>
<namespace-alias name="urn:schemas-microsoft-com:office:word" alias="vml_wordprocessingDrawing" id="vmlWord"/>
<namespace-alias name="http://schemas.openxmlformats.org/wordprocessingml/2006/main" alias="wordprocessingml" id="doc"/>
<namespace-alias name="http://purl.oclc.org/ooxml/wordprocessingml/main" alias="wordprocessingml" id="doc"/>
More information about the Libreoffice-commits
mailing list