[Libreoffice-commits] core.git: 4 commits - avmedia/Library_avmedia.mk avmedia/source external/collada2gltf oox/source sw/qa

Sourav sourav.mahajan at synerzip.com
Mon May 19 00:36:02 PDT 2014


 avmedia/Library_avmedia.mk                          |    6 ++++++
 avmedia/source/framework/modeltools.cxx             |    4 ++--
 external/collada2gltf/StaticLibrary_collada2gltf.mk |    6 ------
 oox/source/shape/ShapeContextHandler.cxx            |    5 ++++-
 sw/qa/extras/ooxmlexport/data/fdo78474.docx         |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx            |   12 ++++++++++++
 6 files changed, 24 insertions(+), 9 deletions(-)

New commits:
commit ca0be6743496cbb747e320b5b13bd1270b113892
Author: Sourav <sourav.mahajan at synerzip.com>
Date:   Thu May 15 16:20:36 2014 +0530

    fdo78474:Corruption a:graphicData has no info for the image.
    
    The original file contains two text boxes one contains image and the other contains chart.
    Image in text box is not getting imported in LO which leads to no contents inside the a:graphicData tag which is causing the corruption.
    Root cause is found in ShapeContextHandler::getShape.
    mxChartShapeContext.is() returns true even when mnStartToken is not set as NMSP_dmlChart which is causing the issue.
    I have added one more condition to handle this.
    
    Change-Id: I6c567d7618b34c1a24f6809801e4460af6894c67
    Reviewed-on: https://gerrit.libreoffice.org/9363
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 4d9b91a..34a84b4 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -463,7 +463,10 @@ ShapeContextHandler::getShape() throw (uno::RuntimeException, std::exception)
                 mxLockedCanvasContext.clear();
             }
         }
-        else if (mxChartShapeContext.is())
+        //NMSP_dmlChart == getNamespace( mnStartToken ) check is introduced to make sure that
+        //mnStartToken is set as NMSP_dmlChart in setStartToken.
+        //Only in case it is set then only the below block of code for ChartShapeContext should be executed.
+        else if (mxChartShapeContext.is() && (NMSP_dmlChart == getNamespace( mnStartToken )))
         {
             ChartGraphicDataContext* pChartGraphicDataContext = dynamic_cast<ChartGraphicDataContext*>(mxChartShapeContext.get());
             if (pChartGraphicDataContext)
diff --git a/sw/qa/extras/ooxmlexport/data/fdo78474.docx b/sw/qa/extras/ooxmlexport/data/fdo78474.docx
new file mode 100644
index 0000000..6468a84
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo78474.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 795ec67..67ccaae 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3194,6 +3194,18 @@ DECLARE_OOXMLEXPORT_TEST(testContentTypeTIF, "fdo77476.docx")
     assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='image/tif']", "PartName", "/word/media/image1.tif");
 }
 
+DECLARE_OOXMLEXPORT_TEST(fdo78474, "fdo78474.docx")
+{
+    xmlDocPtr pXmlDoc1 = parseExport("word/document.xml");
+    if (!pXmlDoc1) return;
+    //docx file after RT is getting corrupted.
+    assertXPath(pXmlDoc1, "/w:document[1]/w:body[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1]/w:p[1]/w:r[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/pic:pic[1]/pic:blipFill[1]/a:blip[1]", "embed", "rId2");
+
+    xmlDocPtr pXmlDoc2 = parseExport("word/_rels/document.xml.rels");
+    if (!pXmlDoc2) return;
+    assertXPath(pXmlDoc2,"/rels:Relationships/rels:Relationship[2]","Id","rId2");
+}
+
 DECLARE_OOXMLEXPORT_TEST(testFDO77117, "fdo77117.docx")
 {
     uno::Reference<drawing::XShapes> xGroup(getShape(1), uno::UNO_QUERY);
commit 31d8acbe260c7ff75d1cfa9479b7026528e493bd
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Mon May 19 09:35:13 2014 +0200

    No need to add -lrt for a static library.
    
    Change-Id: I8104301e9aab6e7c732e97446030c9caf6ffec66

diff --git a/external/collada2gltf/StaticLibrary_collada2gltf.mk b/external/collada2gltf/StaticLibrary_collada2gltf.mk
index a2f7d2b..0097f3f 100644
--- a/external/collada2gltf/StaticLibrary_collada2gltf.mk
+++ b/external/collada2gltf/StaticLibrary_collada2gltf.mk
@@ -30,12 +30,6 @@ $(eval $(call gb_StaticLibrary_add_defs,collada2gltf,\
 
 endif
 
-ifeq ($(OS),LINUX)
-$(eval $(call gb_StaticLibrary_add_libs,collada2gltf,\
-	-lrt \
-))
-endif
-
 $(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,collada2gltf,cpp))
 
 $(eval $(call gb_StaticLibrary_set_include,collada2gltf,\
commit 9fdb7bf1d99f8311c4589a834e909062f66680d8
Author: Jeroen Nijhof <jeroen at nijhof.co.uk>
Date:   Mon May 19 07:00:53 2014 +0200

    libavmedia.so needs to link to librt under Linux
    
    libavmedia.so links to libopencollada2gltf.a, which contains a
    reference to clock_gettime(). And for clock_gettime one needs
    to link to librt, under Linux, at least.
    So add -lrt when linking libavmedia.so.
    
    Change-Id: I28547c6216738b44701baaed7eaf44f5ca97e98a

diff --git a/avmedia/Library_avmedia.mk b/avmedia/Library_avmedia.mk
index 48f36c4..40ba35bb 100644
--- a/avmedia/Library_avmedia.mk
+++ b/avmedia/Library_avmedia.mk
@@ -50,6 +50,12 @@ $(eval $(call gb_Library_use_libraries,avmedia,\
 ifneq (,$(filter COLLADA2GLTF,$(BUILD_TYPE)))
 $(eval $(call gb_Library_set_warnings_not_errors,avmedia))
 
+ifeq ($(OS),LINUX)
+$(eval $(call gb_Library_add_libs,avmedia,\
+	-lrt \
+))
+endif
+
 $(eval $(call gb_Library_use_externals,avmedia,\
 	collada2gltf \
 	libxml2 \
commit 9ccef311aae891daf4436e6d89117bfae3d95959
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Wed May 14 22:44:43 2014 +0200

    Do not throw if there is no "images" child in json file tree.
    
    Change-Id: I0b47ed00fecad84859ba3f1751407696878203fb

diff --git a/avmedia/source/framework/modeltools.cxx b/avmedia/source/framework/modeltools.cxx
index ea400a3..9b48552 100644
--- a/avmedia/source/framework/modeltools.cxx
+++ b/avmedia/source/framework/modeltools.cxx
@@ -71,7 +71,7 @@ static void lcl_EmbedExternals(const OUString& rSourceURL, uno::Reference<embed:
 
     // Parse json, read externals' URI and modify this relative URI's so they remain valid in the new context.
     std::vector<std::string> vExternals;
-    ptree aTree;
+    ptree aTree, aEmptyTree;
     try
     {
         json_parser::read_json( sUrl, aTree );
@@ -85,7 +85,7 @@ static void lcl_EmbedExternals(const OUString& rSourceURL, uno::Reference<embed:
             aTree.put("buffers." + rVal.first + ".path.",sBufferUri.substr(sBufferUri.find_last_of('/')+1));
         }
         // Images for textures
-        BOOST_FOREACH(ptree::value_type &rVal,aTree.get_child("images"))
+        BOOST_FOREACH(ptree::value_type &rVal,aTree.get_child("images", aEmptyTree))
         {
             const std::string sImageUri(rVal.second.get<std::string>("path"));
             vExternals.push_back(sImageUri);


More information about the Libreoffice-commits mailing list