[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/msfilter/msdffimp.cxx | 13 - filter/source/msfilter/svdfppt.cxx | 17 +++-- sd/qa/unit/data/ppt/tdf48083.ppt|binary sd/qa/unit/import-tests2.cxx| 16 +++- 4 files changed, 34 insertions(+), 12 deletions(-) New commits: commit a43f1ac6c964181cbaa4c889409688197cbf7a2b Author: Samuel Mehrbrodt AuthorDate: Mon Sep 4 14:54:38 2023 +0200 Commit: Samuel Mehrbrodt CommitDate: Mon Sep 4 19:44:29 2023 +0200 tdf#48083 Import mso_fillBackground from ppt Change-Id: Ic60fbc5fcfd7b38e7dd594690e5cfe784061a3d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156517 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 8d6f9023ad16..bc28e62e2b16 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -74,6 +74,7 @@ #include #include #include +#include #include #include #include @@ -1338,6 +1339,7 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co if ( nFillFlags & 0x10 ) { auto eMSO_FillType = GetPropertyValue(DFF_Prop_fillType, mso_fillSolid); +bool bUseSlideBackground = false; drawing::FillStyle eXFill = drawing::FillStyle_NONE; switch( eMSO_FillType ) { @@ -1366,7 +1368,10 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co case mso_fillShadeTitle : // special type - shade to title --- for PP eXFill = drawing::FillStyle_GRADIENT; break; -// case mso_fillBackground : // Use the background fill color/pattern +case mso_fillBackground : // Use the background fill color/pattern +eXFill = drawing::FillStyle_NONE; +bUseSlideBackground = true; +break; default: break; } rSet.Put( XFillStyleItem( eXFill ) ); @@ -1466,6 +1471,12 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co } } } +else if (eXFill == drawing::FillStyle_BITMAP && bUseSlideBackground) +{ +rSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) ); +XFillUseSlideBackgroundItem aFillBgItem(true); +rSet.Put(aFillBgItem); +} } else rSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) ); diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index fa4c9c55d7dc..a4442cfb2393 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -2930,17 +2931,13 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry* { if (!aProcessData.aBackgroundColoredObjects.empty()) { -if (!rSlidePersist.pBObj) +for (auto const & pObject : aProcessData.aBackgroundColoredObjects) { -for (auto const & pObject : aProcessData.aBackgroundColoredObjects) -{ -// The shape wants a background, but the slide doesn't have -// one: default to white. -SfxItemSet aNewSet(*pObject->GetMergedItemSet().GetPool()); - aNewSet.Put(XFillStyleItem(css::drawing::FillStyle_SOLID)); -aNewSet.Put(XFillColorItem(OUString(), COL_WHITE)); -pObject->SetMergedItemSet(aNewSet); -} +SfxItemSet aNewSet(*pObject->GetMergedItemSet().GetPool()); + aNewSet.Put(XFillStyleItem(css::drawing::FillStyle_NONE)); +XFillUseSlideBackgroundItem aFillBgItem(true); +aNewSet.Put(aFillBgItem); +pObject->SetMergedItemSet(aNewSet); } } } diff --git a/sd/qa/unit/data/ppt/tdf48083.ppt b/sd/qa/unit/data/ppt/tdf48083.ppt new file mode 100644 index ..97ca371d7a55 Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf48083.ppt differ diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 7702e27d715e..525177ba44da 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -581,7 +581,9 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf105150PPT) // This
[Libreoffice-commits] core.git: filter/source sd/qa sw/qa
filter/source/xslt/odf2xhtml/export/common/body.xsl |2 filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl |2 filter/source/xslt/odf2xhtml/export/xhtml/body.xsl | 118 ++ sd/qa/unit/HtmlExportTest.cxx | 24 ++ sd/qa/unit/data/tdf154989.odg |binary sw/qa/extras/htmlexport/xhtmlexport.cxx | 10 6 files changed, 104 insertions(+), 52 deletions(-) New commits: commit e857b12dada1468cb3bdb49ed5ea636df0b6d153 Author: Svante Schubert AuthorDate: Fri May 5 12:26:53 2023 +0200 Commit: Michael Stahl CommitDate: Mon May 8 09:42:22 2023 +0200 tdf#154989 filter: XHTML export: avoid duplicated frames Various updates on XSLT ODF2HTML triggered by TDF issue 154989 - esp. image/frame positioning by CSS position (regression from commit f680b6d74209fd78c547201b2f14c6547e55c81b) Change-Id: I4d08a67ebca7ae3808db07c828488bb9284623a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151094 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/filter/source/xslt/odf2xhtml/export/common/body.xsl b/filter/source/xslt/odf2xhtml/export/common/body.xsl index bcad3abd9ab3..8dfb78222186 100644 --- a/filter/source/xslt/odf2xhtml/export/common/body.xsl +++ b/filter/source/xslt/odf2xhtml/export/common/body.xsl @@ -81,7 +81,7 @@ - + diff --git a/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl b/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl index c81cc9a1e0be..06e22d7e2fed 100644 --- a/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl +++ b/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl @@ -23,7 +23,7 @@ - + background-color: ; diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl index fca8d9a763b7..6ad03e260d8c 100644 --- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl +++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl @@ -141,15 +141,21 @@ + - + max-width: - + +; + + +max-height: + ; @@ -253,20 +259,20 @@ - - - - + + + + - + - + - - - + + + @@ -361,11 +367,12 @@ + - + @@ -421,7 +428,7 @@ is an unbreakable whitespace to give content to the element and force a browser not to ignore the element --> - + - + @@ -695,6 +702,7 @@ + @@ -704,7 +712,10 @@ p - + +Next 'div' was a 'text:p'. + + @@ -814,17 +825,17 @@ - + - + @@ -847,7 +858,7 @@ - + @@ -922,13 +933,13 @@ - + - + @@ -972,7 +983,7 @@ - + @@ -1052,15 +1063,8 @@ + -
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/svg/presentation_engine.js | 141 --- filter/source/svg/svgexport.cxx | 12 +- filter/source/svg/svgwriter.cxx | 41 +++-- sd/qa/unit/SVGExportTests.cxx| 18 +-- 4 files changed, 86 insertions(+), 126 deletions(-) New commits: commit 7dd9790b89da12b1eeb635ee590fec04c4f20e0b Author: Marco Cecchetti AuthorDate: Mon Nov 21 16:43:34 2022 +0100 Commit: Andras Timar CommitDate: Tue Nov 22 12:15:41 2022 +0100 svg export filter: text fields not handled correctly New solution for fixing text field issues: - small text field are not substituted with the right content because the placeholder text span several lines - copy of standard text fields embedded in the default master page are not substitute with the right content. Change-Id: Ifc8773f1ba41f9d0fe6f6ef3982cb64a514fcec7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143045 Reviewed-by: Andras Timar Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143051 Tested-by: Jenkins diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index c7cef8edd87f..08fdb283d60b 100644 --- a/filter/source/svg/presentation_engine.js +++ b/filter/source/svg/presentation_engine.js @@ -4464,13 +4464,13 @@ var aOOOAttrTextAdjust = 'text-adjust'; // element class names var aClipPathGroupClassName = 'ClipPathGroup'; var aPageClassName = 'Page'; -var aSlideNumberClassName = 'Slide_Number'; -var aDateTimeClassName = 'Date/Time'; +var aSlideNumberClassName = 'PageNumber'; +var aDateTimeClassName = 'DateTime'; var aFooterClassName = 'Footer'; var aHeaderClassName = 'Header'; var aDateClassName = 'Date'; var aTimeClassName = 'Time'; -var aSlideNameClassName='SlideName'; +var aSlideNameClassName='PageName'; // Creating a namespace dictionary. var NSS = {}; @@ -4785,15 +4785,6 @@ function getRandomInt( nMax ) return Math.floor( Math.random() * nMax ); } -function isTextFieldElement( aElement ) // eslint-disable-line no-unused-vars -{ -var sClassName = aElement.getAttribute( 'class' ); -return ( sClassName === aSlideNumberClassName ) || - ( sClassName === aFooterClassName ) || - ( sClassName === aHeaderClassName ) || - ( sClassName === aDateTimeClassName ); -} - /* ** Debug Utilities ** @@ -5192,10 +5183,11 @@ initPlaceholderElements : function() for( ; i < aPlaceholderList.length; ++i ) { var aPlaceholderElem = aPlaceholderList[i]; -var sContent = aPlaceholderElem.textContent; -if( sContent === '' ) +var sClass = aPlaceholderElem.getAttribute('class'); +var sFieldType = sClass.split(' ')[1]; +if( sFieldType === aDateClassName) aPlaceholderElem.textContent = new Date().toLocaleDateString(); -else if( sContent === '' ) +else if( sFieldType === aTimeClassName ) aPlaceholderElem.textContent = new Date().toLocaleTimeString(); } }, @@ -5376,53 +5368,43 @@ getSlideAnimationsRoot : function() }; // end MetaSlide prototype -function getTextFieldType ( elem ) +function removeRedundantParagraphFromTextFieldShape( aObject ) { -var sFieldType = null; -var sClass = elem.getAttribute('class'); -if( sClass == 'TextShape' ) +var aTextElem = getElementByClassName( aObject, 'SVGTextShape' ); +if( aTextElem ) { -var aPlaceholderElement = getElementByClassName( elem, 'PlaceholderText' ); -if (aPlaceholderElement) +var aPlaceholderElement = getElementsByClassName(aTextElem, 'PlaceholderText'); +if( aPlaceholderElement ) { -var sContent = aPlaceholderElement.textContent -if (sContent === '') -sFieldType = aSlideNumberClassName; -else if (sContent === '') -sFieldType = aDateTimeClassName; -else if (sContent === '') -sFieldType = aDateClassName; -else if (sContent === '') -sFieldType = aTimeClassName; -else if (sContent === '') -sFieldType = aSlideNameClassName; -else if (sContent === '') -sFieldType = aFooterClassName; -else if (sContent === '') -sFieldType = aHeaderClassName; +var aTextParagraphSet = getElementsByClassName(aTextElem, 'TextParagraph'); +// When the text field width is too small, the placeholder text spans several lines. +// We remove all text lines but the first one which is used as a placeholder. +// This is a workaround but it should work in the majority of cases. +// A complete solution needs to support svg text wrapping. +if( aTextParagraphSet.length > 1 ) +{ +var i =
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/graphicfilter/icgm/class4.cxx | 18 -- sd/qa/unit/data/cgm/pass/ofz-ubsan-2.cgm|binary 2 files changed, 12 insertions(+), 6 deletions(-) New commits: commit 253c8adddb04529185c74aef5e5278eb71d309ab Author: Caolán McNamara AuthorDate: Mon Aug 23 17:24:14 2021 +0100 Commit: Caolán McNamara CommitDate: Tue Aug 24 09:33:18 2021 +0200 ofz: cgm Integer-overflow Change-Id: I1cb1d5612f2b0b8999fed0d6c203ab24eedd4fe8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120898 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/filter/source/graphicfilter/icgm/class4.cxx b/filter/source/graphicfilter/icgm/class4.cxx index 04b8f7c6fb63..2129a0f96bcb 100644 --- a/filter/source/graphicfilter/icgm/class4.cxx +++ b/filter/source/graphicfilter/icgm/class4.cxx @@ -543,12 +543,18 @@ void CGM::ImplDoClass4() if ( mbFigure ) { -tools::Rectangle aBoundingBox(aCenter.X - aRadius.X, aCenter.Y - aRadius.X); -aBoundingBox.SaturatingSetSize(Size(2 * aRadius.X, 2 * aRadius.X)); -tools::Polygon aPolygon( aBoundingBox, -Point( static_cast(vector[ 0 ]), static_cast(vector[ 1 ]) ), -Point( static_cast(vector[ 2 ]), static_cast(vector[ 3 ]) ), PolyStyle::Arc ); -mpOutAct->RegPolyLine( aPolygon ); +double fLeft = aCenter.X - aRadius.X; +double fTop = aCenter.Y - aRadius.X; +bUseless = useless(fLeft) || useless(fTop); +if (!bUseless) +{ +tools::Rectangle aBoundingBox(fLeft, fTop); +aBoundingBox.SaturatingSetSize(Size(2 * aRadius.X, 2 * aRadius.X)); +tools::Polygon aPolygon( aBoundingBox, +Point( static_cast(vector[ 0 ]), static_cast(vector[ 1 ]) ), +Point( static_cast(vector[ 2 ]), static_cast(vector[ 3 ]) ), PolyStyle::Arc ); +mpOutAct->RegPolyLine( aPolygon ); +} } else { diff --git a/sd/qa/unit/data/cgm/pass/ofz-ubsan-2.cgm b/sd/qa/unit/data/cgm/pass/ofz-ubsan-2.cgm new file mode 100644 index ..08692230b903 Binary files /dev/null and b/sd/qa/unit/data/cgm/pass/ofz-ubsan-2.cgm differ
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/graphicfilter/icgm/class4.cxx |3 +++ sd/qa/unit/data/cgm/pass/ofz36348-ubsan-1.cgm |binary 2 files changed, 3 insertions(+) New commits: commit 1940ffc5347768fdc4d2bba636b40d451a274f1e Author: Caolán McNamara AuthorDate: Tue Jul 27 19:54:06 2021 +0100 Commit: Caolán McNamara CommitDate: Tue Jul 27 21:58:34 2021 +0200 ofz#36348 Integer-overflow Change-Id: I7c6020e94c9ec9d002e66d0ad83426c062ebd5c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119574 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/filter/source/graphicfilter/icgm/class4.cxx b/filter/source/graphicfilter/icgm/class4.cxx index 697a466793bc..8f972ed4f1ee 100644 --- a/filter/source/graphicfilter/icgm/class4.cxx +++ b/filter/source/graphicfilter/icgm/class4.cxx @@ -397,6 +397,9 @@ void CGM::ImplDoClass4() bUseless = useless(aCenterPoint.X) || useless(aCenterPoint.Y); } +if (!bUseless) +bUseless = useless(aStartingPoint.X) || useless(aStartingPoint.Y); + if (!bUseless) { double fStartAngle = ImplGetOrientation( aCenterPoint, aStartingPoint ); diff --git a/sd/qa/unit/data/cgm/pass/ofz36348-ubsan-1.cgm b/sd/qa/unit/data/cgm/pass/ofz36348-ubsan-1.cgm new file mode 100644 index ..4b2e9cf0d8b6 Binary files /dev/null and b/sd/qa/unit/data/cgm/pass/ofz36348-ubsan-1.cgm differ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/msfilter/msdffimp.cxx|3 + sd/qa/unit/data/ppt/tdf143315-WordartWithoutBullet.ppt |binary sd/qa/unit/export-tests-ooxml3.cxx | 27 + 3 files changed, 30 insertions(+) New commits: commit 717dc8e3575a18e1e18dc446031e6db4e60a873d Author: Mike Kaganski AuthorDate: Thu Jul 15 01:14:15 2021 +0300 Commit: Mike Kaganski CommitDate: Thu Jul 15 01:24:36 2021 +0200 tdf#143315: restore the stylesheet after clearing outliner object Prior to commit c4f615b359be56e88e4fbf9aaaf30affb29d57e2, pObj passed to SvxMSDffManager::ReadObjText was not initializing its properties (no call to AttributeProperties::GetObjectItemSet() happened) until call to CreateParaObject in the end of the function. Then it finally initialized, and called applyDefaultStyleSheetFromSdrModel, which applied the obtained stylesheet to the nodes of the outliner object, and resulted in OutlinerParaObject having correct style name in its ContentInfo structures, which then went into pObj. The mentioned commit added calls to SdrTextObj::GetTextColumns* in SdrOutliner::SetTextObj, called by SdrTextObj::ImpGetDrawOutliner indirectly. These calls initialize the object properties, and the stylesheet gets applied to the SdrOutliner and its empty node early. Then the call to Outliner::Init and Outliner::Clear resulted in the node being destroyed and re-created without stylesheet info. Then in AttributeProperties::GetObjectItemSet called from CreateParaObject, re-initialization does not happen, because the item set exists. When exporting to OOXML, the missing stylesheet required to use pool default value, which led to bullet being exported. The previous behavior relied on fragile and unspecified assumption. Instead, now we call SetStyleSheet after all operations, to make sure that the stylesheet information is present in the final data. Change-Id: I14de9017e4af92a2eaf12b3a0e090b0db7fcc759 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118961 Tested-by: Mike Kaganski Reviewed-by: Mike Kaganski diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index f7176c186a77..783609c4ca24 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -3668,6 +3668,9 @@ void SvxMSDffManager::ReadObjText( const OUString& rText, SdrObject* pObj ) rOutliner.Clear(); rOutliner.SetUpdateMode( bOldUpdateMode ); pText->SetOutlinerParaObject( std::move(pNewText) ); +// tdf#143315: restore stylesheet applied to Outliner's nodes when SdrTextObj initializes +// its attributes, but removed by Outliner::Init, which calls Outliner::Clear. +pText->SetStyleSheet(pText->GetStyleSheet(), true); } //static diff --git a/sd/qa/unit/data/ppt/tdf143315-WordartWithoutBullet.ppt b/sd/qa/unit/data/ppt/tdf143315-WordartWithoutBullet.ppt new file mode 100644 index ..54111bb28a7a Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf143315-WordartWithoutBullet.ppt differ diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index f773c364f395..597783d85a70 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -119,6 +119,7 @@ public: void testTdf96061_textHighlight(); void testTdf143222_embeddedWorksheet(); void testTdf142235_TestPlaceholderTextAlignment(); +void testTdf143315(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest3); @@ -189,6 +190,7 @@ public: CPPUNIT_TEST(testTdf96061_textHighlight); CPPUNIT_TEST(testTdf143222_embeddedWorksheet); CPPUNIT_TEST(testTdf142235_TestPlaceholderTextAlignment); +CPPUNIT_TEST(testTdf143315); CPPUNIT_TEST_SUITE_END(); virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override @@ -1773,6 +1775,31 @@ void SdOOXMLExportTest3::testTdf143222_embeddedWorksheet() xDocShRef->DoClose(); } +void SdOOXMLExportTest3::testTdf143315() +{ +auto xDocShRef = loadURL( + m_directories.getURLFromSrc(u"sd/qa/unit/data/ppt/tdf143315-WordartWithoutBullet.ppt"), +PPT); + +utl::TempFile tmpfile; +xDocShRef = saveAndReload(xDocShRef.get(), PPTX, ); +xDocShRef->DoClose(); + +xmlDocUniquePtr pXml = parseExport(tmpfile, "ppt/slides/slide1.xml"); + +// Without the fix in place, whis would have failed with +// - Expected: +// - Actual : 216000 +// - In , XPath '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr' unexpected 'marL' attribute + +assertXPathNoAttribute(pXml, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr", "marL"); +assertXPathNoAttribute(pXml, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr", "indent"); +assertXPath(pXml, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr/a:buClr", 0); +assertXPath(pXml,
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/graphicfilter/icgm/class0.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit a58eb4ffd5e58822cf7e5bda5fd93d62ccc23918 Author: Caolán McNamara AuthorDate: Mon Jul 5 10:06:25 2021 +0100 Commit: Caolán McNamara CommitDate: Mon Jul 5 14:13:15 2021 +0200 ofz#35800 Timeout Change-Id: I6420e0826a2725e0964ab01b5c2117ab664ca699 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118405 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/filter/source/graphicfilter/icgm/class0.cxx b/filter/source/graphicfilter/icgm/class0.cxx index 01e1dd2977db..a31bce5d2e89 100644 --- a/filter/source/graphicfilter/icgm/class0.cxx +++ b/filter/source/graphicfilter/icgm/class0.cxx @@ -49,7 +49,7 @@ void CGM::ImplDoClass0() break; case 0x03 : /*Begin Picture*/ { -if ( mbPicture ) +if (mbPicture || mbInDefaultReplacement) mbStatus = false; else { diff --git a/sd/qa/unit/data/cgm/pass/recurse-1.cgm b/sd/qa/unit/data/cgm/fail/recurse-1.cgm similarity index 100% rename from sd/qa/unit/data/cgm/pass/recurse-1.cgm rename to sd/qa/unit/data/cgm/fail/recurse-1.cgm ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/graphicfilter/icgm/class4.cxx |7 ++- sd/qa/unit/data/cgm/fail/ofz35504-ubsan-1.cgm |binary 2 files changed, 6 insertions(+), 1 deletion(-) New commits: commit 5e865370530a71eb966d2fbfc2fdfffc34d2e1b9 Author: Caolán McNamara AuthorDate: Tue Jun 29 21:27:18 2021 +0100 Commit: Caolán McNamara CommitDate: Wed Jun 30 21:45:35 2021 +0200 ofz#35504 clamp input values in cgm filter Change-Id: I96712b8dc8f8eaad3fb8fa6710d0f07fff61b592 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118137 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/filter/source/graphicfilter/icgm/class4.cxx b/filter/source/graphicfilter/icgm/class4.cxx index 0a498426b3bc..697a466793bc 100644 --- a/filter/source/graphicfilter/icgm/class4.cxx +++ b/filter/source/graphicfilter/icgm/class4.cxx @@ -109,7 +109,12 @@ bool CGM::ImplGetEllipse( FloatPoint& rCenter, FloatPoint& rRadius, double& rAng static bool useless(double value) { -return std::isnan(value) || std::isinf(value); +if (!std::isfinite(value)) +return true; +int exp; +std::frexp(value, ); +const int maxbits = sizeof(tools::Long) * 8; +return exp > maxbits; } void CGM::ImplDoClass4() diff --git a/sd/qa/unit/data/cgm/fail/ofz35504-ubsan-1.cgm b/sd/qa/unit/data/cgm/fail/ofz35504-ubsan-1.cgm new file mode 100644 index ..07aa3db00776 Binary files /dev/null and b/sd/qa/unit/data/cgm/fail/ofz35504-ubsan-1.cgm differ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/graphicfilter/icgm/class0.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 524e2103b639831eb4b27102d4ddff3a568a1b21 Author: Caolán McNamara AuthorDate: Fri Jun 25 15:51:39 2021 +0100 Commit: Caolán McNamara CommitDate: Fri Jun 25 21:19:50 2021 +0200 ofz#30930 each picture triggers accumulating codesets seems to make more sense on EndPicture to return to the pre-StartPicture state Change-Id: I2ac2a5585f8acd5d817d083bccfd6551fb773342 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117902 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/filter/source/graphicfilter/icgm/class0.cxx b/filter/source/graphicfilter/icgm/class0.cxx index aa6152d241d0..01e1dd2977db 100644 --- a/filter/source/graphicfilter/icgm/class0.cxx +++ b/filter/source/graphicfilter/icgm/class0.cxx @@ -49,13 +49,13 @@ void CGM::ImplDoClass0() break; case 0x03 : /*Begin Picture*/ { -ImplDefaultReplacement(); -ImplSetMapMode(); if ( mbPicture ) mbStatus = false; else { *pCopyOfE = *pElement; +ImplDefaultReplacement(); +ImplSetMapMode(); mbPicture = mbFirstOutPut = true; mbFigure = false; mnAct4PostReset = 0; diff --git a/sd/qa/unit/data/cgm/fail/recurse-1.cgm b/sd/qa/unit/data/cgm/pass/recurse-1.cgm similarity index 100% rename from sd/qa/unit/data/cgm/fail/recurse-1.cgm rename to sd/qa/unit/data/cgm/pass/recurse-1.cgm ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/svg/svgexport.cxx | 184 +++- filter/source/svg/svgfilter.hxx | 13 ++ filter/source/svg/svgwriter.cxx | 12 ++ sd/qa/unit/SVGExportTests.cxx | 64 ++--- 4 files changed, 255 insertions(+), 18 deletions(-) New commits: commit 66f88211d55c138da38c75a7b2c4d1695ce28f6a Author: Marco Cecchetti AuthorDate: Tue Feb 2 14:05:46 2021 +0100 Commit: Marco Cecchetti CommitDate: Tue Mar 9 15:35:44 2021 +0100 filter: svg: export tiled background by exploiting svg:pattern element By exporting a tiled bitmap background by exploiting the element we get performance improvement when the background is made of a big number of tiles. The unit test for the tiled background case has been updated. Change-Id: I80a4eebd081d2c59ec7d9906fc9c616692f7e0fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110319 Tested-by: Jenkins CollaboraOffice Reviewed-by: Ashod Nakashian Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111844 Tested-by: Jenkins Reviewed-by: Marco Cecchetti diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 4eb56a5a9ced..3e2da0cd0cb9 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -520,6 +520,32 @@ void MetaBitmapActionGetSize( const MetaAction* pAction, Size& rSz ) OSL_FAIL( "MetaBitmapActionGetSize: passed MetaAction pointer is null." ); return; } +const MetaActionType nType = pAction->GetType(); +switch( nType ) +{ +case MetaActionType::BMPSCALE: +{ +const MetaBmpScaleAction* pA = static_cast(pAction); +rSz = pA->GetSize(); +} +break; +case MetaActionType::BMPEXSCALE: +{ +const MetaBmpExScaleAction* pA = static_cast(pAction); +rSz = pA->GetSize(); +} +break; +default: break; +} +} + +void MetaBitmapActionGetOrigSize( const MetaAction* pAction, Size& rSz ) +{ +if( !pAction ) +{ +OSL_FAIL( "MetaBitmapActionGetOrigSize: passed MetaAction pointer is null." ); +return; +} const MetaActionType nType = pAction->GetType(); MapMode aSourceMode( MapUnit::MapPixel ); @@ -546,6 +572,16 @@ void MetaBitmapActionGetSize( const MetaAction* pAction, Size& rSz ) rSz = OutputDevice::LogicToLogic( rSz, aSourceMode, aTargetMode ); } +OUString getPatternIdForTiledBackground( std::u16string_view sSlideId, BitmapChecksum nChecksum ) +{ +return OUString::Concat("bg-pattern.") + sSlideId + "." + OUString::number( nChecksum ); +} + +OUString getIdForTiledBackground( std::u16string_view sSlideId, BitmapChecksum nChecksum ) +{ +return OUString::Concat("bg-") + sSlideId + "." + OUString::number( nChecksum ); +} + } // end anonymous namespace size_t HashBitmap::operator()( const ObjectRepresentation& rObjRep ) const @@ -933,6 +969,7 @@ bool SVGFilter::implExportDocument() implExportTextEmbeddedBitmaps(); implExportBackgroundBitmaps(); mpSVGWriter->SetEmbeddedBitmapRefs( ); +implExportTiledBackground(); } // #i124608# export a given object selection, so no MasterPage export at all @@ -1513,6 +1550,77 @@ void SVGFilter::implExportBackgroundBitmaps() } } +void SVGFilter::implExportTiledBackground() +{ +if( maPatterProps.empty() ) +return; + +mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "BackgroundPatterns" ); +SvXMLElementExport aDefsContainerElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", true, true ); + +for( const auto& [ rSlideId, rData ] : maPatterProps ) +{ +auto aBitmapActionIt = maBitmapActionMap.find( rData.aBitmapChecksum ); +if( aBitmapActionIt != maBitmapActionMap.end() ) +{ +// pattern element attributes +const OUString sPatternId = getPatternIdForTiledBackground( rSlideId, rData.aBitmapChecksum ); +// +{ +// pattern element attributes +mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sPatternId ); + +mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "x", OUString::number( rData.aPos.X() ) ); +mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "y", OUString::number( rData.aPos.Y() ) ); +mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "width", OUString::number( rData.aSize.Width() ) ); +mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "height", OUString::number( rData.aSize.Height() ) ); +mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "patternUnits", "userSpaceOnUse" ); + +SvXMLElementExport aPatternElem( *mpSVGExport, XML_NAMESPACE_NONE, "pattern", true, true ); + +// use element attributes +const Size& aOrigSize =
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/svg/presentation_engine.js | 22 - filter/source/svg/svgexport.cxx | 72 +-- sd/qa/unit/SVGExportTests.cxx|2 3 files changed, 71 insertions(+), 25 deletions(-) New commits: commit fd84bce804279b881099a7c0d44136d75d015ca1 Author: Marco Cecchetti AuthorDate: Mon Jan 11 10:28:57 2021 +0100 Commit: Marco Cecchetti CommitDate: Tue Jan 26 17:56:49 2021 +0100 filter: svg: slide with a custom background are not exported correctly When a slide has a custom background, the background overlaps any master page object: text fields, shapes, ... Change-Id: Icc410617760502fa4092cfe248155b3e20906abb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109089 Tested-by: Jenkins CollaboraOffice Reviewed-by: Marco Cecchetti Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109867 Tested-by: Jenkins diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index 9bd2936a019d..48c342c88a01 100644 --- a/filter/source/svg/presentation_engine.js +++ b/filter/source/svg/presentation_engine.js @@ -359,7 +359,7 @@ function uniqueArray(src, key, sort) { * @returns {String|Undefined} prefixed */ function prefixed(obj, property) { -// tml: Have to check for obj being undefined +// tml: Have to check for obj being undefined if (obj === undefined) { return undefined; } @@ -4436,6 +4436,7 @@ var aOOOAttrSlide = 'slide'; var aOOOAttrMaster = 'master'; var aOOOAttrSlideDuration = 'slide-duration'; var aOOOAttrHasTransition = 'has-transition'; +var aOOOAttrHasCustomBackground = 'has-custom-background'; var aOOOAttrBackgroundVisibility = 'background-visibility'; var aOOOAttrMasterObjectsVisibility = 'master-objects-visibility'; var aOOOAttrPageNumberVisibility = 'page-number-visibility'; @@ -5056,10 +5057,20 @@ function MetaSlide( sMetaSlideId, aMetaDoc ) assert( this.pageElement, 'MetaSlide: page element <' + this.slideId + '> not found.' ); +// The slide custom background element and its id attribute. +this.backgroundElement = getElementByClassName( this.pageElement, 'Background' ); +if( this.backgroundElement ) +{ +this.backgroundId = this.backgroundElement.getAttribute( 'id' ); +} + // We initialize the MasterPage object that provides direct access to // the target master page element. this.masterPage = this.initMasterPage(); +// We check if the slide has a custom background which overrides the one of the targeted master page +this.bHasCustomBackground = this.initHasCustomBackground(); + // We initialize visibility properties of the target master page elements. this.nAreMasterObjectsVisible = this.initVisibilityProperty( aOOOAttrMasterObjectsVisibility, VISIBLE ); this.nIsBackgroundVisible = this.initVisibilityProperty( aOOOAttrBackgroundVisibility, VISIBLE ); @@ -5181,6 +5192,12 @@ initHasTransition : function() return ( sHasTransition === 'true' ); }, +initHasCustomBackground : function() +{ +var sHasCustomBackground = this.element.getAttributeNS( NSS['ooo'], aOOOAttrHasCustomBackground ); +return ( sHasCustomBackground === 'true' ); +}, + initVisibilityProperty : function( aVisibilityAttribute, nDefaultValue ) { var nVisibility = nDefaultValue; @@ -5660,10 +5677,11 @@ MasterPageView.prototype.createElement = function() // init the Background element if( this.aMetaSlide.nIsBackgroundVisible ) { +var nBackgroundId = this.aMetaSlide.bHasCustomBackground ? this.aMetaSlide.backgroundId : this.aMasterPage.backgroundId; this.aBackgroundElement = theDocument.createElementNS( NSS['svg'], 'use' ); this.aBackgroundElement.setAttribute( 'class', 'Background' ); setNSAttribute( 'xlink', this.aBackgroundElement, -'href', '#' + this.aMasterPage.backgroundId ); +'href', '#' + nBackgroundId ); // node linking aMasterPageViewElement.appendChild( this.aBackgroundElement ); diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index eb5da674e6c3..edac14eb186b 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include @@ -90,6 +92,7 @@ constexpr OUStringLiteral aOOOElemTextField = u"" NSPREFIX "text_field"; // ooo xml attributes for meta_slide const charaOOOAttrSlide[] = NSPREFIX "slide"; const charaOOOAttrMaster[] = NSPREFIX "master"; +const charaOOOAttrHasCustomBackground[] = NSPREFIX "has-custom-background"; const charaOOOAttrBackgroundVisibility[] = NSPREFIX "background-visibility"; const charaOOOAttrMasterObjectsVisibility[] = NSPREFIX "master-objects-visibility"; const charaOOOAttrSlideDuration[] =
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/msfilter/svdfppt.cxx | 663 ++--- 1 file changed, 335 insertions(+), 328 deletions(-) New commits: commit 413db68d95bd39d34e6a6b81a7c5c9478ced0514 Author: Caolán McNamara AuthorDate: Sat Jan 2 20:52:57 2021 + Commit: Caolán McNamara CommitDate: Sun Jan 3 13:28:30 2021 +0100 ofz#29152 short read Change-Id: I2065a728625be2c770c5f0e10d8d04bd4674986c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108603 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 7da1450799c6..77fe87758e8a 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -807,399 +807,406 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, Svx } else { -// try to load some ppt text -PPTTextObj aTextObj( rSt, static_cast(*this), rPersistEntry, ); -if ( aTextObj.Count() || aTextObj.GetOEPlaceHolderAtom() ) -{ -bool bVerticalText = false; -// and if the text object is not empty, it must be applied to pRet, the object we -// initially got from our escher import -Degree100 nTextRotationAngle(0); -if ( IsProperty( DFF_Prop_txflTextFlow ) ) +try +{ +// try to load some ppt text +PPTTextObj aTextObj( rSt, static_cast(*this), rPersistEntry, ); +if ( aTextObj.Count() || aTextObj.GetOEPlaceHolderAtom() ) { -auto eTextFlow = GetPropertyValue(DFF_Prop_txflTextFlow, 0) & 0x; -switch( eTextFlow ) +bool bVerticalText = false; +// and if the text object is not empty, it must be applied to pRet, the object we +// initially got from our escher import +Degree100 nTextRotationAngle(0); +if ( IsProperty( DFF_Prop_txflTextFlow ) ) { -case mso_txflBtoT : // Bottom to Top non-@ -nTextRotationAngle += 9000_deg100; -break; -case mso_txflTtoBA :/* #68110# */ // Top to Bottom @-font -case mso_txflTtoBN :// Top to Bottom non-@ -case mso_txflVertN :// Vertical, non-@, top to bottom -bVerticalText = !bVerticalText; // nTextRotationAngle += 27000; -break; -// case mso_txflHorzN :// Horizontal non-@, normal -// case mso_txflHorzA :// Horizontal @-font, normal -default: break; +auto eTextFlow = GetPropertyValue(DFF_Prop_txflTextFlow, 0) & 0x; +switch( eTextFlow ) +{ +case mso_txflBtoT : // Bottom to Top non-@ +nTextRotationAngle += 9000_deg100; +break; +case mso_txflTtoBA :/* #68110# */ // Top to Bottom @-font +case mso_txflTtoBN :// Top to Bottom non-@ +case mso_txflVertN :// Vertical, non-@, top to bottom +bVerticalText = !bVerticalText; // nTextRotationAngle += 27000; +break; +// case mso_txflHorzN :// Horizontal non-@, normal +// case mso_txflHorzA :// Horizontal @-font, normal +default: break; +} } -} -sal_Int32 nFontDirection = GetPropertyValue( DFF_Prop_cdirFont, mso_cdir0 ); -if ( ( nFontDirection == 1 ) || ( nFontDirection == 3 ) ) -{ -bVerticalText = !bVerticalText; -} -const bool bFail = o3tl::checked_multiply(nFontDirection, 9000, nFontDirection); -if (!bFail) -nTextRotationAngle -= Degree100(nFontDirection); -else -SAL_WARN("filter.ms", "Parsing error: bad fontdirection: " << nFontDirection); -aTextObj.SetVertical( bVerticalText ); -if ( pRet ) -{ -bool bDeleteSource = aTextObj.GetOEPlaceHolderAtom() != nullptr; -if ( bDeleteSource && dynamic_cast(pRet) == nullptr // we are not allowed to get -
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/msfilter/msdffimp.cxx | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) New commits: commit f400e883044143f999c460375a293647b4a57244 Author: Caolán McNamara AuthorDate: Fri Jan 1 19:17:30 2021 + Commit: Caolán McNamara CommitDate: Fri Jan 1 22:07:04 2021 +0100 ofz#29151 short read Change-Id: I908d19903ff0b16f5c6a87b8aa989b6a410a7b3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108563 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index bed7bdcc283d..442509617f91 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -4183,9 +4183,11 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r if( maShapeRecords.SeekToContent( rSt, DFF_msofbtUDefProp ) ) { -sal_uInt32 nBytesLeft = maShapeRecords.Current()->nRecLen; +sal_uInt32 nBytesLeft = maShapeRecords.Current()->nRecLen; while( 5 < nBytesLeft ) { +if (rSt.remainingSize() < 6) +break; sal_uInt16 nPID(0); rSt.ReadUInt16(nPID); if (!rSt.good()) @@ -4199,11 +4201,11 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r mbRotateGranientFillWithAngle = nUDData & 0x20; break; } -nBytesLeft -= 6; +nBytesLeft -= 6; } } aObjData.bShapeType = maShapeRecords.SeekToContent( rSt, DFF_msofbtSp ); -if ( aObjData.bShapeType ) +if (aObjData.bShapeType && rSt.remainingSize() >= 8) { sal_uInt32 temp; rSt.ReadUInt32( aObjData.nShapeId ) @@ -4247,7 +4249,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r } aObjData.bChildAnchor = maShapeRecords.SeekToContent( rSt, DFF_msofbtChildAnchor, SEEK_FROM_CURRENT_AND_RESTART ); -if ( aObjData.bChildAnchor ) +if (aObjData.bChildAnchor && rSt.remainingSize() >= 16) { sal_Int32 l(0), o(0), r(0), u(0); rSt.ReadInt32( l ).ReadInt32( o ).ReadInt32( r ).ReadInt32( u ); diff --git a/sd/qa/unit/data/ppt/fail/hang-19.ppt b/sd/qa/unit/data/ppt/pass/hang-19.ppt similarity index 100% rename from sd/qa/unit/data/ppt/fail/hang-19.ppt rename to sd/qa/unit/data/ppt/pass/hang-19.ppt ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/msfilter/svdfppt.cxx |4 sd/qa/unit/data/ppt/tdf126761.ppt |binary sd/qa/unit/export-tests.cxx| 23 +++ 3 files changed, 27 insertions(+) New commits: commit 2bed8af91fc2654b9ed2432f969d32d5741a529b Author: nd101 AuthorDate: Thu Aug 8 14:53:29 2019 +0800 Commit: Samuel Mehrbrodt CommitDate: Wed Aug 21 11:18:23 2019 +0200 tdf#126761 add missing underline of hyperlink when showing ppt document For ppt document opened in Impress, the familiar underline property is missing. This is to fix that. Underline property is added when ppt document is being opened and saved to exported odp document. Change-Id: I8ba02da8ffa1c8e7833645f850cddef84f0fa476 Reviewed-on: https://gerrit.libreoffice.org/77141 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index c9b2e05fd6c2..a9db1f9bfec4 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -7018,6 +7018,10 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport pCurrent->mnHylinkOrigColor = pCurrent->mpImplPPTCharPropSet->mnColor; pCurrent->mbHardHylinkOrigColor = ( ( pCurrent->mpImplPPTCharPropSet->mnAttrSet >>PPT_CharAttr_FontColor ) & 1)>0; +// add missing attribute to show underline property + pCurrent->mpImplPPTCharPropSet->mnAttrSet |= 1 << PPT_CharAttr_Underline; + pCurrent->mpImplPPTCharPropSet->mnFlags = 1 << PPT_CharAttr_Underline; + if ( pCurrent->mpFieldItem ) { pCurrent->SetColor( PPT_COLSCHEME_A_UND_HYPERLINK ); diff --git a/sd/qa/unit/data/ppt/tdf126761.ppt b/sd/qa/unit/data/ppt/tdf126761.ppt new file mode 100644 index ..186799ec5b81 Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf126761.ppt differ diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index ac99607322f5..b3ad838a21ca 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -105,6 +105,7 @@ public: void testTdf119629(); void testTdf123557(); void testTdf113822(); +void testTdf126761(); CPPUNIT_TEST_SUITE(SdExportTest); @@ -135,6 +136,7 @@ public: CPPUNIT_TEST(testTdf119629); CPPUNIT_TEST(testTdf123557); CPPUNIT_TEST(testTdf113822); +CPPUNIT_TEST(testTdf126761); CPPUNIT_TEST_SUITE_END(); @@ -1184,6 +1186,27 @@ void SdExportTest::testTdf123557() xDocShRef->DoClose(); } +void SdExportTest::testTdf126761() +{ +sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/ppt/tdf126761.ppt"), PPT); +xDocShRef = saveAndReload( xDocShRef.get(), ODP ); +uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) ); + +// Get first paragraph of the text +uno::Reference const xParagraph( getParagraphFromShape( 0, xShape ) ); + +// Get first run of the paragraph +uno::Reference xRun( getRunFromParagraph (0, xParagraph ) ); +uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW ); + +// Check character underline, to make sure it has been set correctly +sal_uInt32 nCharUnderline; +xPropSet->getPropertyValue( "CharUnderline" ) >>= nCharUnderline; +CPPUNIT_ASSERT_EQUAL( sal_uInt32(1), nCharUnderline ); + +xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: filter/source sd/qa svx/source
filter/source/msfilter/msdffimp.cxx | 29 ++- sd/qa/unit/data/ppt/tdf122899_Arc_90_to_91_clockwise.ppt |binary sd/qa/unit/import-tests.cxx | 29 +++ svx/source/customshapes/EnhancedCustomShapeGeometry.cxx |4 +- 4 files changed, 52 insertions(+), 10 deletions(-) New commits: commit b795e540e4c4d31618a16ca8456476d5651a4d01 Author: Regina Henschel AuthorDate: Fri Mar 8 19:02:13 2019 +0100 Commit: Regina Henschel CommitDate: Thu Mar 14 13:30:41 2019 +0100 tdf#122899 use unsigned integer for mso_sptArc The path coordinates were read as sal_Int16. But for a mso_sptArc shape the values are unsigned integer. I correct it for this shape type only, because I don't know, whether other places actually need sal_Int16. The change from 0xa504 to 0xa604 in the defaults means a change from 'ClockwiseArcTo' to 'ClockwiseArc' so that an implicit moveto is used, same as in VML command 'wr'. Change-Id: Ib9c594c15d5a97048595efd644a4a6e8774fcefd Reviewed-on: https://gerrit.libreoffice.org/68941 Tested-by: Jenkins Reviewed-by: Regina Henschel diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index edf85fe7cbaa..c7a974008f4b 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -2169,12 +2169,25 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt } else { -sal_Int16 nTmpA(0), nTmpB(0); -rIn.ReadInt16( nTmpA ) - .ReadInt16( nTmpB ); - -nX = nTmpA; -nY = nTmpB; +// The mso-spt19 (arc) uses this. But it needs unsigned integer. I don't +// know if other shape types also need it. They can be added as necessary. +bool bNeedsUnsigned = rObjData.eShapeType == mso_sptArc; +if (bNeedsUnsigned) +{ +sal_uInt16 nTmpA(0), nTmpB(0); +rIn.ReadUInt16(nTmpA) + .ReadUInt16(nTmpB); +nX = nTmpA; +nY = nTmpB; +} +else +{ +sal_Int16 nTmpA(0), nTmpB(0); +rIn.ReadInt16( nTmpA ) + .ReadInt16( nTmpB ); +nX = nTmpA; +nY = nTmpB; +} } EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aCoordinates[ i ].First, nX ); EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aCoordinates[ i ].Second, nY ); @@ -4528,8 +4541,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r sal_Int32 nX = 0, nY = 0; seqCoordinates[ nPtNum ].First.Value >>= nX; seqCoordinates[ nPtNum ].Second.Value >>= nY; -aP.setX( nX ); -aP.setY( nY ); +aP.setX(nX); +aP.setY(nY); aXP[ static_cast(nPtNum) ] = aP; } aPolyBoundRect = aXP.GetBoundRect(); diff --git a/sd/qa/unit/data/ppt/tdf122899_Arc_90_to_91_clockwise.ppt b/sd/qa/unit/data/ppt/tdf122899_Arc_90_to_91_clockwise.ppt new file mode 100644 index ..9df17e9a8085 Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf122899_Arc_90_to_91_clockwise.ppt differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 58eb86f3a9fa..ef62c5bfecdc 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -195,6 +196,7 @@ public: void testDescriptionImport(); void testTdf83247(); void testTdf47365(); +void testTdf122899(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -282,6 +284,7 @@ public: CPPUNIT_TEST(testDescriptionImport); CPPUNIT_TEST(testTdf83247); CPPUNIT_TEST(testTdf47365); +CPPUNIT_TEST(testTdf122899); CPPUNIT_TEST_SUITE_END(); }; @@ -2696,6 +2699,32 @@ void SdImportTest::testTdf47365() xDocShRef->DoClose(); } +void SdImportTest::testTdf122899() +{ +// tdf122899 FILEOPEN: ppt: old kind arc from MS Office 97 is broken +// Error was, that the path coordinates of a mso_sptArc shape were read as sal_Int16 +// although they are unsigned 16 bit. This leads to wrong positions of start and
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/graphicfilter/icgm/actimpr.cxx |7 --- sd/qa/unit/data/cgm/pass/ofz9707-slow-1.cgm |binary 2 files changed, 4 insertions(+), 3 deletions(-) New commits: commit fdc91f7493171ae600ecb293ad380df5fa77a277 Author: Caolán McNamara AuthorDate: Mon Jan 21 10:23:40 2019 + Commit: Caolán McNamara CommitDate: Mon Jan 21 12:35:45 2019 +0100 ofz#9707 avoid timeout on excessive EndGroups without matching BeginGroups Change-Id: I6b660ba86ba639935da509623f1041b6fc1debc0 Reviewed-on: https://gerrit.libreoffice.org/9 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx index 4d09031925ef..3415656a35f3 100644 --- a/filter/source/graphicfilter/icgm/actimpr.cxx +++ b/filter/source/graphicfilter/icgm/actimpr.cxx @@ -395,14 +395,15 @@ void CGMImpressOutAct::BeginGroup() { maGroupLevel[mnGroupLevel] = maXShapes->getCount(); } -mnGroupLevel++; +++mnGroupLevel; mnGroupActCount = mpCGM->mnActCount; } void CGMImpressOutAct::EndGroup() { -if ( mnGroupLevel ) // preserve overflow -mnGroupLevel--; +if (!mnGroupLevel) +return; +--mnGroupLevel; if ( mnGroupLevel < CGM_OUTACT_MAX_GROUP_LEVEL ) { sal_uInt32 nFirstIndex = maGroupLevel[mnGroupLevel]; diff --git a/sd/qa/unit/data/cgm/pass/ofz9707-slow-1.cgm b/sd/qa/unit/data/cgm/pass/ofz9707-slow-1.cgm new file mode 100644 index ..9695f9bbabce Binary files /dev/null and b/sd/qa/unit/data/cgm/pass/ofz9707-slow-1.cgm differ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/msfilter/msdffimp.cxx |3 +++ sd/qa/unit/data/ppt/crop.ppt|binary sd/qa/unit/import-tests.cxx | 21 + 3 files changed, 24 insertions(+) New commits: commit 11d542352e1088a2c870b0e73e14e10266276483 Author: Miklos Vajna Date: Fri Jun 8 09:27:32 2018 +0200 tdf#118037 PPT import: fix lost crop of graphic Regression from commit b11188835d3b87cd9d2a8cdb3da204cfda5d3e6e (DOC import: lazy-read images, 2018-04-20). Change-Id: Ie2155c971d94153352a9372a9795cbb9d820dd40 Reviewed-on: https://gerrit.libreoffice.org/55452 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 2e6843eb2d61..7d7e5e385390 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -3719,6 +3719,9 @@ static void lcl_ApplyCropping( const DffPropSet& rPropSet, SfxItemSet* pSet, Gra BitmapExaCropBitmap; sal_uInt32 nTop( 0 ), nBottom( 0 ), nLeft( 0 ), nRight( 0 ); +// Cropping has to be applied on a loaded graphic. +rGraf.makeAvailable(); + if ( pSet ) // use crop attributes ? aCropSize = lcl_GetPrefSize(rGraf, MapMode(MapUnit::Map100thMM)); else diff --git a/sd/qa/unit/data/ppt/crop.ppt b/sd/qa/unit/data/ppt/crop.ppt new file mode 100644 index ..844a4392a1d4 Binary files /dev/null and b/sd/qa/unit/data/ppt/crop.ppt differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 9e07f8be4774..39f7f6df766e 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -75,6 +75,7 @@ #include #include #include +#include #include #include @@ -187,6 +188,7 @@ public: bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, std::vector& rExpected); void testPatternImport(); +void testPptCrop(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -268,6 +270,7 @@ public: CPPUNIT_TEST(testTdf116899); CPPUNIT_TEST(testTdf77747); CPPUNIT_TEST(testTdf116266); +CPPUNIT_TEST(testPptCrop); CPPUNIT_TEST_SUITE_END(); }; @@ -634,6 +637,24 @@ void SdImportTest::testFdo68594() xDocShRef->DoClose(); } +void SdImportTest::testPptCrop() +{ +sd::DrawDocShellRef xDocShRef += loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/ppt/crop.ppt"), PPT); + +uno::Reference xPropertySet( +getShapeFromPage(/*nShape=*/1, /*nPage=*/0, xDocShRef)); +text::GraphicCrop aCrop; +xPropertySet->getPropertyValue("GraphicCrop") >>= aCrop; +// These were all 0, lazy-loading broke cropping. +CPPUNIT_ASSERT_GREATER(static_cast(0), aCrop.Top); +CPPUNIT_ASSERT_GREATER(static_cast(0), aCrop.Bottom); +CPPUNIT_ASSERT_GREATER(static_cast(0), aCrop.Left); +CPPUNIT_ASSERT_GREATER(static_cast(0), aCrop.Right); + +xDocShRef->DoClose(); +} + void SdImportTest::testFdo72998() { sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/cshapes.pptx"), PPTX); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/graphicfilter/icgm/actimpr.cxx |6 ++ filter/source/graphicfilter/icgm/class4.cxx | 14 ++ filter/source/graphicfilter/icgm/outact.hxx |2 +- sd/qa/unit/data/cgm/pass/binary_corvette.cgm |binary 4 files changed, 9 insertions(+), 13 deletions(-) New commits: commit fa060cd34421b857c2f30301eaae86da125c0b67 Author: Caolán McNamaraDate: Mon Apr 16 10:16:56 2018 +0100 Resolves: tdf#116999 fix reading cgm text at record bounds Change-Id: Ibbff7b0a3c3447135e0f6c585914dc6018e51765 Reviewed-on: https://gerrit.libreoffice.org/52951 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx index fc701f64f570..c685ce513269 100644 --- a/filter/source/graphicfilter/icgm/actimpr.cxx +++ b/filter/source/graphicfilter/icgm/actimpr.cxx @@ -713,7 +713,7 @@ void CGMImpressOutAct::DrawPolyPolygon( tools::PolyPolygon const & rPolyPolygon } } -void CGMImpressOutAct::DrawText( awt::Point const & rTextPos, awt::Size const & rTextSize, char const * pString, FinalFlag eFlag ) +void CGMImpressOutAct::DrawText(awt::Point const & rTextPos, awt::Size const & rTextSize, const OUString& rString, FinalFlag eFlag) { if ( ImplCreateShape( "com.sun.star.drawing.TextShape" ) ) { @@ -803,8 +803,6 @@ void CGMImpressOutAct::DrawText( awt::Point const & rTextPos, awt::Size const & uno::Any aFirstQuery( maXShape->queryInterface( cppu::UnoType::get())); if( aFirstQuery >>= xText ) { -OUString aStr(pString, strlen(pString), RTL_TEXTENCODING_ASCII_US); - uno::Reference< text::XTextCursor > aXTextCursor( xText->createTextCursor() ); { aXTextCursor->gotoEnd( false ); @@ -840,7 +838,7 @@ void CGMImpressOutAct::DrawText( awt::Point const & rTextPos, awt::Size const & aAny <<= true; maXPropSet->setPropertyValue( "TextFitToSize", aAny ); } -aCursorText->setString( aStr ); +aCursorText->setString(rString); aXTextCursor->gotoEnd( true ); ImplSetTextBundle( aCursorPropSet ); } diff --git a/filter/source/graphicfilter/icgm/class4.cxx b/filter/source/graphicfilter/icgm/class4.cxx index 4db70a8acbc5..a7779ab23d49 100644 --- a/filter/source/graphicfilter/icgm/class4.cxx +++ b/filter/source/graphicfilter/icgm/class4.cxx @@ -184,15 +184,14 @@ void CGM::ImplDoClass4() sal_uInt32 nType = ImplGetUI16(); sal_uInt32 nSize = ImplGetUI( 1 ); -if (static_cast(mpEndValidSource - (mpSource + mnParaSize)) <= nSize) +if (static_cast(mpEndValidSource - (mpSource + mnParaSize)) < nSize) throw css::uno::Exception("attempt to read past end of input", nullptr); -mpSource[mnParaSize + nSize] = 0; +OUString aStr(reinterpret_cast (mpSource) + mnParaSize, nSize, RTL_TEXTENCODING_ASCII_US); awt::Size aSize; awt::Point aPoint( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ); -mpOutAct->DrawText( aPoint, aSize, -reinterpret_cast (mpSource) + mnParaSize, static_cast(nType) ); +mpOutAct->DrawText(aPoint, aSize, aStr, static_cast(nType)); mnParaSize = mnElementSize; } break; @@ -222,15 +221,14 @@ void CGM::ImplDoClass4() sal_uInt32 nType = ImplGetUI16(); sal_uInt32 nSize = ImplGetUI(1); -if (static_cast(mpEndValidSource - (mpSource + mnParaSize)) <= nSize) +if (static_cast(mpEndValidSource - (mpSource + mnParaSize)) < nSize) throw css::uno::Exception("attempt to read past end of input", nullptr); -mpSource[ mnParaSize + nSize ] = 0; +OUString aStr(reinterpret_cast (mpSource) + mnParaSize, nSize, RTL_TEXTENCODING_ASCII_US); awt::Point aPoint( static_cast(aFloatPoint.X), static_cast(aFloatPoint.Y) ); awt::Size aSize(static_cast(dx), static_cast(dy)); -mpOutAct->DrawText( aPoint, aSize , -reinterpret_cast (mpSource) + mnParaSize, static_cast(nType) ); +mpOutAct->DrawText(aPoint, aSize , aStr, static_cast(nType)); mnParaSize = mnElementSize; } break; diff --git a/filter/source/graphicfilter/icgm/outact.hxx b/filter/source/graphicfilter/icgm/outact.hxx index 4ec1090e5185..a31d42c4560a 100644 ---
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/msfilter/svdfppt.cxx |6 ++ sd/qa/unit/data/ppt/tdf77747.ppt |binary sd/qa/unit/import-tests.cxx| 17 + 3 files changed, 23 insertions(+) New commits: commit 3b17a8ebad5251d7908cf1d992c8b76b88557578 Author: Mark HungDate: Sun Apr 1 21:32:07 2018 +0800 tdf#77747 handle Hebrew numbering in ppt. Change-Id: I4af60a701e4dc2c3bae1c223ec56e03c16210996 Reviewed-on: https://gerrit.libreoffice.org/52225 Tested-by: Jenkins Reviewed-by: Mark Hung diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 9817e93e4b22..22d21cb1a74e 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -3592,6 +3592,12 @@ bool PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport const & rNumberFormat.SetSuffix( "." ); } break; +case 25: // Bidi Hebrew 2 with ANSI minus symbol. +{ +rNumberFormat.SetNumberingType( SVX_NUM_NUMBER_HEBREW ); +rNumberFormat.SetSuffix( "-" ); +} +break; case 26: // Japanese/Korean. { rNumberFormat.SetNumberingType( SVX_NUM_NUMBER_LOWER_ZH ); diff --git a/sd/qa/unit/data/ppt/tdf77747.ppt b/sd/qa/unit/data/ppt/tdf77747.ppt new file mode 100755 index ..e011be717a7d Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf77747.ppt differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 8e4cc6798b54..33c2e47e49f7 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -180,6 +180,7 @@ public: void testTdf115394PPT(); void testTdf51340(); void testTdf115639(); +void testTdf77747(); bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, std::vector& rExpected); void testPatternImport(); @@ -261,6 +262,7 @@ public: CPPUNIT_TEST(testTdf115394PPT); CPPUNIT_TEST(testTdf51340); CPPUNIT_TEST(testTdf115639); +CPPUNIT_TEST(testTdf77747); CPPUNIT_TEST_SUITE_END(); }; @@ -2516,6 +2518,21 @@ void SdImportTest::testTdf115639() } } +void SdImportTest::testTdf77747() +{ +sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/ppt/tdf77747.ppt"), PPT); +CPPUNIT_ASSERT(xDocShRef.is()); +SdrTextObj *pTxtObj = dynamic_cast(GetPage(1, xDocShRef)->GetObj(0)); +CPPUNIT_ASSERT_MESSAGE("No text object", pTxtObj != nullptr); +const SvxNumBulletItem *pNumFmt = pTxtObj->GetOutlinerParaObject()->GetTextObject().GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET); +CPPUNIT_ASSERT(pNumFmt); +CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's suffix is wrong!", pNumFmt->GetNumRule()->GetLevel(0).GetSuffix(), OUString("-") ); +CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's numbering type is wrong!", pNumFmt->GetNumRule()->GetLevel(0).GetNumberingType(), +SVX_NUM_NUMBER_HEBREW); + +xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: filter/source sd/qa svx/source xmloff/inc xmloff/source
filter/source/msfilter/escherex.cxx |3 sd/qa/unit/data/fit-to-size.fodp| 724 sd/qa/unit/export-tests.cxx | 101 ++ svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |5 svx/source/toolbars/fontworkbar.cxx | 10 xmloff/inc/xmlsdtypes.hxx |1 xmloff/source/draw/sdpropls.cxx | 67 + 7 files changed, 900 insertions(+), 11 deletions(-) New commits: commit 33eb9fdb61033b3fd35d923900b1f5791f4b71c8 Author: Michael StahlDate: Tue Oct 17 17:24:03 2017 +0200 tdf#97630 xmloff: ODF extended draw:fit-to-size mess The plan: 1. As Regina points out, there is already (in ODF 1.2, but not ODF 1.1) a style:shrink-to-fit attribute for shapes, so use this to represent the AUTOFIT value. The fallback from AUTOFIT to draw:fit-to-size="true" was a stupid idea anyway, probably "false" is less annoying in practice. There are 2 different shapes that implement TextFitToSize property: a) text shapes already interpret ALLLINES and PROPORTIONAL exactly the same b) fontwork custom shapes interpret ALLLINES but do nothing for PROPORTIONAL As Regina points out, there is no shape that needs to distinguish between ALLLINES and PROPORTIONAL, so we do a minor behavioral API CHANGE and from now on interpret PROPORTIONAL as ALLLINES on fontwork custom shapes. This obviates the need to distinguish the values in ODF and so we don't need a new attribute, just use draw:fit-to-size="true" for both. On import, use MID_FLAG_MERGE_PROPERTY to combine the 2 attributes into one value. 2. Restrict the export of draw:fit-to-size to only the standard values "true"/"false". This implements step 1, the step 2 will be done in the future when most users have the import of the style:shrink-to-fit. Change-Id: I4a378aa110fdb82db7a99a839d7ff207248a73e7 Reviewed-on: https://gerrit.libreoffice.org/43521 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 7e5e3e1460df..ee7dfe17b36b 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -3450,7 +3450,8 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT { drawing::TextFitToSizeType const eFTS( static_cast(pCustoShape->GetMergedItem( SDRATTR_TEXT_FITTOSIZE )).GetValue() ); -if (eFTS == drawing::TextFitToSizeType_ALLLINES) +if (eFTS == drawing::TextFitToSizeType_ALLLINES || +eFTS == drawing::TextFitToSizeType_PROPORTIONAL) { gTextAlign = mso_alignTextStretch; } diff --git a/sd/qa/unit/data/fit-to-size.fodp b/sd/qa/unit/data/fit-to-size.fodp new file mode 100644 index ..734cf8a3a6c6 --- /dev/null +++ b/sd/qa/unit/data/fit-to-size.fodp @@ -0,0 +1,724 @@ + +http://www.w3.org/1999/xlink; xmlns:dc="http://purl.org/dc/elements/1.1/; xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML; xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:scr ipt="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office; xmlns:ooow="http://openoffice.org/2004/writer; xmlns:oooc="http://openoffice.org/2004/calc; xmlns:dom="http://www.w3.org/2001/xml-events; xmlns:xforms="http://www.w3.org/2002/xforms; xmlns:xsd="http://www.w3.org/2001/XMLSchema; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xmlns:rpt="http://openoffice.org/2005/report; xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml; xmlns:grddl="http://www.w3.org/2003/g/data-view#; xmlns:officeooo="http://openoffice.org/2009/office;
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/graphicfilter/icgm/cgm.cxx | 13 - filter/source/graphicfilter/icgm/cgm.hxx |3 ++- sd/qa/unit/data/cgm/fail/recurse-1.cgm |binary 3 files changed, 14 insertions(+), 2 deletions(-) New commits: commit 4d66989d1ebac53ff8b2af7d17642e3ab688a317 Author: Caolán McNamaraDate: Sun Apr 9 18:51:31 2017 +0100 ofz#1078 cgm infinite recurse Change-Id: I6ba4c6a432f1dd150591f8d9b0f03e248a97c33e diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx index 714c4d73757e..d3669fe703d3 100644 --- a/filter/source/graphicfilter/icgm/cgm.cxx +++ b/filter/source/graphicfilter/icgm/cgm.cxx @@ -51,6 +51,7 @@ CGM::CGM(uno::Reference< frame::XModel > const & rModel) , mbPictureBody(false) , mbFigure(false) , mbFirstOutPut(false) +, mbInDefaultReplacement(false) , mnAct4PostReset(0) , mpBitmapInUse(nullptr) , mpChart(nullptr) @@ -620,8 +621,16 @@ void CGM::ImplDoClass() void CGM::ImplDefaultReplacement() { -if ( !maDefRepList.empty() ) +if (!maDefRepList.empty()) { +if (mbInDefaultReplacement) +{ +SAL_WARN("filter", "recursion in ImplDefaultReplacement"); +return; +} + +mbInDefaultReplacement = true; + sal_uInt32 nOldEscape = mnEscape; sal_uInt32 nOldElementClass = mnElementClass; sal_uInt32 nOldElementID = mnElementID; @@ -663,6 +672,8 @@ void CGM::ImplDefaultReplacement() mnParaSize = mnElementSize = nOldElementSize; mpSource = pOldBuf; mpEndValidSource = pOldEndValidSource; + +mbInDefaultReplacement = false; } } diff --git a/filter/source/graphicfilter/icgm/cgm.hxx b/filter/source/graphicfilter/icgm/cgm.hxx index 4da49ea302de..a7c5d04d9d6d 100644 --- a/filter/source/graphicfilter/icgm/cgm.hxx +++ b/filter/source/graphicfilter/icgm/cgm.hxx @@ -64,7 +64,8 @@ class CGM boolmbPictureBody; boolmbFigure; boolmbFirstOutPut; -sal_uInt32 mnAct4PostReset; +boolmbInDefaultReplacement; +sal_uInt32 mnAct4PostReset; CGMBitmap* mpBitmapInUse; CGMChart* mpChart;// if sal_True->"SHWSLIDEREC" // otherwise "BEGINPIC" commands diff --git a/sd/qa/unit/data/cgm/fail/recurse-1.cgm b/sd/qa/unit/data/cgm/fail/recurse-1.cgm new file mode 100644 index ..4ba3b95de4b0 Binary files /dev/null and b/sd/qa/unit/data/cgm/fail/recurse-1.cgm differ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/msfilter/svdfppt.cxx | 21 + sd/qa/unit/data/ppt/tdf105150.ppt |binary sd/qa/unit/import-tests.cxx| 14 ++ 3 files changed, 35 insertions(+) New commits: commit b9648deb1d99cde1c085767433242d6e1b834e2d Author: Miklos VajnaDate: Fri Jan 6 17:44:11 2017 +0100 Related: tdf#105150 PPT import: handle mso_fillBackground fill type of shapes Equivalent OOXML markup is . For now only handle the case when the slide doesn't have an explicit background, and assume that in that case we can default to white solid fill. This partially restores the code removed in 6137b5f72f5ec491ea6bd6631a65484fa24d2973 (coverity#735432 Logically dead code, 2014-03-25), so that ProcessData::aBackgroundColoredObjects is actually read. Change-Id: I9e7a9a41965db50638e9d9d1b2361af9fd7a98ca diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index b5e8a53..2fab16a 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -2898,6 +2898,27 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry* break; } +// Handle shapes where the fill matches the background +// fill (mso_fillBackground). +if (rSlidePersist.ePageKind == PPT_SLIDEPAGE) +{ +if (!aProcessData.aBackgroundColoredObjects.empty()) +{ +if (!rSlidePersist.pBObj) +{ +for (auto pObject : aProcessData.aBackgroundColoredObjects) +{ +// The shape wants a background, but the slide doesn't have +// one: default to white. +SfxItemSet aNewSet(*pObject->GetMergedItemSet().GetPool()); + aNewSet.Put(XFillStyleItem(css::drawing::FillStyle_SOLID)); +aNewSet.Put(XFillColorItem(OUString(), Color(COL_WHITE))); +pObject->SetMergedItemSet(aNewSet); +} +} +} +} + if ( rSlidePersist.pBObj ) { // #i99386# transfer the attributes from the temporary BackgroundObject diff --git a/sd/qa/unit/data/ppt/tdf105150.ppt b/sd/qa/unit/data/ppt/tdf105150.ppt new file mode 100644 index 000..c832371 Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf105150.ppt differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index eb56ffb..dd5f2e0 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -135,6 +135,7 @@ public: void testTdf103477(); void testTdf104445(); void testTdf105150(); +void testTdf105150PPT(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -194,6 +195,7 @@ public: CPPUNIT_TEST(testTdf103477); CPPUNIT_TEST(testTdf104445); CPPUNIT_TEST(testTdf105150); +CPPUNIT_TEST(testTdf105150PPT); CPPUNIT_TEST_SUITE_END(); }; @@ -1655,6 +1657,18 @@ void SdImportTest::testTdf105150() xDocShRef->DoClose(); } +void SdImportTest::testTdf105150PPT() +{ +sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/ppt/tdf105150.ppt"), PPT); +const SdrPage* pPage = GetPage(1, xDocShRef); +const SdrObject* pObj = pPage->GetObj(1); +// This was drawing::FillStyle_NONE, the shape's mso_fillBackground was +// ignored when the slide didn't have an explicit background fill. +auto& rFillStyleItem = dynamic_cast(pObj->GetMergedItem(XATTR_FILLSTYLE)); +CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, rFillStyleItem.GetValue()); +xDocShRef->DoClose(); +} + void SdImportTest::testTdf104445() { // Extra bullets were added to the first shape ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/svg/presentation_engine.js | 35 +-- filter/source/svg/svgexport.cxx | 33 +++-- sd/qa/unit/SVGExportTests.cxx| 18 +++ 3 files changed, 60 insertions(+), 26 deletions(-) New commits: commit 7dd73ab0ce7d446b604936942937123adf3ea782 Author: Marco CecchettiDate: Mon Dec 14 14:21:45 2015 +0100 svg export: transition not displayed when switching from last to first slide Some transition, such as those involving clipping, is not displayed when switching from last to first slide. That is due to the fact that the leaving slide (the last one) is over the entering slide (the first one). The issue has been solved by hiding the last slide and placing a view to it (svg:use) behind the first slide. The text decoration unit test has been modified. Change-Id: Iac1d23a1b9834c301b8ae511ea3f81397e5a4229 Reviewed-on: https://gerrit.libreoffice.org/20705 Tested-by: Jenkins Reviewed-by: Marco Cecchetti diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index c1e4645..83b979f 100644 --- a/filter/source/svg/presentation_engine.js +++ b/filter/source/svg/presentation_engine.js @@ -1218,7 +1218,7 @@ function MetaDocument() this.aMasterPageSet = new Object(); this.aTextFieldHandlerSet = new Object(); this.aTextFieldContentProviderSet = new Array(); -this.aSlideNumberProvider = new SlideNumberProvider( this.nStartSlideNumber + 1, this.sPageNumberingType ); +this.aSlideNumberProvider = new SlideNumberProvider( this.nStartSlideNumber + 1, this.sPageNumberingType ); // We create a map with key an id and value the svg element containing // the animations performed on the slide with such an id. @@ -1336,7 +1336,8 @@ function MetaSlide( sMetaSlideId, aMetaDoc ) else this.nSlideNumber= -1; -// Each slide element is wrapped by a element that is responsible for +// Each slide element is double wrapped by elements. +// The outer element is responsible for // the slide element visibility. In fact the visibility attribute has // to be set on the parent of the slide element and not directly on // the slide element. The reason is that in index mode each slide @@ -1351,7 +1352,14 @@ function MetaSlide( sMetaSlideId, aMetaDoc ) // The workaround of setting up the visibility attribute on the slide // parent element let us to make visible a slide in a element // even if the slide parent element visibility is set to 'hidden'. -this.aVisibilityStatusElement = this.slideElement.parentNode; +// The inner element is used in order to append some element +// before or after the slide, operation that can be needed for some +// slide transition (e.g. fade through black). In this way we can +// create a view of both the slide and the appended elements that turns out +// to be useful for handling transition from the last to the first slide. +this.aContainerElement = this.slideElement.parentNode; +this.slideContainerId = this.aContainerElement.getAttribute( 'id' ); +this.aVisibilityStatusElement = this.aContainerElement.parentNode; // We get a reference to the draw page element, where all shapes specific // of this slide live. @@ -8503,7 +8511,7 @@ function AnimatedSlide( aMetaSlide ) this.aMetaSlide = aMetaSlide; this.aSlideElement = this.aMetaSlide.slideElement; -this.sSlideId = this.aMetaSlide.slideId; +this.sSlideId = this.aMetaSlide.slideId; this.aUsedAttributeSet = new Array(); @@ -8628,7 +8636,7 @@ AnimatedSlide.prototype.insertBefore = function( aElement ) { if( aElement ) { - this.aSlideElement.parentNode.insertBefore( aElement, this.aSlideElement ); +this.aSlideElement.parentNode.insertBefore( aElement, this.aSlideElement ); } }; @@ -8656,7 +8664,7 @@ AnimatedSlide.prototype.removeElement = function( aElement ) { if( aElement ) { - this.aSlideElement.parentNode.removeChild( aElement ); +this.aSlideElement.parentNode.removeChild( aElement ); } }; @@ -12406,6 +12414,11 @@ SlideShow.prototype.notifySlideStart = function( nNewSlideIndex, nOldSlideIndex SlideShow.prototype.notifyTransitionEnd = function( nSlideIndex ) { theMetaDoc.setCurrentSlide( nSlideIndex ); +if( this.aSlideViewElement ) +{ + theMetaDoc.getCurrentSlide().aVisibilityStatusElement.parentNode.removeChild( this.aSlideViewElement ); +this.aSlideViewElement = null; +} if( this.isEnabled() ) { // clear all queues @@ -12777,6 +12790,16 @@ SlideShow.prototype.displaySlide = function( nNewSlide, bSkipSlideTransition ) var aSlideTransitionHandler = aNewMetaSlide.aTransitionHandler;
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/svg/presentation_engine.js | 28 --- filter/source/svg/svgexport.cxx | 55 +++ sd/qa/unit/SVGExportTests.cxx| 20 +-- 3 files changed, 88 insertions(+), 15 deletions(-) New commits: commit b8d86c976c2356bb3c63830ffed204a397ffd0ae Author: Marco CecchettiDate: Wed Dec 9 21:50:39 2015 +0100 svg export: transition on first slide are not run - fixed A dummy slide has been added to be used as leaving slide for transition on first slide. SVGExportTextDecorations unit test - fixed wrong XPath. The new dummy slide group element caused the xpath to the slide group to be wrong. Change-Id: I6c1a0a80f71a79668c309bc0bcb3d5e588ef3a39 Reviewed-on: https://gerrit.libreoffice.org/20560 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js index 569a562..c1cc82b 100644 --- a/filter/source/svg/presentation_engine.js +++ b/filter/source/svg/presentation_engine.js @@ -1215,6 +1215,9 @@ function MetaDocument() this.aSlideAnimationsMap = new Object(); this.initSlideAnimationsMap(); +// We initialize dummy slide - used as leaving slide for transition on the first slide +this.theMetaDummySlide = new MetaSlide( 'ooo:meta_dummy_slide', this ); + // We initialize the set of MetaSlide objects that handle the meta // information for each slide. for( var i = 0; i < this.nNumberOfSlides; ++i ) @@ -1316,7 +1319,11 @@ function MetaSlide( sMetaSlideId, aMetaDoc ) this.slideElement = this.theDocument.getElementById( this.slideId ); assert( this.slideElement, 'MetaSlide: slide element <' + this.slideId + '> not found.' ); -this.nSlideNumber = parseInt( this.slideId.substr(2) ); + +if( this.slideId !== 'dummy_slide' ) +this.nSlideNumber = parseInt( this.slideId.substr(2) ); +else +this.nSlideNumber= -1; // Each slide element is wrapped by a element that is responsible for // the slide element visibility. In fact the visibility attribute has @@ -12588,11 +12595,22 @@ SlideShow.prototype.displaySlide = function( nNewSlide, bSkipSlideTransition ) if( this.isEnabled() && !bSkipSlideTransition ) { // create slide transition and add to activity queue -if ( ( nOldSlide !== undefined ) && -( ( nNewSlide > nOldSlide ) || - ( ( nNewSlide == 0) && ( nOldSlide == (aMetaDoc.nNumberOfSlides - 1) ) ) ) ) +if ( ( ( nOldSlide !== undefined ) && + ( ( nNewSlide > nOldSlide ) || + ( ( nNewSlide == 0) && ( nOldSlide == (aMetaDoc.nNumberOfSlides - 1) ) ) ) ) || + ( ( nOldSlide === undefined ) && ( nNewSlide == 0) ) // for transition on first slide + ) { -var aOldMetaSlide = aMetaDoc.aMetaSlideSet[nOldSlide]; + +var aOldMetaSlide = null; +if( nOldSlide === undefined ) // for transition on first slide +{ +aOldMetaSlide = aMetaDoc.theMetaDummySlide; +} +else +{ +aOldMetaSlide = aMetaDoc.aMetaSlideSet[nOldSlide]; +} var aNewMetaSlide = aMetaDoc.aMetaSlideSet[nNewSlide]; var aSlideTransitionHandler = aNewMetaSlide.aTransitionHandler; diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index ce31b26..21a9b83 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -1010,6 +1010,18 @@ bool SVGFilter::implGenerateMetaData() const OUStringaElemTextFieldId( aOOOElemTextField ); std::vector< TextField* > aFieldSet; +// dummy slide - used as leaving slide for transition on the first slide +if( mbPresentation ) +{ +mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", NSPREFIX "meta_dummy_slide" ); +mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrSlide, "dummy-slide" ); +mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrMaster, "dummy-master-page" ); +mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrBackgroundVisibility, "hidden" ); +mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrMasterObjectsVisibility, "hidden" ); +mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrHasTransition, "false" ); +SvXMLElementExport aMetaDummySlideElem( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true ); +} + for( sal_Int32 i = 0; i < nCount; ++i ) { const Reference< XDrawPage > &xDrawPage = mSelectedPages[i]; @@ -1487,6 +1499,27 @@ bool
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/svg/svgexport.cxx | 433 filter/source/svg/svgfilter.cxx |2 filter/source/svg/svgfilter.hxx |2 sd/qa/unit/SVGExportTests.cxx | 20 - 4 files changed, 192 insertions(+), 265 deletions(-) New commits: commit 154521777f8c551f10ffbe414891df9d2a529ae3 Author: Marco CecchettiDate: Wed Dec 2 17:57:57 2015 +0100 svg export: no more an experimental feature Removed experimental feature check. Single slide exporting works as for multi slides exporting. SVGExportTextDecorations unit test - fixed wrong XPath The new way single slide are exported caused the xpath to the slide group to be wrong, Change-Id: I4db4dc77de4f0d1208418455e1fca3b5732c8477 Reviewed-on: https://gerrit.libreoffice.org/20459 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 6824d95..ce31b26 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -716,17 +716,14 @@ bool SVGFilter::implExportDocument() bool bRet = false; sal_Int32nLastPage = mSelectedPages.getLength() - 1; -SvtMiscOptions aMiscOptions; -const bool bExperimentalMode = aMiscOptions.IsExperimentalMode(); - -mbSinglePage = ((nLastPage == 0) || !bExperimentalMode) && !comphelper::LibreOfficeKit::isActive(); +mbSinglePage = (nLastPage == 0); mnVisiblePage = -1; const Reference< XPropertySet > xDefaultPagePropertySet( mxDefaultPage, UNO_QUERY ); const Reference< XExtendedDocumentHandler > xExtDocHandler( mpSVGExport->GetDocHandler(), UNO_QUERY ); // #i124608# -mbExportSelection = mbSinglePage && maShapeSelection.is() && maShapeSelection->getCount(); +mbExportShapeSelection = mbSinglePage && maShapeSelection.is() && maShapeSelection->getCount(); if(xDefaultPagePropertySet.is()) { @@ -734,7 +731,7 @@ bool SVGFilter::implExportDocument() xDefaultPagePropertySet->getPropertyValue( "Height" ) >>= nDocHeight; } -if(mbExportSelection) +if(mbExportShapeSelection) { // #i124608# create BoundRange and set nDocX, nDocY, nDocWidth and nDocHeight basegfx::B2DRange aShapeRange; @@ -794,7 +791,7 @@ bool SVGFilter::implExportDocument() // instead of centered. #define _SVG_WRITE_EXTENTS #ifdef _SVG_WRITE_EXTENTS -if( mbSinglePage ) +if( !mbPresentation ) { aAttr = OUString::number( nDocWidth * 0.01 ) + "mm"; mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "width", aAttr ); @@ -805,7 +802,7 @@ bool SVGFilter::implExportDocument() #endif // #i124608# set viewBox explicitely to the exported content -if (mbExportSelection) +if (mbExportShapeSelection) { aAttr = OUString::number(nDocX) + " " + OUString::number(nDocY) + " "; } @@ -854,11 +851,10 @@ bool SVGFilter::implExportDocument() if( implLookForFirstVisiblePage() ) // OK! We found at least one visible page. { -if( !mbSinglePage ) +if( mbPresentation ) { implGenerateMetaData(); -if( bExperimentalMode ) -implExportAnimations(); +implExportAnimations(); } else { @@ -893,11 +889,11 @@ bool SVGFilter::implExportDocument() } // #i124608# export a given object selection, so no MasterPage export at all -if (!mbExportSelection) +if (!mbExportShapeSelection) implExportMasterPages( mMasterPageTargets, 0, mMasterPageTargets.size() - 1 ); implExportDrawPages( mSelectedPages, 0, nLastPage ); -if( !mbSinglePage ) +if( mbPresentation ) { implGenerateScript(); } @@ -1488,7 +1484,7 @@ bool SVGFilter::implExportMasterPages( const std::vector< Reference< XDrawPage > // When the exported slides are more than one we wrap master page elements // with a svg element. -OUString aContainerTag = (mbSinglePage) ? OUString( "g" ) : OUString( "defs" ); +OUString aContainerTag = (!mbPresentation) ? OUString( "g" ) : OUString( "defs" ); SvXMLElementExport aContainerElement( *mpSVGExport, XML_NAMESPACE_NONE, aContainerTag, true, true ); bool bRet = false; @@ -1528,7 +1524,7 @@ bool SVGFilter::implExportDrawPages( const SVGFilter::XDrawPageSequence & rxPage { Reference< XShapes > xShapes; -if (mbExportSelection) +if (mbExportShapeSelection) { // #i124608# export a given object selection xShapes = maShapeSelection; @@ -1544,7 +1540,7 @@ bool SVGFilter::implExportDrawPages( const SVGFilter::XDrawPageSequence & rxPage // handling a slide visibility.
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/svg/svgwriter.cxx |8 +++- sd/qa/unit/SVGExportTests.cxx | 77 +--- 2 files changed, 70 insertions(+), 15 deletions(-) New commits: commit 50506421f29d09fa4c44c46c3d60208a64a1c450 Author: Marco CecchettiDate: Mon Nov 9 17:50:33 2015 +0100 tdf#95356: unit test about text decorations for svg export 1) Fixed the trailing space issue in text decoration attribute value. 2) Changed the SVG export suite in order to make it more reusable for other tests. 3) Added a unit test for testing that text decorations are exported correctly. Change-Id: I2bd71974242a0007726fbdd5ef5637a9ec62fd47 Reviewed-on: https://gerrit.libreoffice.org/19870 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 14981f5..ceb2dec 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -806,13 +806,17 @@ void SVGTextWriter::addFontAttributes( bool bIsTextContainer ) if( eCurFontUnderline != eParFontUnderline ) { if( eCurFontUnderline != UNDERLINE_NONE ) -sTextDecoration = "underline "; +sTextDecoration = "underline"; bIsDecorationChanged = true; } if( eCurFontStrikeout != eParFontStrikeout ) { if( eCurFontStrikeout != STRIKEOUT_NONE ) -sTextDecoration += "line-through "; +{ +if( !sTextDecoration.isEmpty() ) +sTextDecoration += " "; +sTextDecoration += "line-through"; +} bIsDecorationChanged = true; } diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx index 8dbbbc9..cd4259c 100644 --- a/sd/qa/unit/SVGExportTests.cxx +++ b/sd/qa/unit/SVGExportTests.cxx @@ -16,13 +16,52 @@ #include #include +#include + +#define MAKE_PATH_STRING( path ) BOOST_PP_STRINGIZE( path ) +#define SVG_SVG *[name()='svg'] +#define SVG_G *[name()='g'] +#define SVG_TEXT *[name()='text'] +#define SVG_TSPAN *[name()='tspan'] + using namespace css; -class SdSVGFilterTest : public SdModelTestBase, public XmlTestTools +class SdSVGFilterTest : public test::BootstrapFixture, public unotest::MacrosTest, public XmlTestTools { uno::Reference mxComponent; utl::TempFile maTempFile; +protected: +virtual void registerNamespaces(xmlXPathContextPtr& pXmlXpathCtx) override +{ +xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("svg"), BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0")); +} + +void load(const char* pDir, const char* pName) +{ +return loadURL(getURLFromSrc(pDir) + OUString::createFromAscii(pName), pName); +} + +void loadURL(OUString const& rURL, const char* pName) +{ +if (mxComponent.is()) +mxComponent->dispose(); +// Output name early, so in the case of a hang, the name of the hanging input file is visible. +if (pName) +std::cout << pName << ","; +mxComponent = loadFromDesktop(rURL); +CPPUNIT_ASSERT(mxComponent.is()); +} + +void save() +{ +uno::Reference xStorable(mxComponent, uno::UNO_QUERY); +utl::MediaDescriptor aMediaDescriptor; +OUString aFilterName("impress_svg_Export"); +aMediaDescriptor["FilterName"] <<= aFilterName; +xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); +} + public: SdSVGFilterTest() { @@ -31,7 +70,7 @@ public: virtual void setUp() override { -SdModelTestBase::setUp(); +test::BootstrapFixture::setUp(); mxDesktop.set(css::frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory(; } @@ -41,23 +80,35 @@ public: if (mxComponent.is()) mxComponent->dispose(); -SdModelTestBase::tearDown(); +test::BootstrapFixture::tearDown(); +} + +void executeExport(const char* pName) +{ +load( "/sd/qa/unit/data/odp/", pName ); +save(); } void testSVGExportTextDecorations() { -mxComponent = loadFromDesktop(getURLFromSrc("/sd/qa/unit/data/odp/svg-export-text-decorations.odp")); -CPPUNIT_ASSERT(mxComponent.is()); +executeExport( "svg-export-text-decorations.odp" ); -uno::Reference xStorable(mxComponent, uno::UNO_QUERY); -utl::MediaDescriptor aMediaDescriptor; -OUString aFilterName("impress_svg_Export"); -aMediaDescriptor["FilterName"] <<= aFilterName; -xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); -xmlDocPtr pXmlDoc =
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/msfilter/svdfppt.cxx |2 +- sd/qa/unit/data/ppt/pass/crash-3.ppt |binary 2 files changed, 1 insertion(+), 1 deletion(-) New commits: commit 7d4c77e374310bef538465d11980d1d610cbe0f1 Author: Caolán McNamara caol...@redhat.com Date: Sun Aug 30 20:14:16 2015 +0100 pClientData can be null Change-Id: I9375f84affdaef30d9b1ded31525e6b7b8709cbc diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index ad20a86..744b5e9 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -2588,7 +2588,7 @@ bool SdrPowerPointImport::GetColorFromPalette( sal_uInt16 nNum, Color rColor ) bool SdrPowerPointImport::SeekToShape( SvStream rSt, void* pClientData, sal_uInt32 nId ) const { bool bRet = SvxMSDffManager::SeekToShape( rSt, pClientData, nId ); -if ( !bRet ) +if (!bRet pClientData) { ProcessData rData = *static_castProcessData*(pClientData); PptSlidePersistEntry rPersistEntry = rData.rPersistEntry; diff --git a/sd/qa/unit/data/ppt/pass/crash-3.ppt b/sd/qa/unit/data/ppt/pass/crash-3.ppt new file mode 100644 index 000..daa0102 Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/crash-3.ppt differ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/msfilter/msdffimp.cxx |6 -- sd/qa/unit/data/ppt/pass/hang-13.ppt |binary 2 files changed, 4 insertions(+), 2 deletions(-) New commits: commit 0c713e45f9831073e34777f50abf9b5801f08ed9 Author: Caolán McNamara caol...@redhat.com Date: Thu Aug 27 20:16:58 2015 +0100 check seek Change-Id: I358758999bb918e73cdee2224e575e72c2131453 diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 7cfde35..011624a 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -410,7 +410,8 @@ SvStream ReadSvxMSDffSolverContainer( SvStream rIn, SvxMSDffSolverContainer r if ( aHd.nRecType == DFF_msofbtSolverContainer ) { DffRecordHeader aCRule; -while ( ( rIn.GetError() == 0 ) ( rIn.Tell() aHd.GetRecEndFilePos() ) ) +auto nEndPos = DffPropSet::SanitizeEndPos(rIn, aHd.GetRecEndFilePos()); +while ( ( rIn.GetError() == 0 ) ( rIn.Tell() nEndPos ) ) { ReadDffRecordHeader( rIn, aCRule ); if ( aCRule.nRecType == DFF_msofbtConnectorRule ) @@ -419,7 +420,8 @@ SvStream ReadSvxMSDffSolverContainer( SvStream rIn, SvxMSDffSolverContainer r rIn *pRule; rContainer.aCList.push_back( pRule ); } -aCRule.SeekToEndOfRecord( rIn ); +if (!aCRule.SeekToEndOfRecord(rIn)) +break; } } return rIn; diff --git a/sd/qa/unit/data/ppt/pass/hang-13.ppt b/sd/qa/unit/data/ppt/pass/hang-13.ppt new file mode 100644 index 000..04fbdc5 Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/hang-13.ppt differ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: filter/source sd/qa
filter/source/msfilter/svdfppt.cxx | 15 ++- sd/qa/unit/data/ppt/pass/hang-14.ppt |binary 2 files changed, 10 insertions(+), 5 deletions(-) New commits: commit 5ed690a3e8a575784ca25048e0229ebc52e6fccd Author: Caolán McNamara caol...@redhat.com Date: Thu Aug 27 20:32:28 2015 +0100 check seeks and offsets Change-Id: I2b6ded138b9101415fc49e93e1ec3ebcd3a9d2ae diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 0f419dd..b025b79 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -6505,10 +6505,12 @@ PPTTextObj::PPTTextObj( SvStream rIn, SdrPowerPointImport rSdrPowerPointImport bStatus = false; else { -rIn.Seek( pE-nSlidePersistStartOffset ); +auto nOffset(pE-nSlidePersistStartOffset); +bStatus = (nOffset == rIn.Seek(nOffset)); // now we got the right page and are searching for the right // TextHeaderAtom -while ( rIn.Tell() pE-nSlidePersistEndOffset ) +auto nEndRecPos = DffPropSet::SanitizeEndPos(rIn, pE-nSlidePersistEndOffset); +while (bStatus rIn.Tell() nEndRecPos) { ReadDffRecordHeader( rIn, aClientTextBoxHd ); if ( aClientTextBoxHd.nRecType == PPT_PST_TextHeaderAtom ) @@ -6519,7 +6521,8 @@ PPTTextObj::PPTTextObj( SvStream rIn, SdrPowerPointImport rSdrPowerPointImport break; } } -aClientTextBoxHd.SeekToEndOfRecord( rIn ); +if (!aClientTextBoxHd.SeekToEndOfRecord(rIn)) +break; } if ( rIn.Tell() pE-nSlidePersistEndOffset ) bStatus = false; @@ -6532,12 +6535,14 @@ PPTTextObj::PPTTextObj( SvStream rIn, SdrPowerPointImport rSdrPowerPointImport // we have to calculate the correct record len DffRecordHeader aTmpHd; -while ( rIn.Tell() pE-nSlidePersistEndOffset ) +nEndRecPos = DffPropSet::SanitizeEndPos(rIn, pE-nSlidePersistEndOffset); +while (rIn.Tell() nEndRecPos) { ReadDffRecordHeader( rIn, aTmpHd ); if ( ( aTmpHd.nRecType == PPT_PST_SlidePersistAtom ) || ( aTmpHd.nRecType == PPT_PST_TextHeaderAtom ) ) break; -aTmpHd.SeekToEndOfRecord( rIn ); +if (!aTmpHd.SeekToEndOfRecord(rIn)) +break; aClientTextBoxHd.nRecLen += aTmpHd.nRecLen + DFF_COMMON_RECORD_HEADER_SIZE; } aClientTextBoxHd.SeekToContent( rIn ); diff --git a/sd/qa/unit/data/ppt/pass/hang-14.ppt b/sd/qa/unit/data/ppt/pass/hang-14.ppt new file mode 100644 index 000..8dd397b Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/hang-14.ppt differ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: filter/source sd/qa sd/source
filter/source/msfilter/svdfppt.cxx | 112 ++-- sd/qa/unit/data/ppt/pass/hang-2.ppt |binary sd/source/filter/ppt/propread.cxx |6 + 3 files changed, 74 insertions(+), 44 deletions(-) New commits: commit a8b2dc80c41022515c3a1df6f7ea245c3390dc39 Author: Caolán McNamara caol...@redhat.com Date: Wed Aug 26 14:26:40 2015 +0100 various hangs, check seeks and record lengths Change-Id: Ided7f9376f41ee8cb1f6903e54a2d51e0e07e1a7 diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 8199766..2d65f8e 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -708,6 +708,21 @@ void SdrEscherImport::RecolorGraphic( SvStream rSt, sal_uInt32 nRecLen, Graphic } } +namespace +{ +sal_uLong SanitizeEndPos(SvStream rIn, sal_uLong nEndRecPos) +{ +auto nStreamLen = rIn.Tell() + rIn.remainingSize(); +if (nEndRecPos nStreamLen) +{ +SAL_WARN(filter.ms, Parsing error: nStreamLen + max end pos, but nEndRecPos claimed, truncating); +nEndRecPos = nStreamLen; +} +return nEndRecPos; +} +} + /* ProcessObject is called from ImplSdPPTImport::ProcessObj to handle all application specific things, such as the import of text, animation effects, header footer and placeholder. @@ -733,7 +748,8 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream rSt, DffObjData rObjData, voi { sal_Int16 nHeaderFooterInstance = -1; DffRecordHeader aClientDataHd; -while ( ( rSt.GetError() == 0 ) ( rSt.Tell() maShapeRecords.Current()-GetRecEndFilePos() ) ) +auto nEndRecPos = SanitizeEndPos(rSt, maShapeRecords.Current()-GetRecEndFilePos()); +while ( ( rSt.GetError() == 0 ) ( rSt.Tell() nEndRecPos ) ) { ReadDffRecordHeader( rSt, aClientDataHd ); switch ( aClientDataHd.nRecType ) @@ -1354,9 +1370,8 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam rParam, const O while( nCurrentEditAtomStrmPos ) { sal_uInt32 nPersistIncPos = aCurrentEditAtom.nOffsetPersistDirectory; -if ( nPersistIncPos ) +if (nPersistIncPos rStCtrl.Seek(nPersistIncPos) == nPersistIncPos) { -rStCtrl.Seek( nPersistIncPos ); DffRecordHeader aPersistHd; ReadDffRecordHeader( rStCtrl, aPersistHd ); if ( aPersistHd.nRecType == PPT_PST_PersistPtrIncrementalBlock ) @@ -1786,8 +1801,10 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId, if ( const_castSdrPowerPointImport*(this)-maShapeRecords.SeekToContent( rStCtrl, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) ) { DffRecordHeader aPlaceHd; + +auto nEndRecPos = SanitizeEndPos(rStCtrl, const_castSdrPowerPointImport*(this)-maShapeRecords.Current()-GetRecEndFilePos()); while ( ( rStCtrl.GetError() == 0 ) - ( rStCtrl.Tell() const_castSdrPowerPointImport*(this)-maShapeRecords.Current()-GetRecEndFilePos() ) ) + ( rStCtrl.Tell() nEndRecPos ) ) { ReadDffRecordHeader( rStCtrl, aPlaceHd ); if ( aPlaceHd.nRecType == PPT_PST_RecolorInfoAtom ) @@ -2644,7 +2661,9 @@ void ImportComment10( SvxMSDffManager rMan, SvStream rStCtrl, SdrPage* pPage, sal_Int32 nPosX = 0; sal_Int32 nPosY = 0; -while ( ( rStCtrl.GetError() == 0 ) ( rStCtrl.Tell() rComment10Hd.GetRecEndFilePos() ) ) + +auto nEndRecPos = SanitizeEndPos(rStCtrl, rComment10Hd.GetRecEndFilePos()); +while ( ( rStCtrl.GetError() == 0 ) ( rStCtrl.Tell() nEndRecPos ) ) { DffRecordHeader aCommentHd; ReadDffRecordHeader( rStCtrl, aCommentHd ); @@ -2719,7 +2738,8 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry* { rSlidePersist.pHeaderFooterEntry = new HeaderFooterEntry( pMasterPersist ); ProcessData aProcessData( rSlidePersist, SdPageCapsule(pRet) ); -while ( ( rStCtrl.GetError() == 0 ) ( rStCtrl.Tell() aPageHd.GetRecEndFilePos() ) ) +auto nEndRecPos = SanitizeEndPos(rStCtrl, aPageHd.GetRecEndFilePos()); +while ( ( rStCtrl.GetError() == 0 ) ( rStCtrl.Tell() nEndRecPos ) ) { DffRecordHeader aHd; ReadDffRecordHeader( rStCtrl, aHd ); @@ -2754,7 +2774,8 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry* sal_uInt32 nPPDrawOfs = rStCtrl.Tell(); // importing the background object before importing the page -while ( ( rStCtrl.GetError() == 0 ) ( rStCtrl.Tell() aPPDrawHd.GetRecEndFilePos() ) ) +auto nPPEndRecPos = SanitizeEndPos(rStCtrl,