[Libreoffice-commits] core.git: 3 commits - oox/source
oox/source/drawingml/textbodycontext.cxx | 11 +++ 1 file changed, 11 insertions(+) New commits: commit e6300f83d08fd959596551dcd660eb0fbfb248a6 Author: Miklos Vajna Date: Fri May 23 09:30:26 2014 +0200 DOCX import: recurse into w:ins in groupshape text Groupshape text is provided by editeng, redlining is available in Writer text only. But still, instead of ignoring both deletions and insertions in group shape text, we could at least show the latest version correctly, i.e. ignore deletions but import insertions. Change-Id: I12df2ca1a8d27f9496a8036e521f8820d7075053 diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx index 28b56e4..69b2396 100644 --- a/oox/source/drawingml/textbodycontext.cxx +++ b/oox/source/drawingml/textbodycontext.cxx @@ -90,6 +90,13 @@ ContextHandlerRef TextParagraphContext::onCreateContext( sal_Int32 aElementToken case OOX_TOKEN( doc, sdt ): case OOX_TOKEN( doc, sdtContent ): return this; +case OOX_TOKEN( doc, del ): +break; +case OOX_TOKEN( doc, ins ): +return this; +break; +default: +SAL_WARN("oox", "TextParagraphContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken)); } return 0; commit fa017a3e503cc654b8756e1056feb1ee98225310 Author: Miklos Vajna Date: Fri May 23 09:17:01 2014 +0200 DOCX import: detect inline shape inside shape text Change-Id: Ia1614759558e73686fce137eb52fb623eae4a4e5 diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx index 1dd5a6c..28b56e4 100644 --- a/oox/source/drawingml/textbodycontext.cxx +++ b/oox/source/drawingml/textbodycontext.cxx @@ -146,6 +146,8 @@ ContextHandlerRef RegularTextRunContext::onCreateContext( sal_Int32 aElementToke case OOX_TOKEN( doc, t ): mbIsInText = true; break; +case OOX_TOKEN( doc, drawing ): +break; default: SAL_WARN("oox", "RegularTextRunContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken)); break; commit 86283cd75e798ce7fd5ca0e91ac3ea0733d31404 Author: Miklos Vajna Date: Fri May 23 08:50:50 2014 +0200 DOCX import: detect table in groupshape Change-Id: Iba7bb88139a97e919739363cd85f3e822062b694 diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx index 9821149..1dd5a6c 100644 --- a/oox/source/drawingml/textbodycontext.cxx +++ b/oox/source/drawingml/textbodycontext.cxx @@ -181,6 +181,8 @@ ContextHandlerRef TextBodyContext::onCreateContext( sal_Int32 aElementToken, con case OOX_TOKEN( doc, sdtPr ): case OOX_TOKEN( doc, sdtEndPr ): break; +case OOX_TOKEN( doc, tbl ): +break; default: SAL_WARN("oox", "TextBodyContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken)); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - oox/source
oox/source/export/vmlexport.cxx |4 ++-- oox/source/helper/propertymap.cxx |1 - 2 files changed, 2 insertions(+), 3 deletions(-) New commits: commit 78e2431d3e1aafe672a40d2ce79fbb1c48244fff Author: Markus Mohrhard Date: Fri Mar 7 22:54:50 2014 +0100 fix OOXML validation error Change-Id: I02082c04832959ae520b964ab3fd5e0b0fc34173 diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index a1e1dea..35eeae7 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -366,7 +366,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect } if ( pWrapType ) m_pSerializer->singleElementNS( XML_w10, XML_wrap, -FSNS( XML_v, XML_type ), pWrapType, +XML_type, pWrapType, FSEND ); } bAlreadyWritten[ ESCHER_Prop_WrapText ] = true; commit 60b36a7968782f44fa9351649f8cdd28ad85f40d Author: Markus Mohrhard Date: Fri Mar 7 22:15:13 2014 +0100 fix OOXML validation error, related fdo#42584 Use correct namespace for detectmouseclick Change-Id: I2830ef089ade94e69a49cb8ceba7fe91fa86817f diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index de62d73..a1e1dea 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -578,7 +578,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect } if ( rProps.GetOpt( ESCHER_Prop_fNoFillHitTest, nValue ) ) -impl_AddBool( pAttrList, XML_detectmouseclick, nValue != 0 ); +impl_AddBool( pAttrList, FSNS(XML_o, XML_detectmouseclick), nValue != 0 ); if (rProps.GetOpt(ESCHER_Prop_fillOpacity, nValue)) // Partly undo the transformation at the end of EscherPropertyContainer::CreateFillProperties(): VML opacity is 0..1. commit 2e2c4aa158bd8da84ea6d6f23bcef58e939e08de Author: Markus Mohrhard Date: Fri Mar 7 21:54:09 2014 +0100 remove remaining debug logging Change-Id: I81eb911ae6117fb557d6d5730a4d381d6fd75f4b diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx index 5e27b44..a06afd9 100644 --- a/oox/source/helper/propertymap.cxx +++ b/oox/source/helper/propertymap.cxx @@ -201,7 +201,6 @@ bool PropertyMap::setAnyProperty( sal_Int32 nPropId, const Any& rValue ) if( nPropId < 0 ) return false; -SAL_WARN_IF(sal_Int32(mpPropNames->size()) <= nPropId, "oox", "invalid PropId"); maProperties[ nPropId ] = rValue; return true; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - oox/source
oox/source/export/chartexport.cxx | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) New commits: commit 81b9d431678bc270e7592e9bedb81d2d445e2122 Author: Markus Mohrhard Date: Mon Apr 29 16:33:24 2013 +0200 c:varyColor is true by default in Excel And another step closer to opening my test file correctly in Excel. Change-Id: Ib6aa8ddb2f2792513c7263d86865e08fe5f1483d diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index d0895f3..98fff6f 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1330,6 +1330,10 @@ void ChartExport::exportScatterChart( Reference< chart2::XChartType > xChartType XML_val, scatterStyle, FSEND ); +pFS->singleElement( FSNS( XML_c, XML_varyColors ), +XML_val, "0", +FSEND ); + // FIXME: should export xVal and yVal sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y; exportSeries( xChartType, nAttachedAxis ); commit 5c19f86a077622141560bdba97e94136db9e9b40 Author: Markus Mohrhard Date: Mon Apr 29 16:13:21 2013 +0200 OSL_TRACE => SAL_WARN in chartexport.cxx Change-Id: I12ddd18c1b4476d42c097704c2af2d0af4e15a1e diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index e616922..d0895f3 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -2311,9 +2311,7 @@ void ChartExport::exportDataLabels( } catch( const uno::Exception & rEx ) { -(void)rEx; // avoid warning for pro build -OSL_TRACE( "Exception caught during Export of data label: %s", -OUStringToOString( rEx.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); +SAL_WARN("oox", "Exception caught during Export of data label: " << rEx.Message ); } if( xPropSet.is() ) commit 6ddd7fccdc8fc292200e581dbc4e456ec86cef47 Author: Markus Mohrhard Date: Mon Apr 29 16:12:33 2013 +0200 c:delete is true by default in Excel One step closer to opening my simple test file correctly in Excel. Change-Id: I1bfa76a46081ba478e44d8d90d8a91790a9a9ff3 diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index c3cf09f..e616922 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -2085,13 +2085,9 @@ void ChartExport::_exportAxis( OUString ("Visible")) >>= bVisible; } -if( !bVisible ) -{ -// other value? -pFS->singleElement( FSNS( XML_c, XML_delete ), -XML_val, "1", +pFS->singleElement( FSNS( XML_c, XML_delete ), +XML_val, bVisible ? "0" : "1", FSEND ); -} // FIXME: axPos, need to check the property "ReverseDirection" pFS->singleElement( FSNS( XML_c, XML_axPos ), ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - oox/source sd/qa
oox/source/export/drawingml.cxx | 13 + sd/qa/unit/import-tests.cxx | 21 - sd/qa/unit/sdmodeltestbase.hxx | 32 3 files changed, 57 insertions(+), 9 deletions(-) New commits: commit 08a52b17cb2e8c4c2a8c1ad7b95d2cfc5a9e844e Author: Muthu Subramanian Date: Wed Nov 13 20:54:46 2013 +0530 n#828390: Export subscript text. diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 7a75d88..3f5731b 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -697,6 +697,7 @@ void DrawingML::WriteRunProperties( Reference< XPropertySet > rRun, sal_Bool bIs const char* italic = NULL; const char* underline = NULL; sal_Int32 nSize = 1800; +sal_Int32 nCharEscapement = 0; if( GETAD( CharHeight ) ) nSize = (sal_Int32) (100*(*((float*) mAny.getValue(; @@ -777,12 +778,24 @@ void DrawingML::WriteRunProperties( Reference< XPropertySet > rRun, sal_Bool bIs usLanguage = aLanguageTag.getBcp47(); } +if( GETAD( CharEscapement ) ) +mAny >>= nCharEscapement; + +if( nCharEscapement && GETAD( CharEscapementHeight ) ) { +sal_uInt32 nCharEscapementHeight; +mAny >>= nCharEscapementHeight; +nSize = (nSize * nCharEscapementHeight) / 100; +// MSO uses default ~58% size +nSize = (nSize / 0.58); +} + mpFS->startElementNS( XML_a, XML_rPr, XML_b, bold, XML_i, italic, XML_lang, usLanguage.isEmpty() ? NULL : USS( usLanguage ), XML_sz, nSize == 1800 ? NULL : IS( nSize ), XML_u, underline, + XML_baseline, nCharEscapement == 0 ? NULL : IS( nCharEscapement*1000 ), FSEND ); // mso doesn't like text color to be placed after typeface commit 5656393f02ddd501d60673b0686688156336f0ee Author: Muthu Subramanian Date: Wed Nov 13 20:45:18 2013 +0530 Add export unit test helper to testDocumentLayout. diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 2a7de2d..6862815 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -88,16 +88,17 @@ the test, and re-running; it should break. */ void SdFiltersTest::testDocumentLayout() { -struct { const char *pInput, *pDump; } aFilesToCompare[] = +struct { const char *pInput, *pDump; sal_Int32 nExportType; } aFilesToCompare[] = { -{ "odp/shapes-test.odp", "xml/shapes-test_page" }, -{ "pptx/fdo47434-all.pptx", "pptx/xml/fdo47434_page" }, -{ "n758621.ppt", "xml/n758621_" }, -{ "fdo64586.ppt", "xml/fdo64586_" }, -{ "n819614.pptx", "xml/n819614_" }, -{ "n820786.pptx", "xml/n820786_" }, -{ "n762695.pptx", "xml/n762695_" }, -{ "n593612.pptx", "xml/n593612_" }, +{ "odp/shapes-test.odp", "xml/shapes-test_page", -1 }, +{ "pptx/fdo47434-all.pptx", "pptx/xml/fdo47434_page", -1 }, +{ "n758621.ppt", "xml/n758621_", -1 }, +{ "fdo64586.ppt", "xml/fdo64586_", -1 }, +{ "n819614.pptx", "xml/n819614_", -1 }, +{ "n820786.pptx", "xml/n820786_", -1 }, +{ "n762695.pptx", "xml/n762695_", -1 }, +{ "n593612.pptx", "xml/n593612_", -1 }, +// { "pptx/n828390.pptx", "pptx/xml/n828390_", PPTX }, // Example }; for ( int i = 0; i < static_cast< int >( SAL_N_ELEMENTS( aFilesToCompare ) ); ++i ) @@ -105,6 +106,8 @@ void SdFiltersTest::testDocumentLayout() int nUpdateMe = -1; // index of test we want to update; supposedly only when the test is created ::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc( "/sd/qa/unit/data/" ) + OUString::createFromAscii( aFilesToCompare[i].pInput ) ); +if( aFilesToCompare[i].nExportType >= 0 ) +xDocShRef = saveAndReload( xDocShRef, aFilesToCompare[i].nExportType ); compareWithShapesDump( xDocShRef, getPathFromSrc( "/sd/qa/unit/data/" ) + OUString::createFromAscii( aFilesToCompare[i].pDump ), i == nUpdateMe ); diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx index 6c05ffa..00b5892 100644 --- a/sd/qa/unit/sdmodeltestbase.hxx +++ b/sd/qa/unit/sdmodeltestbase.hxx @@ -120,10 +120,10 @@ protected: return xDocShRef; } -::sd::DrawDocShellRef saveAndReload( ::sd::DrawDocShell *pShell, sal_uLong nExportType ) +::sd::DrawDocShellRef saveAndReload( ::sd::DrawDocShell *pShell, sal_Int32 nExportType ) { FileFormat *pFmt = &aFileFormats[0]; -if( nExportType < SAL_N_ELEMENTS( aFileFormats ) ) +if( ( (sal_uInt32) nExportType ) < SAL_N_ELEMENTS( aFileFormats ) ) pFmt = &aFileFormats[ nExportType ]; OUString aExt = OUString( "." ) + OUString::createFromAscii( pFmt->pName );
[Libreoffice-commits] core.git: 3 commits - oox/source sw/qa
oox/source/export/shapes.cxx | 66 +++ sw/qa/extras/ooxmlexport/data/bezier.odt |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx |8 +++ 3 files changed, 50 insertions(+), 24 deletions(-) New commits: commit 3a45a4e80257d8737df4dda0b2d85f602196a70d Author: Miklos Vajna Date: Thu Jan 2 11:58:57 2014 +0100 oox: fix export of TextShapes in DOCX This was the last shape type that unconditionally wrote XML_sp for the shape element, which is invalid for DOCX. Change-Id: I3a6f8e6fd8ebbe663dce9ed4453396c3ec91c38a diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 59af378..67cf3dc 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -905,14 +905,20 @@ ShapeExport& ShapeExport::WriteTextShape( Reference< XShape > xShape ) { FSHelperPtr pFS = GetFS(); -pFS->startElementNS( mnXmlNamespace, XML_sp, FSEND ); +pFS->startElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp), FSEND ); // non visual shape properties -pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND ); -WriteNonVisualDrawingProperties( xShape, IDS( TextShape ) ); +if (GetDocumentType() != DOCUMENT_DOCX) +{ +pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND ); +WriteNonVisualDrawingProperties( xShape, IDS( TextShape ) ); +} pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr, XML_txBox, "1", FSEND ); -WriteNonVisualProperties( xShape ); -pFS->endElementNS( mnXmlNamespace, XML_nvSpPr ); +if (GetDocumentType() != DOCUMENT_DOCX) +{ +WriteNonVisualProperties( xShape ); +pFS->endElementNS( mnXmlNamespace, XML_nvSpPr ); +} // visual shape properties pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND ); @@ -923,7 +929,7 @@ ShapeExport& ShapeExport::WriteTextShape( Reference< XShape > xShape ) WriteTextBox( xShape, mnXmlNamespace ); -pFS->endElementNS( mnXmlNamespace, XML_sp ); +pFS->endElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp) ); return *this; } diff --git a/sw/qa/extras/ooxmlexport/data/bezier.odt b/sw/qa/extras/ooxmlexport/data/bezier.odt new file mode 100644 index 000..c73ed3e Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/bezier.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 187cf4f..54042d4 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2175,6 +2175,14 @@ DECLARE_OOXMLEXPORT_TEST(testRelorientation, "relorientation.docx") CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GroupShape"), xShapeDescriptor->getShapeType()); } +DECLARE_OOXMLEXPORT_TEST(testBezier, "bezier.odt") +{ +uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); +// Check that no shape got lost: a bezier, a line and a text shape. +CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDraws->getCount()); +} + DECLARE_OOXMLEXPORT_TEST(testTrackChangesDeletedParagraphMark, "testTrackChangesDeletedParagraphMark.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); commit affcea4185ffa95385cfb74ca68fa31361d6784b Author: Miklos Vajna Date: Thu Jan 2 11:56:39 2014 +0100 oox: fix export of LineShapes in DOCX Change-Id: I7b6f4616d450d2cffa58217db2ef250f5b8d9cba diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index a26da94..59af378 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -615,7 +615,7 @@ ShapeExport& ShapeExport::WriteLineShape( Reference< XShape > xShape ) FSHelperPtr pFS = GetFS(); -pFS->startElementNS( mnXmlNamespace, XML_sp, FSEND ); +pFS->startElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_sp : XML_wsp), FSEND ); PolyPolygon aPolyPolygon = EscherPropertyContainer::GetPolyPolygon( xShape ); if( aPolyPolygon.Count() == 1 && aPolyPolygon[ 0 ].GetSize() == 2) @@ -627,14 +627,20 @@ ShapeExport& ShapeExport::WriteLineShape( Reference< XShape > xShape ) } // non visual shape properties -pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND ); -pFS->singleElementNS( mnXmlNamespace, XML_cNvPr, - XML_id, I32S( GetNewShapeID( xShape ) ), - XML_name, IDS( Line ), - FSEND ); +if (GetDocumentType() != DOCUMENT_DOCX) +{ +pFS->startElementNS( mnXmlNamespace, XML_nvSpPr, FSEND ); +pFS->singleElementNS( mnXmlNamespace, XML_cNvPr, + XML_id, I32S( GetNewShapeID( xShape ) ), + XML_name, IDS( Line ), + FSEND ); +} pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr, FSEND ); -
[Libreoffice-commits] core.git: 3 commits - oox/source sw/qa
oox/source/export/drawingml.cxx | 14 +- oox/source/export/shapes.cxx |5 - sw/qa/extras/ooxmlexport/data/dml-textshape.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 16 4 files changed, 33 insertions(+), 2 deletions(-) New commits: commit 106c82706edc1adc2df8d39d332fd3a3452c5d78 Author: Miklos Vajna Date: Mon Jan 20 11:19:01 2014 +0100 drawingML export: write TextShape outline properties Change-Id: I3742c960016bbe1d82b58a16d464b329d2612c10 diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 37faad5..e55c2f3 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -936,6 +936,7 @@ ShapeExport& ShapeExport::WriteTextShape( Reference< XShape > xShape ) WritePresetShape( "rect" ); uno::Reference xPropertySet(xShape, UNO_QUERY); WriteFill(xPropertySet); +WriteOutline(xPropertySet); WriteBlipFill(xPropertySet, "GraphicURL"); pFS->endElementNS( mnXmlNamespace, XML_spPr ); diff --git a/sw/qa/extras/ooxmlexport/data/dml-textshape.docx b/sw/qa/extras/ooxmlexport/data/dml-textshape.docx new file mode 100644 index 000..e5be42c Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/dml-textshape.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 56d6acb..8d01930 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2469,6 +2469,22 @@ DECLARE_OOXMLEXPORT_TEST(testMsoSpt180, "mso-spt180.docx") CPPUNIT_ASSERT_EQUAL(OUString("ooxml-borderCallout1"), aType); } +DECLARE_OOXMLEXPORT_TEST(testDmlTextshape, "dml-textshape.docx") +{ +uno::Reference xGroup(getShape(1), uno::UNO_QUERY); +uno::Reference xShape(xGroup->getByIndex(1), uno::UNO_QUERY); +// This was drawing::FillStyle_NONE. +CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty(xShape, "FillStyle")); +// This was drawing::LineStyle_NONE. +CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_SOLID, getProperty(xShape, "LineStyle")); + +xmlDocPtr pXmlDocument = parseExport("word/document.xml"); +if (!pXmlDocument) +return; +// This was wrap="none". +assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:bodyPr", "wrap", "square"); +} + DECLARE_OOXMLEXPORT_TEST(testShapeThemePreservation, "shape-theme-preservation.docx") { xmlDocPtr pXmlDocument = parseExport("word/document.xml"); commit 2d4f0a7d0dd3da34d054ff444e69b10ef015e260 Author: Miklos Vajna Date: Mon Jan 20 11:16:24 2014 +0100 drawingML export: fix TextShape width for DOCX Change-Id: Ibaf29ed746076fa6ec0bad013cac26debdb2b165 diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 6c03b22..2a7d11a 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1396,8 +1396,19 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, bool bBodyPr, bool b } if (bBodyPr) +{ +const char* pWrap = bHasWrap && !bWrap ? "none" : NULL; +if (GetDocumentType() == DOCUMENT_DOCX) +{ +// In case of DOCX, if we want to have the same effect as +// TextShape's automatic word wrapping, then we need to set +// wrapping to square. +uno::Reference xServiceInfo(rXIface, uno::UNO_QUERY); +if (xServiceInfo.is() && xServiceInfo->supportsService("com.sun.star.drawing.TextShape")) +pWrap = "square"; +} mpFS->singleElementNS( (nXmlNamespace ? nXmlNamespace : XML_a), XML_bodyPr, - XML_wrap, bHasWrap && !bWrap ? "none" : NULL, + XML_wrap, pWrap, XML_lIns, (nLeft != DEFLRINS) ? IS( MM100toEMU( nLeft ) ) : NULL, XML_rIns, (nRight != DEFLRINS) ? IS( MM100toEMU( nRight ) ) : NULL, XML_tIns, (nTop != DEFTBINS) ? IS( MM100toEMU( nTop ) ) : NULL, @@ -1406,6 +1417,7 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, bool bBodyPr, bool b XML_anchorCtr, bHorizontalCenter ? "1" : NULL, XML_vert, sWritingMode, FSEND ); +} Reference< XEnumerationAccess > access( xXText, UNO_QUERY ); if( !access.is() || !bText ) commit 243ce7d73acc070194ecf5bb9f97b8a7cbf87ecd Author: Miklos Vajna Date: Mon Jan 20 10:23:29 2014 +0100 drawingML export: write TextShape fill properties Change-Id: Ibe89e86b19d7633e9a0669ff0574173ac4b633c5 diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index cdbe0d6..37faad5 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export
[Libreoffice-commits] core.git: 3 commits - oox/source sd/qa
oox/source/drawingml/table/tablecell.cxx |8 ++- oox/source/drawingml/table/tableproperties.cxx |2 sd/qa/unit/data/pptx/bnc887225.pptx|binary sd/qa/unit/import-tests.cxx| 51 + 4 files changed, 58 insertions(+), 3 deletions(-) New commits: commit 3d76a540f64f1f55f35863f18eed4b315e0d1e64 Author: Matúš Kukan Date: Tue Jul 15 14:01:01 2014 +0200 Unit test for cell properties, where lastRow is used in table (bnc#887225) Change-Id: Ia11dadcbedf6acc035b2d86da39a115bdb298591 diff --git a/sd/qa/unit/data/pptx/bnc887225.pptx b/sd/qa/unit/data/pptx/bnc887225.pptx new file mode 100755 index 000..e5c528f Binary files /dev/null and b/sd/qa/unit/data/pptx/bnc887225.pptx differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 01aade4..e8e148f 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -69,6 +70,7 @@ public: void testN862510_2(); void testN862510_4(); void testBnc870237(); +void testBnc887225(); CPPUNIT_TEST_SUITE(SdFiltersTest); CPPUNIT_TEST(testDocumentLayout); @@ -87,6 +89,7 @@ public: CPPUNIT_TEST(testN862510_2); CPPUNIT_TEST(testN862510_4); CPPUNIT_TEST(testBnc870237); +CPPUNIT_TEST(testBnc887225); CPPUNIT_TEST_SUITE_END(); }; @@ -550,6 +553,54 @@ void SdFiltersTest::testBnc870237() xDocShRef->DoClose(); } +void SdFiltersTest::testBnc887225() +{ +::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/bnc887225.pptx") ); +// In the document, lastRow and lastCol table properties are used. +// Make sure styles are set properly for individual cells. + +SdDrawDocument *pDoc = xDocShRef->GetDoc(); +CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL ); +const SdrPage *pPage = pDoc->GetPage(1); +CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL ); + +sdr::table::SdrTableObj *pTableObj = dynamic_cast(pPage->GetObj(2)); +CPPUNIT_ASSERT( pTableObj ); +uno::Reference< table::XCellRange > xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW); +uno::Reference< beans::XPropertySet > xCell; +sal_Int32 nColor; + +xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW); +xCell->getPropertyValue("FillColor") >>= nColor; +CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor); + +xCell.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW); +xCell->getPropertyValue("FillColor") >>= nColor; +CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor); + +xCell.set(xTable->getCellByPosition(1, 1), uno::UNO_QUERY_THROW); +xCell->getPropertyValue("FillColor") >>= nColor; +CPPUNIT_ASSERT_EQUAL(sal_Int32(13754095), nColor); + +xCell.set(xTable->getCellByPosition(1, 2), uno::UNO_QUERY_THROW); +xCell->getPropertyValue("FillColor") >>= nColor; +CPPUNIT_ASSERT_EQUAL(sal_Int32(15331319), nColor); + +xCell.set(xTable->getCellByPosition(1, 4), uno::UNO_QUERY_THROW); +xCell->getPropertyValue("FillColor") >>= nColor; +CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor); + +xCell.set(xTable->getCellByPosition(3, 2), uno::UNO_QUERY_THROW); +xCell->getPropertyValue("FillColor") >>= nColor; +CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor); + +xCell.set(xTable->getCellByPosition(3, 4), uno::UNO_QUERY_THROW); +xCell->getPropertyValue("FillColor") >>= nColor; +CPPUNIT_ASSERT_EQUAL(sal_Int32(6003669), nColor); + +xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest); CPPUNIT_PLUGIN_IMPLEMENT(); commit 5d2f12a44d2af3e42e0c3a17ff556f5ada27b1b8 Author: Matúš Kukan Date: Tue Jul 15 11:28:30 2014 +0200 Do not prefer bandRow over firstCol/lastCol, nor the same with bandCol. Change-Id: I0c573d721212c870e9ecc99ba5e8494073e09aaf diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx index 6862594..e91f5b8 100644 --- a/oox/source/drawingml/table/tablecell.cxx +++ b/oox/source/drawingml/table/tablecell.cxx @@ -228,7 +228,9 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo if ( rProperties.isBandRow() ) { if ( ( !rProperties.isFirstRow() || ( nRow != 0 ) ) && -( !rProperties.isLastRow() || ( nRow != nMaxRow ) ) ) +( !rProperties.isLastRow() || ( nRow != nMaxRow ) ) && +( !rProperties.isFirstCol() || ( nColumn != 0 ) ) && +( !rProperties.isLastCol() || ( nColumn != nMaxColumn ) ) ) { sal_Int32 nBand = nRow; if ( rProperties.isFirstRow() ) @@ -303,7 +305,9 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo } if ( rProperties.isBandCol() ) { -if ( ( !rProperties.isFirstCol() || ( nColumn != 0 ) ) && +if ( ( !rProperties.isFirs
[Libreoffice-commits] core.git: 3 commits - oox/source sw/qa
oox/source/drawingml/effectpropertiescontext.cxx |4 sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx |binary sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx |5 ++--- 3 files changed, 6 insertions(+), 3 deletions(-) New commits: commit 513a21aa6cf350c094289a7976de9e0cc0e7b4d4 Author: Stephan Bergmann Date: Wed Apr 23 22:52:06 2014 +0200 Revert "sw: disable failing checks" This reverts commit e7646e7e389a6a8c6481bd75127207b5090b126d. diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx index 4995a9d..cc04809 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx @@ -1097,13 +1097,12 @@ DECLARE_OOXMLEXPORT_TEST(testShapeEffectPreservation, "shape-effect-preservation assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw", "dist", "50800"); -/* FIXME why does this fail? assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr", "val", "00"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr/a:alpha", -"val", "5"); */ +"val", "5"); } #endif commit 861db4c1656956c82bf21489c0068b996bb66cac Author: Stephan Bergmann Date: Wed Apr 23 22:51:14 2014 +0200 Monkey see, monkey do? At least, it makes CppunitTest_sw_ooxmlsdrexport succeed again. Change-Id: I05b9de5366b0e3d2007311d00991758b6d6f8dba diff --git a/oox/source/drawingml/effectpropertiescontext.cxx b/oox/source/drawingml/effectpropertiescontext.cxx index 458ee59..40f7318 100644 --- a/oox/source/drawingml/effectpropertiescontext.cxx +++ b/oox/source/drawingml/effectpropertiescontext.cxx @@ -82,6 +82,10 @@ ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement, { mrEffectProperties.msUnsupportedEffectName = "innerShdw"; saveUnsupportedAttribs( rAttribs ); + +mrEffectProperties.maShadow.moShadowDist = rAttribs.getInteger( XML_dist, 0 ); +mrEffectProperties.maShadow.moShadowDir = rAttribs.getInteger( XML_dir, 0 ); +return new ColorContext( *this, mrEffectProperties.maShadow.moShadowColor ); } break; } commit 8485a276022e05bd34afb2321e72ecfad4589f7e Author: Stephan Bergmann Date: Wed Apr 23 22:50:09 2014 +0200 Change RGB "00" -> "00" to keep roundtrip test happy Change-Id: I14e48d56b6f34be31a1580d448352b925f9aadde diff --git a/sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx b/sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx index 97787eb..35c7aba 100644 Binary files a/sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx and b/sw/qa/extras/ooxmlexport/data/shape-effect-preservation.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx index 8a73e85..4995a9d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx @@ -1100,7 +1100,7 @@ DECLARE_OOXMLEXPORT_TEST(testShapeEffectPreservation, "shape-effect-preservation /* FIXME why does this fail? assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr", -"val", "00"); +"val", "00"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/mc:AlternateContent/mc:Choice/w:drawing/" "wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:effectLst/a:innerShdw/a:srgbClr/a:alpha", "val", "5"); */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - oox/source sc/source
oox/source/export/vmlexport.cxx |5 + sc/source/filter/excel/xeescher.cxx |5 - sc/source/filter/excel/xepivot.cxx | 11 ++- sc/source/filter/inc/xepivot.hxx|3 ++- 4 files changed, 17 insertions(+), 7 deletions(-) New commits: commit cd03b4ac54076b5471bf8b3154ecb6b4e7cc Author: Markus Mohrhard Date: Mon Feb 17 05:39:07 2014 +0100 fix invalid string access, related #i83611# Change-Id: I5954f78e10d99a064f83e96282c28c086c7f07f1 diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 4a9fb82..67ac325 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -691,7 +691,10 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< //Export description as alt text if( SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape( xShape ) ) { -OUString aAltTxt = pSdrObj->GetDescription().copy( 0, MSPROP_DESCRIPTION_MAX_LEN ); +OUString aAltTxt; +OUString aDescrText = pSdrObj->GetDescription(); +if(!aDescrText.isEmpty()) +aAltTxt = aDescrText.copy( 0, std::min(MSPROP_DESCRIPTION_MAX_LEN, aDescrText.getLength()) ); aPropOpt.AddOpt( ESCHER_Prop_wzDescription, aAltTxt ); } commit 8a5c8c251fe42f639b029f72244326cdc1b3bb7b Author: Markus Mohrhard Date: Sun Feb 16 22:07:20 2014 +0100 multiple pivot tables on same sheet OOXML fix (part1), related #i83250# This just fixes the generation of the pivot table file and the relationship. It crashed in a dbgutil build because we tried to overwrite the same stream for each pivot table on one sheet. Change-Id: If2c9541e38b483ead75fff32d5f6d9e16970e702 diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index e03cbf1..a0a00d6 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -1243,13 +1243,14 @@ void XclExpPTField::WriteSxvdex( XclExpStream& rStrm ) const // -XclExpPivotTable::XclExpPivotTable( const XclExpRoot& rRoot, const ScDPObject& rDPObj, const XclExpPivotCache& rPCache ) : +XclExpPivotTable::XclExpPivotTable( const XclExpRoot& rRoot, const ScDPObject& rDPObj, const XclExpPivotCache& rPCache, size_t nId ) : XclExpRoot( rRoot ), mrPCache( rPCache ), maDataOrientField( *this, EXC_SXIVD_DATA ), mnOutScTab( 0 ), mbValid( false ), -mbFilterBtn( false ) +mbFilterBtn( false ), +mnId( nId ) { const ScRange& rOutScRange = rDPObj.GetOutRange(); if( GetAddressConverter().ConvertRange( maPTInfo.maOutXclRange, rOutScRange, true ) ) @@ -1352,8 +1353,8 @@ void XclExpPivotTable::SaveXml( XclExpXmlStream& rStrm ) if( !mbValid ) return; sax_fastparser::FSHelperPtr aPivotTableDefinition = rStrm.CreateOutputStream( -XclXmlUtils::GetStreamName( "xl/", "pivotTables/pivotTable", mnOutScTab+1), -XclXmlUtils::GetStreamName( "../", "pivotTables/pivotTable", mnOutScTab+1), +XclXmlUtils::GetStreamName( "xl/", "pivotTables/pivotTable", mnId + 1), +XclXmlUtils::GetStreamName( "../", "pivotTables/pivotTable", mnId + 1), rStrm.GetCurrentStream()->getOutputStream(), "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable";); @@ -1849,7 +1850,7 @@ void XclExpPivotTableManager::CreatePivotTables() for( size_t nDPObj = 0, nCount = pDPColl->GetCount(); nDPObj < nCount; ++nDPObj ) if( ScDPObject* pDPObj = (*pDPColl)[ nDPObj ] ) if( const XclExpPivotCache* pPCache = CreatePivotCache( *pDPObj ) ) -maPTableList.AppendNewRecord( new XclExpPivotTable( GetRoot(), *pDPObj, *pPCache ) ); +maPTableList.AppendNewRecord( new XclExpPivotTable( GetRoot(), *pDPObj, *pPCache, nDPObj ) ); } XclExpRecordRef XclExpPivotTableManager::CreatePivotCachesRecord() diff --git a/sc/source/filter/inc/xepivot.hxx b/sc/source/filter/inc/xepivot.hxx index efcbbab..6f5a9a4 100644 --- a/sc/source/filter/inc/xepivot.hxx +++ b/sc/source/filter/inc/xepivot.hxx @@ -344,7 +344,7 @@ class XclExpPivotTable : public XclExpRecordBase, protected XclExpRoot { public: explicitXclExpPivotTable( const XclExpRoot& rRoot, -const ScDPObject& rDPObj, const XclExpPivotCache& rPCache ); +const ScDPObject& rDPObj, const XclExpPivotCache& rPCache, size_t nId ); /** Returns a pivot cache field. */ const XclExpPCField* GetCacheField( sal_uInt16 nCacheIdx ) const; @@ -422,6 +422,7 @@ private: SCTAB mnOutScTab; /// Sheet index of the output range. boolmbValid;
[Libreoffice-commits] core.git: 3 commits - oox/source sc/source
oox/source/export/chartexport.cxx | 63 +--- sc/source/filter/excel/xestream.cxx |2 - 2 files changed, 38 insertions(+), 27 deletions(-) New commits: commit b57bad8422c0efee8a42660806765f36746bb2fe Author: Markus Mohrhard Date: Tue Feb 18 02:23:59 2014 +0100 the string is UTF8 and not Ascii Change-Id: Ibf9a837ca5689ceae91eff2a081da3b7fe0b9244 diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 77c6295..30d774f 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -1016,7 +1016,7 @@ sax_fastparser::FSHelperPtr& XclExpXmlStream::WriteAttributesInternal( sal_Int32 rStream->write( " " ) ->writeId( nAttribute ) ->write( "=\"" ) -->writeEscaped( pValue ) +->writeEscaped( OUString(pValue, std::strlen(pValue), RTL_TEXTENCODING_UTF8) ) ->write( "\"" ); } commit 53146f93ad0697a7af8b312bfbe424c1066207a1 Author: Markus Mohrhard Date: Tue Feb 18 02:22:07 2014 +0100 prevent invalid OOXML files with trendlines, related #i88825# Change-Id: I503b24233060400cf4bbb40701bec0a3e101512a diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index b427868..7fea8e3 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -2801,6 +2801,21 @@ void ChartExport::exportTrendlines( Reference< chart2::XDataSeries > xSeries ) Reference< XPropertySet > xProperties( xRegCurve , uno::UNO_QUERY ); +OUString aService; +Reference< lang::XServiceName > xServiceName( xProperties, UNO_QUERY ); +if( !xServiceName.is() ) +continue; + +aService = xServiceName->getServiceName(); + +if(aService != "com.sun.star.chart2.LinearRegressionCurve" && +aService != "com.sun.star.chart2.ExponentialRegressionCurve" && +aService != "com.sun.star.chart2.LogarithmicRegressionCurve" && +aService != "com.sun.star.chart2.PotentialRegressionCurve" && +aService != "com.sun.star.chart2.PolynomialRegressionCurve" && +aService != "com.sun.star.chart2.MovingAverageRegressionCurve") +continue; + pFS->startElement( FSNS( XML_c, XML_trendline ), FSEND ); OUString aName; @@ -2814,12 +2829,6 @@ void ChartExport::exportTrendlines( Reference< chart2::XDataSeries > xSeries ) exportShapeProps( xProperties ); -OUString aService; -Reference< lang::XServiceName > xServiceName( xProperties, UNO_QUERY ); -if( !xServiceName.is() ) -continue; -aService = xServiceName->getServiceName(); - if( aService == "com.sun.star.chart2.LinearRegressionCurve" ) { pFS->singleElement( FSNS( XML_c, XML_trendlineType ), @@ -2871,7 +2880,9 @@ void ChartExport::exportTrendlines( Reference< chart2::XDataSeries > xSeries ) } else { -continue; +// should never happen +// This would produce invalid OOXML files so we check earlier for the type +assert(false); } double aExtrapolateForward = 0.0; commit dd0c9e64835b825771d961b7a8f21f4d6c077fc7 Author: Markus Mohrhard Date: Mon Feb 17 23:19:49 2014 +0100 fix indentation Change-Id: I36be2de793d3d32433530bf71632cb73a676bb9a diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 337d510..b427868 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1851,36 +1851,36 @@ void ChartExport::exportCandleStickSeries( { Reference< chart2::data::XDataSequence > xLabelSeq( xLabeledSeq->getLabel()); Reference< chart2::data::XDataSequence > xValueSeq( xLabeledSeq->getValues()); -{ -FSHelperPtr pFS = GetFS(); -pFS->startElement( FSNS( XML_c, XML_ser ), +{ +FSHelperPtr pFS = GetFS(); +pFS->startElement( FSNS( XML_c, XML_ser ), FSEND ); -// TODO: idx and order -// idx attribute should start from 1 and not from 0. -pFS->singleElement( FSNS( XML_c, XML_idx ), +// TODO: idx and order +// idx attribute should start from 1 and not from 0. +pFS->singleElement( FSNS( XML_c, XML_idx ), XML_val, I32S(idx+1), FSEND ); -
[Libreoffice-commits] core.git: 3 commits - oox/source sw/qa sw/source
oox/source/export/vmlexport.cxx | 14 +++- sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx | 42 ++--- sw/source/filter/ww8/docxsdrexport.cxx | 47 +--- 3 files changed, 80 insertions(+), 23 deletions(-) New commits: commit e1386e32a85eb5c6b4294a8ca3e4461b92707fc3 Author: Miklos Vajna Date: Wed Jun 18 01:20:41 2014 +0200 DocxSdrExport::writeDMLAndVMLDrawing: fix handling of inline VML shapes In general Writer supports having objects inside a TextFrame, Word does not. It turns out that Word allows having certain shapes inside other shapes, as long as they are VML-only. So do that for now: if we receive a shape when we're already inside a shape, then just export it as VML, not the usual drawingml+VML pair. Also, blacklist one more VML shape type, where the shape text is already exported inside , so no dedicated is needed. Change-Id: I5786bd6827eae9756e7c179bb2ef5a5741a91878 diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index ad24db2..490bc7b 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -971,6 +971,18 @@ bool lcl_isTextBox(const SdrObject* pSdrObject) return false; } +bool lcl_hasTextBoxContent(sal_uInt32 nShapeType) +{ +switch (nShapeType) +{ +case ESCHER_ShpInst_TextPlainText: +case ESCHER_ShpInst_TextSlantUp: +return false; +default: +return true; +} +} + OUString lcl_getAnchorIdFromGrabBag(const SdrObject* pSdrObject) { OUString aResult; @@ -1126,7 +1138,7 @@ sal_Int32 VMLExport::StartShape() // now check if we have some editeng text (not associated textbox) and we have a text exporter registered const SdrTextObj* pTxtObj = PTR_CAST(SdrTextObj, m_pSdrObject); -if (pTxtObj && m_pTextExport && m_nShapeType != ESCHER_ShpInst_TextPlainText && !IsWaterMarkShape(m_pSdrObject->GetName()) && !lcl_isTextBox(m_pSdrObject)) +if (pTxtObj && m_pTextExport && lcl_hasTextBoxContent(m_nShapeType) && !IsWaterMarkShape(m_pSdrObject->GetName()) && !lcl_isTextBox(m_pSdrObject)) { const OutlinerParaObject* pParaObj = 0; bool bOwnParaObj = false; diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx index 2fbf4a9..0d9e0ea 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx @@ -1685,9 +1685,23 @@ DECLARE_OOXMLEXPORT_TEST(testWordArtWithinDraingtool, "testWordArtWithinDraingto 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:txbx[1]/w:txbxContent[1]",1); - assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:rect[1]/v:textbox[1]/w:txbxContent[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1]",1); - assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1]",1); +uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); +if (xIndexAccess->getCount()) +{ +// TODO TextBox: remove this when TextBox is enabled by default +// This second run is a bug, should be the first ideally + 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:txbx[1]/w:txbxContent[1]",1); + assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[2]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:rect[1]/v:textbox[1]/w:txbxContent[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1]",1); + assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[3]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxContent[1]",1); +} +else +{ + assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/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]",1); + assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Fallback[1]/w:pict[1]/v:rect[1]/v:textbox[1]/w:txbxContent[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:inline[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:txbx[1]/w:txbxConte
[Libreoffice-commits] core.git: 3 commits - oox/source sw/qa sw/source
oox/source/drawingml/customshapeproperties.cxx |6 ++-- oox/source/drawingml/shape.cxx | 19 +++-- sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx| 35 +++-- sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 29 sw/source/filter/ww8/docxsdrexport.cxx |8 ++--- 5 files changed, 79 insertions(+), 18 deletions(-) New commits: commit 1393ba60b1eb43b55820f74c393da04308221d97 Author: Jacobo Aragunde Pérez Date: Mon Apr 14 18:53:34 2014 +0200 fdo#70838: fix rotation transformation in DML exporter This patch fixes an error in commit c6ff03f37a6898f50a5ca07152168fb4fe911e05. And now that fdo#75722 is fixed, I completed the existing unit test for this bug with absolute position checks. Change-Id: I76b4fa046db9b946fd23194e91686ffa4fcb5362 diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx index 5f5ecf9..674b496 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx @@ -503,16 +503,16 @@ DECLARE_OOXMLEXPORT_TEST(testFdo70838, "fdo70838.docx") aYPos[2] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[3]/mc:Choice/w:drawing/wp:anchor/wp:positionV/wp:posOffset").toInt32(); aYPos[3] = getXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[4]/mc:Choice/w:drawing/wp:anchor/wp:positionV/wp:posOffset").toInt32(); -// TODO: compare values with a reference value extracted from the original document -// depends on fdo#75722 // certain degree of error is tolerated due to rounding in unit conversions -CPPUNIT_ASSERT(abs(aXPos[0] - aXPos[1]) < 1000); -CPPUNIT_ASSERT(abs(aXPos[1] - aXPos[2]) < 1000); -CPPUNIT_ASSERT(abs(aXPos[2] - aXPos[3]) < 1000); +CPPUNIT_ASSERT(abs(1239520 - aXPos[0]) < 1000); +CPPUNIT_ASSERT(abs(1239520 - aXPos[1]) < 1000); +CPPUNIT_ASSERT(abs(1238250 - aXPos[2]) < 1000); +CPPUNIT_ASSERT(abs(1238885 - aXPos[3]) < 1000); -CPPUNIT_ASSERT(abs(aYPos[0] - aYPos[1]) < 1000); -CPPUNIT_ASSERT(abs(aYPos[1] - aYPos[2]) < 1000); -CPPUNIT_ASSERT(abs(aYPos[2] - aYPos[3]) < 1000); +CPPUNIT_ASSERT(abs(2095500 - aYPos[0]) < 1000); +CPPUNIT_ASSERT(abs(2094865 - aYPos[1]) < 1000); +CPPUNIT_ASSERT(abs(2094230 - aYPos[2]) < 1000); +CPPUNIT_ASSERT(abs(2094865 - aYPos[3]) < 1000); sal_Int32 aHSize[4], aVSize[4]; aHSize[0] = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor/wp:extent", "cx").toInt32(); @@ -586,6 +586,25 @@ DECLARE_OOXMLEXPORT_TEST(testFdo70838, "fdo70838.docx") } while( nextTokenPos != -1 ); } + +// Check shape objects + +awt::Point aPos[4]; +aPos[0] = getShape(1)->getPosition(); +aPos[1] = getShape(2)->getPosition(); +aPos[2] = getShape(3)->getPosition(); +aPos[3] = getShape(4)->getPosition(); + +// certain degree of error is tolerated due to rounding in unit conversions +CPPUNIT_ASSERT(abs(4734 - aPos[0].X) < 10); +CPPUNIT_ASSERT(abs(4734 - aPos[1].X) < 10); +CPPUNIT_ASSERT(abs(4731 - aPos[2].X) < 10); +CPPUNIT_ASSERT(abs(4733 - aPos[3].X) < 10); + +CPPUNIT_ASSERT(abs(2845 - aPos[0].Y) < 10); +CPPUNIT_ASSERT(abs(2843 - aPos[1].Y) < 10); +CPPUNIT_ASSERT(abs(2842 - aPos[2].Y) < 10); +CPPUNIT_ASSERT(abs(2843 - aPos[3].Y) < 10); } DECLARE_OOXMLEXPORT_TEST(testFdo73215, "fdo73215.docx") diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index c80cce0..a2cb109 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -85,7 +85,7 @@ OUString lclGetAnchorIdFromGrabBag(const SdrObject* pObj) return aResult; } -void lclMovePositionWithRotation(awt::Point& aPos, sal_Int64 nRotation) +void lclMovePositionWithRotation(awt::Point& aPos, const Size& rSize, sal_Int64 nRotation) { // code from ImplEESdrWriter::ImplFlipBoundingBox (filter/source/msfilter/eschesdo.cxx) // TODO: refactor @@ -104,8 +104,8 @@ void lclMovePositionWithRotation(awt::Point& aPos, sal_Int64 nRotation) double fCos = cos(fVal); double fSin = sin(fVal); -double nWidthHalf = (double) aPos.X / 2; -double nHeightHalf = (double) aPos.Y / 2; +double nWidthHalf = (double) rSize.Width() / 2; +double nHeightHalf = (double) rSize.Height() / 2; double nXDiff = fSin * nHeightHalf + fCos * nWidthHalf - nWidthHalf; double nYDiff = fSin * nWidthHalf + fCos * nHeightHalf - nHeightHalf; @@ -303,7 +303,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrmFmt* pFrmFmt, const Size& rS // SdrObjects know their layer, consider that instead of the frame format. bOpaque = pObj->GetLayer() != pFrmFmt->GetDoc()->GetHellId() && pObj->GetLayer() != pFrmFmt->GetDoc()->GetInvisibleHe
[Libreoffice-commits] core.git: 3 commits - oox/source writerfilter/source xmloff/source
oox/source/vml/vmldrawing.cxx|3 writerfilter/source/dmapper/NumberingManager.cxx | 19 writerfilter/source/dmapper/NumberingManager.hxx |4 writerfilter/source/dmapper/PropertyIds.cxx |1 writerfilter/source/dmapper/PropertyIds.hxx |1 xmloff/source/style/xmlnume.cxx | 76 +- xmloff/source/style/xmlnumi.cxx | 96 ++- 7 files changed, 75 insertions(+), 125 deletions(-) New commits: commit f13f3b42eb113ead6fcffba39e8fcfb31808627d Author: LuboÅ¡ LuÅák Date: Mon Apr 29 16:10:00 2013 +0200 place ooxml shapes properly to paragraph area (part of bnc#816583) style="position:absolute;left:0" is relative to paragraph area, not paragraph text area (which is different if it's indented). Change-Id: I12a1d2b8a68aa3fa9c65b3d469118b5334f83d7f diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx index 88282dd..8a68bd7 100644 --- a/oox/source/vml/vmldrawing.cxx +++ b/oox/source/vml/vmldrawing.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include "oox/core/xmlfilterbase.hxx" @@ -228,6 +229,8 @@ Reference< XShape > Drawing::createAndInsertXShape( const OUString& rService, xPropSet->setPropertyValue( OUString::createFromAscii( "VertOrient" ), makeAny( VertOrientation::NONE ) ); xPropSet->setPropertyValue( OUString::createFromAscii( "HoriOrientPosition" ), makeAny( rShapeRect.X ) ); xPropSet->setPropertyValue( OUString::createFromAscii( "VertOrientPosition" ), makeAny( rShapeRect.Y ) ); +xPropSet->setPropertyValue( OUString::createFromAscii( "HoriOrientRelation" ), makeAny( RelOrientation::FRAME ) ); +xPropSet->setPropertyValue( OUString::createFromAscii( "VertOrientRelation" ), makeAny( RelOrientation::FRAME ) ); } xShape->setSize( awt::Size( rShapeRect.Width, rShapeRect.Height ) ); } commit 7dfc4da808bb26d38090f8afb0d742adabe8cedf Author: LuboÅ¡ LuÅák Date: Fri Apr 26 21:30:39 2013 +0200 handle graphic bullets in .docx also when saved as Change-Id: I7225b4b024c6b7c549d0c9fbf5204df653577bec diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index 3c6019d..87ddf75 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -278,7 +278,7 @@ uno::Sequence< beans::PropertyValue > ListLevel::GetLevelProperties( ) sal_Int16 nNumberFormat = ConversionHelper::ConvertNumberingType(m_nNFC); if( m_nNFC >= 0) { -if (!m_sGraphicURL.isEmpty()) +if (!m_sGraphicURL.isEmpty() || m_sGraphicBitmap.is()) nNumberFormat = style::NumberingType::BITMAP; aNumberingProperties.push_back( MAKE_PROPVAL(PROP_NUMBERING_TYPE, nNumberFormat )); } @@ -293,6 +293,8 @@ uno::Sequence< beans::PropertyValue > ListLevel::GetLevelProperties( ) aNumberingProperties.push_back( MAKE_PROPVAL(PROP_BULLET_CHAR, m_sBulletChar.copy(0,1))); if (!m_sGraphicURL.isEmpty()) aNumberingProperties.push_back(MAKE_PROPVAL(PROP_GRAPHIC_URL, m_sGraphicURL)); +if (m_sGraphicBitmap.is()) +aNumberingProperties.push_back(MAKE_PROPVAL(PROP_GRAPHIC_BITMAP, m_sGraphicBitmap)); } aNumberingProperties.push_back( MAKE_PROPVAL( PROP_LISTTAB_STOP_POSITION, m_nTabstop ) ); @@ -931,7 +933,20 @@ void ListsManager::lcl_sprm( Sprm& rSprm ) if (xShape.is()) { uno::Reference xPropertySet(xShape, uno::UNO_QUERY); - m_pCurrentDefinition->GetCurrentLevel()->SetGraphicURL(xPropertySet->getPropertyValue("GraphicURL").get()); +uno::Reference info = xPropertySet->getPropertySetInfo(); +uno::Sequence properties = info->getProperties(); +try +{ + m_pCurrentDefinition->GetCurrentLevel()->SetGraphicURL(xPropertySet->getPropertyValue("GraphicURL").get()); +} catch(const beans::UnknownPropertyException&) +{} +try +{ +uno::Reference< graphic::XGraphic > gr; +xPropertySet->getPropertyValue("Bitmap") >>= gr; + m_pCurrentDefinition->GetCurrentLevel()->SetGraphicBitmap( gr ); +} catch(const beans::UnknownPropertyException&) +{} // Now that we saved the URL of the graphic, remove it from the document. uno::Reference xShapeComponent(xShape, uno::UNO_QUERY); diff --git a/writerfilter/source/dmapper/NumberingManager.hxx b/writerfilter/source/dmapper/NumberingManager.hxx index 2a109ff..eb23f52 100644 --- a/writerfilter/source
[Libreoffice-commits] core.git: 3 commits - oox/source rsc/source sd/source svgio/source writerfilter/source
oox/source/drawingml/shapecontext.cxx |1 - rsc/source/rscpp/cpp2.c|1 - sd/source/ui/dlg/docprev.cxx |2 +- svgio/source/svgreader/svgtools.cxx|1 - writerfilter/source/dmapper/ThemeTable.cxx |1 - 5 files changed, 1 insertion(+), 5 deletions(-) New commits: commit 839dde414f88c095237a956d2d9b97afc0d05a0d Author: Julien Nabet Date: Thu May 29 20:45:46 2014 +0200 cppcheck: consecutive return/break/... Change-Id: I171df68539fc41046b706157c04ab1e8cc1e60ca diff --git a/oox/source/drawingml/shapecontext.cxx b/oox/source/drawingml/shapecontext.cxx index bc246d2..74cc2d9 100644 --- a/oox/source/drawingml/shapecontext.cxx +++ b/oox/source/drawingml/shapecontext.cxx @@ -104,7 +104,6 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 aElementToken, const { mpShapePtr->getTextBody()->getTextProperties().moRotation = rAttribs.getInteger( XML_rot ); return 0; -break; } case XML_cNvSpPr: break; diff --git a/rsc/source/rscpp/cpp2.c b/rsc/source/rscpp/cpp2.c index 1431e15..578052c 100644 --- a/rsc/source/rscpp/cpp2.c +++ b/rsc/source/rscpp/cpp2.c @@ -278,7 +278,6 @@ nest_err: cerror("#%s must be in an #if", token); cput(c); fprintf( pCppOut, "\n" ); exit( 1 ); -break; } default: /* diff --git a/svgio/source/svgreader/svgtools.cxx b/svgio/source/svgreader/svgtools.cxx index afc6fec..8c7ba0f 100644 --- a/svgio/source/svgreader/svgtools.cxx +++ b/svgio/source/svgreader/svgtools.cxx @@ -186,7 +186,6 @@ namespace svgio } return fRetval; -break; } default: { commit c46cc5751b5af4ce180fca63f998fe7eb405f93c Author: Julien Nabet Date: Thu May 29 20:45:00 2014 +0200 cppcheck: zerodiv Change-Id: I09e1c86bdda301c11700ffe05d4a3d83b7a1104d diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx index cd015cd..4c4293c 100644 --- a/sd/source/ui/dlg/docprev.cxx +++ b/sd/source/ui/dlg/docprev.cxx @@ -87,7 +87,7 @@ void SdDocPreviewWin::CalcSizeAndPos( GDIMetaFile* pFile, Size& rSize, Point& rP long nWidth = rSize.Width() - 2*FRAME; long nHeight = rSize.Height() - 2*FRAME; if( nWidth < 0 ) nWidth = 0; -if( nHeight < 0 ) nHeight = 0; +if( nHeight < 0 ) nHeight = 1; double dRatio=((double)aTmpSize.Width())/aTmpSize.Height(); double dRatioPreV=((double) nWidth ) / nHeight; commit 1af3579ecbe3747bcb9535d026d2a34792cd9106 Author: Julien Nabet Date: Thu May 29 20:44:49 2014 +0200 cppcheck: unused variable Change-Id: If497a2bbcc13702a960f510b3daf3bf7dc12d4c7 diff --git a/writerfilter/source/dmapper/ThemeTable.cxx b/writerfilter/source/dmapper/ThemeTable.cxx index 2cc3566..7817175 100644 --- a/writerfilter/source/dmapper/ThemeTable.cxx +++ b/writerfilter/source/dmapper/ThemeTable.cxx @@ -177,7 +177,6 @@ void ThemeTable::lcl_entry(int /*pos*/, writerfilter::Reference::Poi OUString ThemeTable::getStringForTheme(const Id id) { -std::map tmpThemeFontMap; switch (id) { case NS_ooxml::LN_Value_ST_Theme_majorEastAsia: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits