[Libreoffice-commits] core.git: Changes to 'refs/changes/33/8833/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/33/8833/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/33/8833/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/86/10386/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/43/8843/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/82/8782/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/82/8782/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/03/8603/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/57/8657/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/57/8657/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/63/9363/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/47/9147/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/47/9147/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/11/9011/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/11/9011/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/98/9898/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/98/9898/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/98/9898/4'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/inc sw/qa sw/source writerfilter/source
sw/inc/authfld.hxx|3 +++ sw/inc/fldbas.hxx |2 ++ sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 10 ++ sw/source/core/fields/authfld.cxx | 22 ++ sw/source/core/fields/fldbas.cxx |6 ++ sw/source/filter/ww8/docxattributeoutput.cxx |2 +- sw/source/filter/ww8/ww8atr.cxx |5 ++--- writerfilter/source/dmapper/DomainMapper_Impl.cxx |6 +++--- 8 files changed, 41 insertions(+), 15 deletions(-) New commits: commit f021524aadfe1aa1a07f4600bcb89e7c69ccfdb0 Author: Sourav Date: Wed Jun 25 12:32:59 2014 +0530 fdo#76279 Invalid Citation on RoundTrip Reviewed on: https://gerrit.libreoffice.org/9898 Change-Id: Idfe39761180ae1eeb0066ae3aac13de6ac6df0b9 diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx index e2b006b..6e3926b 100644 --- a/sw/inc/authfld.hxx +++ b/sw/inc/authfld.hxx @@ -153,6 +153,9 @@ public: /// For internal use only, in general continue using ExpandField() instead. OUString ConditionalExpand(ToxAuthorityField eField) const; +//To handle Citation +OUString ExpandCitation(ToxAuthorityField eField) const; + SwAuthorityField(SwAuthorityFieldType* pType, const OUString& rFieldContents); SwAuthorityField(SwAuthorityFieldType* pType, sal_IntPtr nHandle); virtual ~SwAuthorityField(); diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx index 0d1724f..f6893e8 100644 --- a/sw/inc/fldbas.hxx +++ b/sw/inc/fldbas.hxx @@ -319,6 +319,8 @@ public: */ OUStringExpandField(bool const bCached, ToxAuthorityField eField = AUTH_FIELD_IDENTIFIER) const; +OUStringExpandCitation(ToxAuthorityField eField = AUTH_FIELD_IDENTIFIER) const; + /// @return name or content. virtual OUStringGetFieldName() const; diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 4c48e95..76c3fb9 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3000,14 +3000,8 @@ DECLARE_OOXMLEXPORT_TEST(testCitation,"FDO74775.docx") xmlDocPtr pXmlDoc = parseExport(); if (!pXmlDoc) return; -xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc,"/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[3]/w:instrText"); -xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; -CPPUNIT_ASSERT(pXmlNodes != 0); -CPPUNIT_ASSERT(pXmlNodes->nodeNr > 0); -xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; -OUString contents = OUString::createFromAscii((const char*)((pXmlNode->children[0]).content)); -CPPUNIT_ASSERT(contents.match(" CITATION [Kra06]")); -xmlXPathFreeObject(pXmlObj); +assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[3]/w:instrText", " CITATION Kra06 \\l 1033 "); +assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[5]/w:t", "(Kramer & Chen, 2006)"); } DECLARE_OOXMLEXPORT_TEST(testFdo76016, "fdo76016.docx") diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index 4cfaf6a..2eff387 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -569,6 +569,28 @@ OUString SwAuthorityField::ConditionalExpand(ToxAuthorityField eField) const return sRet; } +OUString SwAuthorityField::ExpandCitation(ToxAuthorityField eField) const +{ +SwAuthorityFieldType* pAuthType = (SwAuthorityFieldType*)GetTyp(); +OUString sRet; + +if( pAuthType->IsSequence() ) +{ + if(!pAuthType->GetDoc()->IsExpFldsLocked()) + m_nTempSequencePos = pAuthType->GetSequencePos( m_nHandle ); + if( m_nTempSequencePos >= 0 ) + sRet += OUString::number( m_nTempSequencePos ); +} +else +{ +const SwAuthEntry* pEntry = pAuthType->GetEntryByHandle(m_nHandle); +//TODO: Expand to: identifier, number sequence, ... +if(pEntry) +sRet += pEntry->GetAuthorField(eField); +} +return sRet; +} + SwField* SwAuthorityField::Copy() const { SwAuthorityFieldType* pAuthType = (SwAuthorityFieldType*)GetTyp(); diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index 90600e2..0827a7f 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -405,6 +405,12 @@ OUString SwField::ExpandField(bool const bCached, ToxAuthorityField eField) cons return Expand(); } +OUString SwField::ExpandCitation(ToxAuthorityField eField) const +{ +const SwAuthorityField* pAuthorityField = static_cast(this); +return (pAuthorityField ? pAuthorityField->ExpandCitation(eField) : OUString()); +} + SwField * SwField::CopyField() const { SwField *const pNew =
[Libreoffice-commits] core.git: 4 commits - avmedia/Library_avmedia.mk avmedia/source external/collada2gltf oox/source sw/qa
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 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 Tested-by: Miklos Vajna 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(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 000..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 xGroup(getShape(1), uno::UNO_QUERY); commit 31d8acbe260c7ff75d1cfa9479b7026528e493bd Author: Matúš Kukan 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 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 t
[Libreoffice-commits] core.git: chart2/qa oox/source
chart2/qa/extras/chart2export.cxx| 38 +++ chart2/qa/extras/data/docx/fdo77216.docx |binary oox/source/export/chartexport.cxx| 17 + 3 files changed, 54 insertions(+), 1 deletion(-) New commits: commit a211c754003f98bc8f7761224a0b265bd224f61f Author: Sourav Date: Tue Apr 15 16:39:52 2014 +0530 fdo77216-Charts-Scattered chart: Chart gets distorted on RT In case there is some text entered in place of X coordinates for scatter chart then x coordinates should be taken as 1,2,3 MS Word does the same thing Change-Id: I1db0fd64c6ac0f4d5e77a9676812f5e26577ecf6 Reviewed-on: https://gerrit.libreoffice.org/9011 Tested-by: Markus Mohrhard Reviewed-by: Markus Mohrhard diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index bc1dcd3..eded887 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -36,6 +36,7 @@ public: void testStockChart(); void testBarChart(); void testCrosses(); +void testScatterChart(); void testChartDataTable(); void testChartExternalData(); void testEmbeddingsGrabBag(); @@ -64,6 +65,7 @@ public: CPPUNIT_TEST(testStockChart); CPPUNIT_TEST(testBarChart); CPPUNIT_TEST(testCrosses); +CPPUNIT_TEST(testScatterChart); CPPUNIT_TEST(testChartDataTable); CPPUNIT_TEST(testChartExternalData); CPPUNIT_TEST(testEmbeddingsGrabBag); @@ -117,6 +119,14 @@ protected: * Same as the assertXPath(), but don't assert: return the string instead. */ OUString getXPath(xmlDocPtr pXmlDoc, const OString& rXPath, const OString& rAttribute); +/** +Assert that rXPath exists, and its content equals rContent. +*/ +void assertXPathContent(xmlDocPtr pXmlDoc, const OString& rXPath, const OUString& rContent); +/** +Same as the assertXPathContent(), but don't assert: return the string instead. +*/ +OUString getXPathContent(xmlDocPtr pXmlDoc, const OString& rXPath); private: }; @@ -211,6 +221,24 @@ void Chart2ExportTest::assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath, int nNumberOfNodes, xmlXPathNodeSetGetLength(pXmlNodes)); } +void Chart2ExportTest::assertXPathContent(xmlDocPtr pXmlDoc, const OString& rXPath, const OUString& rContent) +{ +CPPUNIT_ASSERT_EQUAL_MESSAGE("XPath contents of child does not match", rContent, getXPathContent(pXmlDoc, rXPath)); +} + +OUString Chart2ExportTest::getXPathContent(xmlDocPtr pXmlDoc, const OString& rXPath) +{ + xmlNodeSetPtr pXmlNodes = getXPathNode(pXmlDoc, rXPath); + + CPPUNIT_ASSERT_MESSAGE(OString("XPath '" + rXPath + "' not found").getStr(), + xmlXPathNodeSetGetLength(pXmlNodes) > 0); + + xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; + +_xmlNode *pNode = &(pXmlNode->children[0]); + return pNode ? OUString::createFromAscii((const char*)((pXmlNode->children[0]).content)) : OUString(); +} + OUString Chart2ExportTest::getXPath(xmlDocPtr pXmlDoc, const OString& rXPath, const OString& rAttribute) { xmlNodeSetPtr pXmlNodes = getXPathNode(pXmlDoc, rXPath); @@ -479,6 +507,16 @@ void Chart2ExportTest::testCrosses() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crosses", "val", "autoZero"); } +void Chart2ExportTest::testScatterChart() +{ +load("/chart2/qa/extras/data/docx/", "fdo77216.docx"); +xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); +if (!pXmlDoc) + return; + +assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal[1]/c:numRef[1]/c:numCache[1]/c:pt[1]/c:v[1]", "1"); +} + void Chart2ExportTest::testChartDataTable() { load("/chart2/qa/extras/data/docx/", "testChartDataTable.docx"); diff --git a/chart2/qa/extras/data/docx/fdo77216.docx b/chart2/qa/extras/data/docx/fdo77216.docx new file mode 100644 index 000..b741bbc Binary files /dev/null and b/chart2/qa/extras/data/docx/fdo77216.docx differ diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index f6e02db..9b12eb7 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -2008,6 +2008,14 @@ void ChartExport::exportSeriesValues( const Reference< chart2::data::XDataSequen pFS->singleElement( FSNS( XML_c, XML_ptCount ), XML_val, I32S( ptCount ), FSEND ); + +sal_Bool bIsNumberValue = sal_True; +sal_Bool bXSeriesValue = sal_False; +double Value = 1.0; + +if(nValueType == XML_xVal) +bXSeriesValue = sal_True; + for( sal_Int32 i = 0; i < ptCount; i++ ) { pFS->startElement( F
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ooxmlexport/data/fdo77719.docx |binary sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx |8 sw/source/filter/ww8/docxsdrexport.cxx |3 +++ 3 files changed, 11 insertions(+) New commits: commit f0860625e29c18d2eca647a6cedd0ce679d5a80d Author: Sourav Date: Thu Apr 24 18:18:16 2014 +0530 fdo#77719 File containing CusGeom gets corrupted on RT. RT file gets corrupted because in presetgeometry tag shapetype is coming as blank. A check is introduced to handle that. Reviewed on: https://gerrit.libreoffice.org/9147 Change-Id: Ie79db0f5dcadfa3cd5d3f54d4a676393b3a882c5 diff --git a/sw/qa/extras/ooxmlexport/data/fdo77719.docx b/sw/qa/extras/ooxmlexport/data/fdo77719.docx new file mode 100644 index 000..e671b33 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo77719.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx index cc04809..06182df 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx @@ -1105,6 +1105,14 @@ DECLARE_OOXMLEXPORT_TEST(testShapeEffectPreservation, "shape-effect-preservation "val", "5"); } +DECLARE_OOXMLEXPORT_TEST(fdo77719, "fdo77719.docx") +{ +xmlDocPtr pXmlDoc = parseExport("word/document.xml"); +if (!pXmlDoc) +return; +assertXPath(pXmlDoc, "/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:spPr[1]/a:prstGeom[1]", "prst", "rect"); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 5c5d5a2..563e124 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -1164,6 +1164,9 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId) } } } +//Empty shapeType will lead to corruption so to avoid that shapeType is set to default i.e. "rect" +if (shapeType.isEmpty()) +shapeType = "rect"; pFS->singleElementNS(XML_a, XML_prstGeom, XML_prst, OUStringToOString(shapeType, RTL_TEXTENCODING_UTF8).getStr(), ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/oox oox/source sw/qa writerfilter/source
include/oox/vml/vmlshape.hxx |1 + oox/source/vml/vmlshape.cxx | 14 ++ oox/source/vml/vmlshapecontext.cxx|1 + sw/qa/extras/ooxmlexport/data/fdo76591.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx |8 writerfilter/source/dmapper/DomainMapper_Impl.cxx | 17 - 6 files changed, 40 insertions(+), 1 deletion(-) New commits: commit 69eebf8735973a05c931182d2ebfe35ce25f4b1a Author: Sourav Date: Fri Apr 4 18:06:44 2014 +0530 fdo76591:-Textbox property (order-> send behind text) is not preserved. Z-Index was not handledin LO for vml. I have made the changes to handle that using aGrabBag. Change-Id: I2af3b2974c8eb699bc6a7b743dc438584d6517ac Reviewed-on: https://gerrit.libreoffice.org/8833 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/include/oox/vml/vmlshape.hxx b/include/oox/vml/vmlshape.hxx index d38c58f..832d3be 100644 --- a/include/oox/vml/vmlshape.hxx +++ b/include/oox/vml/vmlshape.hxx @@ -64,6 +64,7 @@ struct OOX_DLLPUBLIC ShapeTypeModel OptValue< Int32Pair > moCoordPos; ///< Top-left position of coordinate system for children scaling. OptValue< Int32Pair > moCoordSize; ///< Size of coordinate system for children scaling. OUString maPosition; ///< Position type of the shape. +OUString maZIndex;///< ZIndex of the shape OUString maLeft; ///< X position of the shape bounding box (number with unit). OUString maTop; ///< Y position of the shape bounding box (number with unit). OUString maWidth;///< Width of the shape bounding box (number with unit). diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index e79c9b8..d4bdbcf 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -41,6 +41,7 @@ #include #include #include + #include #include #include #include @@ -322,6 +323,19 @@ Reference< XShape > ShapeBase::convertAndInsert( const Reference< XShapes >& rxS PropertySet aShapeProp( xShape ); if( aShapeProp.hasProperty( PROP_Name ) ) aShapeProp.setProperty( PROP_Name, getShapeName() ); +uno::Reference< lang::XServiceInfo > xSInfo( xShape, uno::UNO_QUERY_THROW ); +if (xSInfo->supportsService("com.sun.star.text.TextFrame")) +{ +uno::Sequence aGrabBag; +uno::Reference propertySet (xShape, uno::UNO_QUERY); +propertySet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag; +sal_Int32 length = aGrabBag.getLength(); + +aGrabBag.realloc( length+1 ); +aGrabBag[length].Name = "VML-Z-ORDER"; +aGrabBag[length].Value = uno::makeAny( maTypeModel.maZIndex.toInt32() ); +propertySet->setPropertyValue( "FrameInteropGrabBag", uno::makeAny(aGrabBag) ); +} Reference< XControlShape > xControlShape( xShape, uno::UNO_QUERY ); if ( xControlShape.is() && !getTypeModel().mbVisible ) { diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index fdeca32..146940e 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -399,6 +399,7 @@ void ShapeTypeContext::setStyle( const OUString& rStyle ) if( ConversionHelper::separatePair( aName, aValue, rStyle.getToken( 0, ';', nIndex ), ':' ) ) { if( aName == "position" ) mrTypeModel.maPosition = aValue; +else if( aName == "z-index" )mrTypeModel.maZIndex = aValue; else if( aName == "left" ) mrTypeModel.maLeft = aValue; else if( aName == "top" )mrTypeModel.maTop = aValue; else if( aName == "width" ) mrTypeModel.maWidth = aValue; diff --git a/sw/qa/extras/ooxmlexport/data/fdo76591.docx b/sw/qa/extras/ooxmlexport/data/fdo76591.docx new file mode 100644 index 000..8ca4387 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo76591.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 68ef7ebb..aa48fda 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2989,6 +2989,14 @@ DECLARE_OOXMLEXPORT_TEST(testFDO76163 , "fdo76163.docx") assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:hyperlink/w:r[11]/w:fldChar", "fldCharType",
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ooxmlexport/data/test76734_2K7.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx |8 sw/source/filter/ww8/docxattributeoutput.cxx | 13 ++--- 3 files changed, 18 insertions(+), 3 deletions(-) New commits: commit df098f6207fdf79d566bf50cc2c2c87fcd295ff8 Author: Sourav Date: Fri Mar 28 18:25:39 2014 +0530 fdo76734-Text Box is not preserved for file created in MSWord 2007. Issue:Only one AlternateContent is getting written in the RT file irrespective of the number of TextBoxes in the original file which is causing the issue. RootCause is found in DocxAttributeOutput::OutputFlyFrame_Impl where under case sw::Frame::eTxtBox,m_aFramesOfParagraph.push_back(sw::Frame(rFrame)); is getting executed only once. push_back should happen as many number of times as there are TextBoxes in the original file. if(rFrame.GetFrmFmt().GetName() == m_aFramesOfParagraph[nIndex].GetFrmFmt().GetName()) bDuplicate = true; In the above check both the GetName() are returning values as empty which leads to bDuplicate equals TRUE and hence push_back does not happen. I have introduced one more check to handle this. Also changes are made in for loop to make it more efficient. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/8782 Change-Id: I397aa3c4548cb57e8dacbf3fbf9ebaf87c0daa80 diff --git a/sw/qa/extras/ooxmlexport/data/test76734_2K7.docx b/sw/qa/extras/ooxmlexport/data/test76734_2K7.docx new file mode 100644 index 000..5e0e114 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/test76734_2K7.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 1e1fd6d..68ef7ebb 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3041,6 +3041,14 @@ DECLARE_OOXMLEXPORT_TEST(testFDO76586, "fdo76586.docx") assertXPath(pXmlDoc, "//w:tblGrid/w:gridCol[2]", "w", "7843"); } +DECLARE_OOXMLEXPORT_TEST(test76734_2K7, "test76734_2K7.docx") +{ +xmlDocPtr pXmlDoc = parseExport("word/document.xml"); +if (!pXmlDoc) +return; +assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]", "Requires", "wps"); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 4ba7f2b..04f5d37 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -4179,10 +4179,17 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po { // The frame output is postponed to the end of the anchor paragraph bool bDuplicate = false; -for( unsigned nIndex = 0; nIndex < m_aFramesOfParagraph.size(); ++nIndex ) +const OUString& rName = rFrame.GetFrmFmt().GetName(); +unsigned nSize = m_aFramesOfParagraph.size(); +for( unsigned nIndex = 0; nIndex < nSize; ++nIndex ) { -if( rFrame.GetFrmFmt().GetName() == m_aFramesOfParagraph[nIndex].GetFrmFmt().GetName() ) -bDuplicate = true; +const OUString& rNameExisting = m_aFramesOfParagraph[nIndex].GetFrmFmt().GetName(); + +if (!rName.isEmpty() && !rNameExisting.isEmpty()) +{ +if (rName == rNameExisting) +bDuplicate = true; +} } if( !bDuplicate ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: oox/source sw/qa
oox/source/drawingml/customshapeproperties.cxx|3 ++- oox/source/export/drawingml.cxx | 20 sw/qa/extras/ooxmlexport/data/test76317.docx |binary sw/qa/extras/ooxmlexport/data/test76317_2K10.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 14 ++ 5 files changed, 28 insertions(+), 9 deletions(-) New commits: commit 35e190ba5bac01b47fbed1ea568dfb3456029d82 Author: Sourav Date: Wed Mar 19 18:01:45 2014 +0530 fdo76201:File Corruption - Issue related with prstGeom for Hexagon shape. There are two issues that are handled in this fix. 1)File created in MSO2K10 on RT gets corrupted.The root cause is found in CustomShapeProperties::pushToPropSet 2)File created in MSO2K7 on RT gets corrupted.There is an issue in shape import values for any shape (ex. circular arrow, hexagon etc).LO cannot import right values for any shape which is created in MSO-2007.Due to missing values of tag, after roundtrip the file gets corrupted.To avoid corruption a check introduced:- if(aAdjustments.size() == nLength) after http://opengrok.libreoffice.org/xref/core/oox/source/export/drawingml.cxx#1784 that will verify the number of tags associated with the shape during import and the number of tags during export.If there is a mismatch willnot be written.Changes made in DrawingML::WritePresetShape. I have written 2 test cases for the same. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/8657 Change-Id: Ibb1e2dc1c098b7399c06d7b4f59fac4e80887062 diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx index 60ef079..52fa038 100644 --- a/oox/source/drawingml/customshapeproperties.cxx +++ b/oox/source/drawingml/customshapeproperties.cxx @@ -170,6 +170,7 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentSeq; if ( aGeoPropSeq[ i ].Value >>= aAdjustmentSeq ) { +int nIndex=0; for (std::vector< CustomShapeGuide >::const_iterator aIter( maAdjustmentGuideList.begin() ), aEnd(maAdjustmentGuideList.end()); aIter != aEnd; ++aIter) { @@ -189,7 +190,7 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi aAdjustmentVal.Value <<= (*aIter).maFormula.toInt32(); aAdjustmentVal.State = PropertyState_DIRECT_VALUE; aAdjustmentVal.Name = (*aIter).maName; -aAdjustmentSeq[ 0 ] = aAdjustmentVal; +aAdjustmentSeq[ nIndex++ ] = aAdjustmentVal; } } aGeoPropSeq[ i ].Value <<= aAdjustmentSeq; diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 7d8ea84..a71ed89 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1782,19 +1782,23 @@ void DrawingML::WritePresetShape( const char* pShape, MSO_SPT eShapeType, sal_Bo EscherPropertyContainer::LookForPolarHandles( eShapeType, nAdjustmentsWhichNeedsToBeConverted ); sal_Int32 nValue, nLength = aAdjustmentSeq.getLength(); -for( sal_Int32 i=0; i < nLength; i++ ) -if( EscherPropertyContainer::GetAdjustmentValue( aAdjustmentSeq[ i ], i, nAdjustmentsWhichNeedsToBeConverted, nValue ) ) -{ -// If the document model doesn't have an adjustment name (e.g. shape was created from VML), then take it from the predefined list. -OString aAdjName; -if (aAdjustmentSeq[i].Name.isEmpty() && static_cast(i) < aAdjustments.size()) -aAdjName = aAdjustments[i]; +//aAdjustments will give info about the number of adj values for a particular geomtery.For example for hexagon aAdjustments.size() will be 2 and for circular arrow it will be 5 as per ooxDrawingMLGetAdjNames. +if(aAdjustments.size() == static_cast(nLength))// In case there is a mismatch do not write the XML_gd tag. +{ +for( sal_Int32 i=0; i < nLength; i++ ) +if( EscherPropertyContainer::GetAdjustmentValue( aAdjustmentSeq[ i ], i, nAdjustmentsWhichNeedsToBeConverted, nValue ) ) +{ +// If the document model doesn't have an adjustment name (e.g. shape was created from VML), then take it from the predefined list. +OString
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ooxmlexport/data/test76108.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx |7 +++ sw/source/filter/ww8/docxattributeoutput.cxx | 15 --- 3 files changed, 15 insertions(+), 7 deletions(-) New commits: commit d44abe1724ee5470c88f5fba5c0217fb37e2205c Author: Sourav Date: Sat Mar 15 12:48:18 2014 +0530 fdo#76108 : The RT file is getting corrupted. Description:The RT file is getting corrupted. The tag is there inside the hyperlink tag where as the is starting before the hyperlink tag.This is causing the issue. The rootcause found is in DocxAttributeOutput::EndRun(). A check is introduced before the code that writes the after the hyperlink to check if the m_startedHyperlink is false. I have added test case to verify that now the RT file is opening I also verified this change on a set of 440 real world documents (containing many combinations of MS Office features) to make sure there is no regression because of this change. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/8603 Change-Id: Ibc3ca8edcfb68d52a9394580bac1ce878eda9405 diff --git a/sw/qa/extras/ooxmlexport/data/test76108.docx b/sw/qa/extras/ooxmlexport/data/test76108.docx new file mode 100644 index 000..3476dc5 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/test76108.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index aea7db3..ed5eb96 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2854,6 +2854,13 @@ DECLARE_OOXMLEXPORT_TEST(testContentTypeXLSM, "fdo76098.docx") } +DECLARE_OOXMLEXPORT_TEST(test76108, "test76108.docx") +{ +xmlDocPtr pXmlDoc = parseExport("word/document.xml"); +if (!pXmlDoc) return; +//docx file after RT is getting corrupted. +assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/w:fldChar[1]", "fldCharType", "begin"); +} #endif diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index eab3f90..42ca6bd 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -827,13 +827,14 @@ void DocxAttributeOutput::EndRun() m_closeHyperlinkInThisRun = false; } -while ( m_Fields.begin() != m_Fields.end() ) -{ -EndField_Impl( m_Fields.front( ) ); -if (m_Fields.front().pField) -delete m_Fields.front().pField; -m_Fields.erase( m_Fields.begin( ) ); -} +if(!m_startedHyperlink) +while ( m_Fields.begin() != m_Fields.end() ) +{ +EndField_Impl( m_Fields.front( ) ); +if (m_Fields.front().pField) +delete m_Fields.front().pField; +m_Fields.erase( m_Fields.begin( ) ); +} } void DocxAttributeOutput::DoWriteBookmarks() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits