canvas/source/cairo/cairo_canvashelper.cxx | 6 ++ cui/uiconfig/ui/paraindentspacing.ui | 1 include/oox/core/xmlfilterbase.hxx | 6 ++ include/svx/dialogs.hrc | 3 - oox/source/core/xmlfilterbase.cxx | 8 +++ oox/source/drawingml/graphicshapecontext.cxx | 5 ++ oox/source/ppt/pptimport.cxx | 28 ++++++++++++- sc/qa/unit/subsequent_export-test.cxx | 18 -------- sc/source/filter/excel/xetable.cxx | 9 +--- sd/qa/unit/data/odp/tdf103567.odp |binary sd/qa/unit/import-tests.cxx | 47 ++++++++++++++++++++++ sd/source/ui/animations/CustomAnimationDialog.cxx | 4 + svx/source/stbctrls/stbctrls.src | 6 ++ sw/qa/extras/odfexport/data/tdf103567.odt |binary sw/qa/extras/odfexport/odfexport.cxx | 37 +++++++++++++++++ vcl/source/gdi/pngread.cxx | 43 +++++++++++++++++--- xmloff/source/core/xmlmultiimagehelper.cxx | 3 + xmloff/source/draw/ximpshap.cxx | 10 ++++ xmloff/source/text/XMLTextFrameContext.cxx | 29 +++++++++++++ 19 files changed, 232 insertions(+), 31 deletions(-)
New commits: commit e094103ac613d3c52ad6d6c4b23e4b9121bd981b Author: Michael Stahl <mst...@redhat.com> Date: Thu Feb 9 11:12:26 2017 +0100 tdf#103567 xmloff: ODF import: fix more lossage on Writer frames There's another context that reads draw:frame, and it has the same problem as the one used for Impress shapes. This causes SVG images in Writer to lose contour polygons and image maps. Fix this the same way as the other context. (likely regression from 44cfc7cb6533d827fd2d6e586d92c61d7d7f7a70) Change-Id: I16cf55e68829b4e1b0841f2015d0729be0ce3725 (cherry picked from commit ae00898f12b9087e1d9b59d9a7820d64b5501775) Reviewed-on: https://gerrit.libreoffice.org/34088 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> (cherry picked from commit 38c82af5368c7dfb134305cb402b1ce9e1a7cc7f) diff --git a/sw/qa/extras/odfexport/data/tdf103567.odt b/sw/qa/extras/odfexport/data/tdf103567.odt new file mode 100644 index 0000000..cbd29bd Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf103567.odt differ diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 5a661c1..0348768 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -15,6 +15,7 @@ #include <com/sun/star/awt/Gradient.hpp> #include <com/sun/star/container/XIndexReplace.hpp> #include <com/sun/star/drawing/FillStyle.hpp> +#include <com/sun/star/drawing/PointSequenceSequence.hpp> #include <com/sun/star/table/ShadowFormat.hpp> #include <com/sun/star/table/XCellRange.hpp> #include <com/sun/star/text/RelOrientation.hpp> @@ -107,6 +108,42 @@ DECLARE_ODFEXPORT_TEST(testMathObjectFlatExport, "2_MathType3.docx") CPPUNIT_ASSERT_EQUAL(OUString(" size 12{2+2=4} {}"), formula2); } +DECLARE_ODFEXPORT_TEST(testTdf103567, "tdf103567.odt") +{ + uno::Reference<drawing::XShape> const xShape(getShape(1)); + + // contour wrap polygon + css::drawing::PointSequenceSequence const pointss( + getProperty<css::drawing::PointSequenceSequence>(xShape, "ContourPolyPolygon")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pointss.getLength()); + // for some reason this property exists with 199 points if it wasn't + // imported, that would be a fail + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), pointss[0].getLength()); + CPPUNIT_ASSERT_EQUAL(sal_Int32( 0), pointss[0][0].X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2672), pointss[0][0].Y); + CPPUNIT_ASSERT_EQUAL(sal_Int32( 0), pointss[0][1].X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1111), pointss[0][1].Y); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2672), pointss[0][2].X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1111), pointss[0][2].Y); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2672), pointss[0][3].X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2672), pointss[0][3].Y); + CPPUNIT_ASSERT_EQUAL(sal_Int32( 0), pointss[0][4].X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2672), pointss[0][4].Y); + + // image map, one rectangle + uno::Reference<container::XIndexContainer> const xImageMap( + getProperty<uno::Reference<container::XIndexContainer>>(xShape, "ImageMap")); + + uno::Reference<beans::XPropertySet> const xEntry(xImageMap->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("http://example.com/"), getProperty<OUString>(xEntry, "URL")); + awt::Rectangle const rect(getProperty<awt::Rectangle>(xEntry, "Boundary")); + CPPUNIT_ASSERT_EQUAL(sal_Int32( 726), rect.X); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1718), rect.Y); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1347), rect.Width); + CPPUNIT_ASSERT_EQUAL(sal_Int32( 408), rect.Height); +} + + DECLARE_ODFEXPORT_TEST(testFramebackgrounds, "framebackgrounds.odt") { //Counting the Number of Frames and checking with the expected count diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index 82191a9..add7629 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -1586,6 +1586,10 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext( { if( IsXMLToken( rLocalName, XML_TITLE ) ) { + if (getSupportsMultipleContents()) + { // tdf#103567 ensure props are set on surviving shape + m_xImplContext = solveMultipleImages(); + } pContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(), p_nPrefix, rLocalName, @@ -1593,6 +1597,10 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext( } else if ( IsXMLToken( rLocalName, XML_DESC ) ) { + if (getSupportsMultipleContents()) + { // tdf#103567 ensure props are set on surviving shape + m_xImplContext = solveMultipleImages(); + } pContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(), p_nPrefix, rLocalName, @@ -1605,24 +1613,40 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext( Reference < XPropertySet > xPropSet; if( IsXMLToken( rLocalName, XML_CONTOUR_POLYGON ) ) { + if (getSupportsMultipleContents()) + { // tdf#103567 ensure props are set on surviving shape + m_xImplContext = solveMultipleImages(); + } if( CreateIfNotThere( xPropSet ) ) pContext = new XMLTextFrameContourContext_Impl( GetImport(), p_nPrefix, rLocalName, xAttrList, xPropSet, false ); } else if( IsXMLToken( rLocalName, XML_CONTOUR_PATH ) ) { + if (getSupportsMultipleContents()) + { // tdf#103567 ensure props are set on surviving shape + m_xImplContext = solveMultipleImages(); + } if( CreateIfNotThere( xPropSet ) ) pContext = new XMLTextFrameContourContext_Impl( GetImport(), p_nPrefix, rLocalName, xAttrList, xPropSet, true ); } else if( IsXMLToken( rLocalName, XML_IMAGE_MAP ) ) { + if (getSupportsMultipleContents()) + { // tdf#103567 ensure props are set on surviving shape + m_xImplContext = solveMultipleImages(); + } if( CreateIfNotThere( xPropSet ) ) pContext = new XMLImageMapContext( GetImport(), p_nPrefix, rLocalName, xPropSet ); } } else if( (XML_NAMESPACE_OFFICE == p_nPrefix) && IsXMLToken( rLocalName, XML_EVENT_LISTENERS ) ) { + if (getSupportsMultipleContents()) + { // tdf#103567 ensure props are set on surviving shape + m_xImplContext = solveMultipleImages(); + } // do we still have the frame object? Reference < XPropertySet > xPropSet; if( CreateIfNotThere( xPropSet ) ) @@ -1641,6 +1665,11 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext( else if( p_nPrefix == XML_NAMESPACE_SVG && // #i68101# (IsXMLToken( rLocalName, XML_TITLE ) || IsXMLToken( rLocalName, XML_DESC ) ) ) { + if (getSupportsMultipleContents()) + { // tdf#103567 ensure props are set on surviving shape + // note: no more draw:image can be added once we get here + m_xImplContext = solveMultipleImages(); + } pContext = m_xImplContext->CreateChildContext( p_nPrefix, rLocalName, xAttrList ); } else commit a688fa7067c071ea309c6f9c794aa0c2dcfb40fe Author: Michael Stahl <mst...@redhat.com> Date: Wed Feb 8 18:30:42 2017 +0100 tdf#103567 xmloff: ODF import: fix loss of events on SVG multi-image For SVG there are 2 draw:image children in the draw:frame, and the SdXMLEventContext::EndElement() applies the content of office:event-listeners to the shape created from the last draw:image and then MultiImageImportHelper::solveMultipleImages() throws it away because it's the bitmap fallback of the SVG. Avoid that problem by calling solveMultipleImages earlier: The ODF schema ensures that all the draw:image elements occur before the optional property-bearing child elements of draw:frame, so we just call solveMultipleImages on the first such optional element, so that all subsequent properties get applied to the one surviving shape. (likely regression from 44cfc7cb6533d827fd2d6e586d92c61d7d7f7a70) (cherry picked from commit 791431d7e2485652c96fac7c15f47aa125271ee0) Change-Id: I2be5f6f424dbfd90ca2179ce6f9057929540e762 Reviewed-on: https://gerrit.libreoffice.org/34087 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> (cherry picked from commit bee00eafcf4ade2b5d9139ac751d39429fb52311) diff --git a/sd/qa/unit/data/odp/tdf103567.odp b/sd/qa/unit/data/odp/tdf103567.odp new file mode 100644 index 0000000..a6f72c4 Binary files /dev/null and b/sd/qa/unit/data/odp/tdf103567.odp differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 9fdd516..40ef25d 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -41,6 +41,8 @@ #include <sax/tools/converter.hxx> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> +#include <com/sun/star/document/XEventsSupplier.hpp> +#include <com/sun/star/presentation/ClickAction.hpp> #include <com/sun/star/drawing/GraphicExportFilter.hpp> #include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> @@ -64,6 +66,7 @@ #include <stlpool.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/sequenceashashmap.hxx> #include <vcl/pngread.hxx> #include <vcl/bitmapaccess.hxx> @@ -115,6 +118,7 @@ public: void testTdf93124(); void testTdf93868(); void testTdf103473(); + void testTdf103567(); void testTdf103792(); void testTdf103876(); void testTdf104015(); @@ -165,6 +169,7 @@ public: CPPUNIT_TEST(testTdf93124); CPPUNIT_TEST(testTdf93868); CPPUNIT_TEST(testTdf103473); + CPPUNIT_TEST(testTdf103567); CPPUNIT_TEST(testTdf103792); CPPUNIT_TEST(testTdf103876); CPPUNIT_TEST(testTdf104015); @@ -1246,6 +1251,48 @@ void SdImportTest::testTdf93868() } +void SdImportTest::testTdf103567() +{ + sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/odp/tdf103567.odp"), ODP); + for (int i = 0; i < 4; ++i) + { + uno::Reference<beans::XPropertySet> const xShape(getShapeFromPage(i, 0, xDocShRef)); + uno::Reference<document::XEventsSupplier> const xEventsSupplier(xShape, uno::UNO_QUERY); + uno::Reference<container::XNameAccess> const xEvents(xEventsSupplier->getEvents()); + OString const msg("shape " + OString::number(i) + ": "); + + CPPUNIT_ASSERT(xEvents->hasByName("OnClick")); + uno::Sequence<beans::PropertyValue> props; + xEvents->getByName("OnClick") >>= props; + comphelper::SequenceAsHashMap const map(props); + { + auto iter(map.find("EventType")); + CPPUNIT_ASSERT_MESSAGE(OString(msg + "no EventType").getStr(), iter != map.end()); + CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.getStr(), OUString("Presentation"), iter->second.get<OUString>()); + } + { + auto iter(map.find("ClickAction")); + CPPUNIT_ASSERT_MESSAGE(OString(msg + "no ClickAction").getStr(), iter != map.end()); + if (i % 2 == 0) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.getStr(), css::presentation::ClickAction_DOCUMENT, iter->second.get<css::presentation::ClickAction>()); + } + else + { + CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.getStr(), css::presentation::ClickAction_NEXTPAGE, iter->second.get<css::presentation::ClickAction>()); + } + } + if (i % 2 == 0) + { + auto iter(map.find("Bookmark")); + CPPUNIT_ASSERT_MESSAGE(OString(msg + "no Bookmark").getStr(), iter != map.end()); + CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.getStr(), OUString("http://example.com/"), iter->second.get<OUString>()); + } + } + + xDocShRef->DoClose(); +} + void SdImportTest::testTdf103792() { // Title text shape on the actual slide contained no text neither a placeholder text. diff --git a/xmloff/source/core/xmlmultiimagehelper.cxx b/xmloff/source/core/xmlmultiimagehelper.cxx index e7eeb62..9c70c07 100644 --- a/xmloff/source/core/xmlmultiimagehelper.cxx +++ b/xmloff/source/core/xmlmultiimagehelper.cxx @@ -125,6 +125,9 @@ SvXMLImportContextRef MultiImageImportHelper::solveMultipleImages() removeGraphicFromImportContext(rCandidate); } + // re-insert it so that solveMultipleImages is idempotent + maImplContextVector.clear(); + maImplContextVector.push_back(pContext); } else if (maImplContextVector.size() == 1) { diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index a66f068..3f0820b 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -3522,12 +3522,22 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref (nPrefix == XML_NAMESPACE_DRAW && (IsXMLToken( rLocalName, XML_GLUE_POINT ) || IsXMLToken( rLocalName, XML_THUMBNAIL ) ) ) ) { + if (getSupportsMultipleContents()) + { // tdf#103567 ensure props are set on surviving shape + // note: no more draw:image can be added once we get here + mxImplContext = solveMultipleImages(); + } SvXMLImportContext *pImplContext = &mxImplContext; pContext = dynamic_cast<SdXMLShapeContext&>(*pImplContext).CreateChildContext( nPrefix, rLocalName, xAttrList ); } else if ( (XML_NAMESPACE_DRAW == nPrefix) && IsXMLToken( rLocalName, XML_IMAGE_MAP ) ) { + if (getSupportsMultipleContents()) + { // tdf#103567 ensure props are set on surviving shape + // note: no more draw:image can be added once we get here + mxImplContext = solveMultipleImages(); + } SdXMLShapeContext *pSContext = dynamic_cast< SdXMLShapeContext* >( &mxImplContext ); if( pSContext ) { commit 79e910bfa43e6cb12e6068b50d0e9053ee88e3f0 Author: Michael Stahl <mst...@redhat.com> Date: Thu Feb 9 23:03:04 2017 +0100 tdf#98993 cui: Paragraph dialog: decimals in Line Spacing spinbox For whatever reason, this also makes the +/- buttons increment by 1pt instead of the previous 10pt, which is also an improvement. (presumably regression from 324141f21bf2280d7613c4056ee8cd997ea345f9) Change-Id: If47dd768b2faea760d9967a73453d3f714c65fe3 (cherry picked from commit d22377ab55675135776d94213ef06f608b71669e) Reviewed-on: https://gerrit.libreoffice.org/34109 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> (cherry picked from commit 01a68ee89809556125077b17a9055038be3a240d) diff --git a/cui/uiconfig/ui/paraindentspacing.ui b/cui/uiconfig/ui/paraindentspacing.ui index 3593b0e..d6e892f 100644 --- a/cui/uiconfig/ui/paraindentspacing.ui +++ b/cui/uiconfig/ui/paraindentspacing.ui @@ -439,6 +439,7 @@ <property name="invisible_char">â¢</property> <property name="invisible_char_set">True</property> <property name="adjustment">adjustmentED_LINEDISTMETRIC</property> + <property name="digits">1</property> </object> <packing> <property name="expand">False</property> commit d9342b01de01721fb3b3d700518bd8159d14e3f4 Author: Justin Luth <justin_l...@sil.org> Date: Thu Feb 9 21:10:56 2017 +0300 revert tdf#98106 Preserving hidden and empty rows after xlsx export That patch has caused massive file bloat and and import hanging in xls and xlsx files (bug 105840). That patch was backported to 5.2.5. Just revert from the stable 5.2 branch and work on fixing 5.3 since the proper fix needs to be well tested. Since bug 98106 is just an enhancement, it is an obvious candidate for a simple revert of commit 7dd19273530730478b5ed24b79f42ac480c7ae43 Change-Id: I339694a86bab489ba0905b4d1090245bcb07fe86 Reviewed-on: https://gerrit.libreoffice.org/34104 Reviewed-by: Bartosz Kosiorek <gan...@poczta.onet.pl> Tested-by: Bartosz Kosiorek <gan...@poczta.onet.pl> (cherry picked from commit 3e67dc9dbbd802dd82b92304098aaa44e70c014c) diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 2554e69..2746e85 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -113,7 +113,6 @@ public: void testColumnWidthResaveXLSX(); void testColumnWidthExportFromODStoXLSX(); void testOutlineExportXLSX(); - void testHiddenEmptyRowsXLSX(); void testLandscapeOrientationXLSX(); void testInlineArrayXLS(); @@ -195,7 +194,6 @@ public: CPPUNIT_TEST(testColumnWidthResaveXLSX); CPPUNIT_TEST(testColumnWidthExportFromODStoXLSX); CPPUNIT_TEST(testOutlineExportXLSX); - CPPUNIT_TEST(testHiddenEmptyRowsXLSX); CPPUNIT_TEST(testLandscapeOrientationXLSX); CPPUNIT_TEST(testInlineArrayXLS); CPPUNIT_TEST(testEmbeddedChartXLS); @@ -843,22 +841,6 @@ void ScExportTest::testOutlineExportXLSX() } -void ScExportTest::testHiddenEmptyRowsXLSX() -{ - //tdf#98106 FILESAVE: Hidden and empty rows became visible when export to .XLSX - ScDocShellRef xShell = loadDoc("hidden-empty-rows.", FORMAT_ODS); - CPPUNIT_ASSERT(xShell.Is()); - - std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX); - xmlDocPtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml"); - CPPUNIT_ASSERT(pSheet); - - assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[1]", "hidden", "true"); - assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[2]", "hidden", "true"); - assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[3]", "hidden", "true"); - assertXPath(pSheet, "/x:worksheet/x:sheetData/x:row[4]", "hidden", "false"); -} - void ScExportTest::testLandscapeOrientationXLSX() { //tdf#48767 - Landscape page orientation is not loaded from .xlsx format with MS Excel, after export with Libre Office diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index bc8edc0..a8c4caf 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -2043,7 +2043,7 @@ sal_uInt16 XclExpRow::GetFirstFreeXclCol() const bool XclExpRow::IsDefaultable() const { - const sal_uInt16 nFlagsAlwaysMarkedAsDefault = EXC_ROW_DEFAULTFLAGS | EXC_ROW_UNSYNCED; + const sal_uInt16 nFlagsAlwaysMarkedAsDefault = EXC_ROW_DEFAULTFLAGS | EXC_ROW_HIDDEN | EXC_ROW_UNSYNCED; return !::get_flag( mnFlags, static_cast< sal_uInt16 >( ~nFlagsAlwaysMarkedAsDefault ) ) && IsEmpty(); } @@ -2052,6 +2052,7 @@ void XclExpRow::DisableIfDefault( const XclExpDefaultRowData& rDefRowData ) { mbEnabled = !IsDefaultable() || (mnHeight != rDefRowData.mnHeight) || + (IsHidden() != rDefRowData.IsHidden()) || (IsUnsynced() != rDefRowData.IsUnsynced()); } @@ -2223,7 +2224,6 @@ void XclExpRowBuffer::Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt XclExpDefaultRowData aMaxDefData; size_t nMaxDefCount = 0; // only look for default format in existing rows, if there are more than unused - // if the row is hidden, then row xml must be created even if it not contain cells XclExpRow* pPrev = nullptr; typedef std::vector< XclExpRow* > XclRepeatedRows; XclRepeatedRows aRepeated; @@ -2378,12 +2378,11 @@ XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysE { // only create RowMap entries if it is first row in spreadsheet, // if it is the desired row, for rows that height differ from previous, - // if row is collapsed, has outline level (tdf#100347), or row is hidden (tdf#98106). + // if row is collapsed, or has outline level (tdf#100347). if ( !nFrom || ( nFrom == nXclRow ) || ( rDoc.GetRowHeight(nFrom, nScTab, false) != rDoc.GetRowHeight(nFrom - 1, nScTab, false) ) || ( maOutlineBfr.IsCollapsed() ) || - ( maOutlineBfr.GetLevel() != 0 ) || - ( rDoc.RowHidden(nFrom, nScTab) ) ) + ( maOutlineBfr.GetLevel() != 0 ) ) { if( maOutlineBfr.GetLevel() > maHighestOutlineLevel ) { commit 17132f7027d1ac395e34f45631d76a8b5353cc78 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Jun 22 16:40:03 2016 +0100 ofz#574 sanitize png palette indexes clarify we're not setting a pal index in the mask no logic changed intended, SetPixelIndex expands to this, just want to clarify that this is an alpha value, not an index into a palette (cherry picked from commit e5b23d924d60e7a0fb67c44c6dad3f4cb3bd5ddc) e9bb188b116adf3eab4e2bb1d6da8badbaead88b crashtesting: fix tdf95481-1.odg reexport to odg failure revealed since commit 81e3ca4f60e6ac0823c1233841c22a759cfe937f Author: Tor Lillqvist <t...@collabora.com> Date: Tue Jun 21 10:34:21 2016 +0300 Use real assert() instead of DBG_ASSERT() sanitize invalid palette entry indexes at the outer perimeter on initial load to try and avoid having to do it in all sort of places in the interior. png spec says that the palette has to appear before the first IDAT so we should always know the palette size here (cherry picked from commit 9d2fa0bfdc93fa9bfed7dea89d603b1611d7a6e0) Reviewed-on: https://gerrit.libreoffice.org/34036 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> (cherry picked from commit 38f0a87ba8d840f7a79f6d466d833518470d337c) Change-Id: I006ffdf5c8c751e7e07b133716022e2a9b154478 6e04223adce1c88d037f9cf34862e6f54e381bb0 diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx index 1eb2663..6fd57ac 100644 --- a/vcl/source/gdi/pngread.cxx +++ b/vcl/source/gdi/pngread.cxx @@ -1115,6 +1115,37 @@ void PNGReaderImpl::ImplApplyFilter() memcpy( mpScanPrior, mpInflateInBuf, mnScansize ); } +namespace +{ + sal_uInt8 SanitizePaletteIndex(sal_uInt8 nIndex, sal_uInt16 nPaletteEntryCount) + { + if (nIndex >= nPaletteEntryCount) + { + auto nSanitizedIndex = nIndex % nPaletteEntryCount; + SAL_WARN_IF(nIndex != nSanitizedIndex, "vcl", "invalid colormap index: " + << static_cast<unsigned int>(nIndex) << ", colormap len is: " + << nPaletteEntryCount); + nIndex = nSanitizedIndex; + } + return nIndex; + } + + void SanitizePaletteIndexes(sal_uInt8* pEntries, int nLen, BitmapWriteAccess* pAcc) + { + sal_uInt16 nPaletteEntryCount = pAcc->GetPaletteEntryCount(); + for (int nX = 0; nX < nLen; ++nX) + { + if (pEntries[nX] >= nPaletteEntryCount) + { + SAL_WARN("vcl.gdi", "invalid colormap index: " + << static_cast<unsigned int>(pEntries[nX]) << ", colormap len is: " + << nPaletteEntryCount); + pEntries[nX] = pEntries[nX] % nPaletteEntryCount; + } + } + } +} + // ImplDrawScanlines draws the complete Scanline (nY) into the target bitmap // In interlace mode the parameter nXStart and nXAdd append to the currently used pass @@ -1130,7 +1161,7 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd ) // => TODO; also do this for nX here instead of in the ImplSet*Pixel() methods const sal_uInt32 nY = mnYpos >> mnPreviewShift; - const sal_uInt8* pTmp = mpInflateInBuf + 1; + sal_uInt8* pTmp = mpInflateInBuf + 1; if ( mpAcc->HasPalette() ) // alphachannel is not allowed by pictures including palette entries { switch ( mpAcc->GetBitCount() ) @@ -1297,6 +1328,8 @@ void PNGReaderImpl::ImplDrawScanline( sal_uInt32 nXStart, sal_uInt32 nXAdd ) if( nXAdd == 1 && mnPreviewShift == 0 ) // copy raw line data if possible { int nLineBytes = maOrigSize.Width(); + if (mbPalette) + SanitizePaletteIndexes(pTmp, nLineBytes, mpAcc); mpAcc->CopyScanline( nY, pTmp, BMP_FORMAT_8BIT_PAL, nLineBytes ); } else @@ -1585,7 +1618,7 @@ void PNGReaderImpl::ImplSetPixel( sal_uInt32 nY, sal_uInt32 nX, sal_uInt8 nPalIn return; nX >>= mnPreviewShift; - mpAcc->SetPixelIndex( nY, nX, nPalIndex ); + mpAcc->SetPixelIndex(nY, nX, SanitizePaletteIndex(nPalIndex, mpAcc->GetPaletteEntryCount())); } void PNGReaderImpl::ImplSetTranspPixel( sal_uInt32 nY, sal_uInt32 nX, const BitmapColor& rBitmapColor, bool bTrans ) @@ -1611,8 +1644,8 @@ void PNGReaderImpl::ImplSetAlphaPixel( sal_uInt32 nY, sal_uInt32 nX, return; nX >>= mnPreviewShift; - mpAcc->SetPixelIndex( nY, nX, nPalIndex ); - mpMaskAcc->SetPixelIndex( nY, nX, ~nAlpha ); + mpAcc->SetPixelIndex(nY, nX, SanitizePaletteIndex(nPalIndex, mpAcc->GetPaletteEntryCount())); + mpMaskAcc->SetPixel(nY, nX, BitmapColor(~nAlpha)); } void PNGReaderImpl::ImplSetAlphaPixel( sal_uInt32 nY, sal_uInt32 nX, @@ -1626,7 +1659,7 @@ void PNGReaderImpl::ImplSetAlphaPixel( sal_uInt32 nY, sal_uInt32 nX, mpAcc->SetPixel( nY, nX, rBitmapColor ); if (!mpMaskAcc) return; - mpMaskAcc->SetPixelIndex( nY, nX, ~nAlpha ); + mpMaskAcc->SetPixel(nY, nX, BitmapColor(~nAlpha)); } sal_uInt32 PNGReaderImpl::ImplReadsal_uInt32() commit 7c85a941c0c26c54e2daf10a934aa24cfd1815d3 Author: Caolán McNamara <caol...@redhat.com> Date: Tue Feb 7 11:28:33 2017 +0000 animation duration/scale etc don't fill horizontal space (cherry picked from commit d18089ec0a2a8758eda889a7b9b23b66128484d5) Change-Id: Ie211827c2f8231384b98fb08e0371a839e3dc41c Reviewed-on: https://gerrit.libreoffice.org/33997 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> (cherry picked from commit 43d64e9b0b634a682f5987bc6401e3207af25598) diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index 8d9434b..c0a5449 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -117,6 +117,7 @@ PresetPropertyBox::PresetPropertyBox( sal_Int32 nControlType, vcl::Window* pPare : PropertySubControl( nControlType ), maModifyLink(rModifyHdl) { mpControl = VclPtr<ListBox>::Create( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN ); + mpControl->set_hexpand(true); mpControl->SetDropDownLineCount( 10 ); mpControl->SetSelectHdl( LINK(this, PresetPropertyBox, OnSelect) ); mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_PRESETPROPERTYBOX ); @@ -200,6 +201,7 @@ ColorPropertyBox::ColorPropertyBox( sal_Int32 nControlType, vcl::Window* pParent { mpControl = VclPtr<ColorListBox>::Create( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN ); mpControl->SetDropDownLineCount( 10 ); + mpControl->set_hexpand(true); mpControl->SetSelectHdl( LINK(this, ColorPropertyBox, OnSelect) ); mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_COLORPROPERTYBOX ); @@ -279,6 +281,7 @@ FontPropertyBox::FontPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, : PropertySubControl( nControlType ), maModifyHdl(rModifyHdl) { mpControl = VclPtr<FontNameBox>::Create( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN ); + mpControl->set_hexpand(true); mpControl->SetDropDownLineCount( 10 ); mpControl->SetSelectHdl( LINK(this, FontPropertyBox, ControlSelectHdl) ); mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_FONTPROPERTYBOX ); @@ -366,6 +369,7 @@ DropdownMenuBox::DropdownMenuBox( vcl::Window* pParent, Edit* pSubControl, Popup mpDropdownButton->SetPopupMenu( pMenu ); SetSubEdit( mpSubControl ); + set_hexpand(true); mpSubControl->SetParent( this ); mpSubControl->Show(); } commit 7536352820a22e32e4ea4d0c53b24d4956a4777b Author: Tor Lillqvist <t...@collabora.com> Date: Thu Jan 26 08:41:59 2017 +0200 tdf#105620: Fix placement of image embedded in graphic Change-Id: I3d399fe4aab9260817f171d4e69388a19eb85d21 Reviewed-on: https://gerrit.libreoffice.org/33789 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> (cherry picked from commit 562ea5ef1bf2dd8b110109c6d531489780b51c30) diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx index 1e41b3a..4296e14 100644 --- a/canvas/source/cairo/cairo_canvashelper.cxx +++ b/canvas/source/cairo/cairo_canvashelper.cxx @@ -794,6 +794,12 @@ namespace cairocanvas aScaledTextureMatrix.x0 = basegfx::fround( aScaledTextureMatrix.x0 ); aScaledTextureMatrix.y0 = basegfx::fround( aScaledTextureMatrix.y0 ); + + double x1, y1, x2, y2; + cairo_path_extents(pCairo, &x1, &y1, &x2, &y2); + aScaledTextureMatrix.x0 -= (x1 * aScaledTextureMatrix.xx); + aScaledTextureMatrix.y0 -= (y1 * aScaledTextureMatrix.yy); + cairo_pattern_set_matrix( pPattern, &aScaledTextureMatrix ); cairo_set_source( pCairo, pPattern ); commit 5c330fdaeb86b298c9c404ee74996865f2854e71 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Fri Feb 3 08:35:59 2017 +0100 tdf#105707 PPTX import: warn when SmartArt is missing DrawingML fallback By the time DiagramGraphicDataContext::onCreateContext() completes, we know if there will be a DrawingML fallback for the SmartArt (called ExtDrawing in the code) or not. Warn about this case once at the end of the import when in interactive mode. Headless mode silently ignores the warning as expected. (cherry picked from commit ae828495be9c2ac5fdb4c1747ed7bdd51e5d87a7) Conflicts: include/svx/dialogs.hrc oox/source/core/xmlfilterbase.cxx Change-Id: I2bfeeedcaa244f08d8a0c208167e79d7bb697e6d Reviewed-on: https://gerrit.libreoffice.org/33873 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> (cherry picked from commit 3687612a93813449cfc68ce5ece3b785560b2e58) diff --git a/include/oox/core/xmlfilterbase.hxx b/include/oox/core/xmlfilterbase.hxx index 87f408f..45a179e 100644 --- a/include/oox/core/xmlfilterbase.hxx +++ b/include/oox/core/xmlfilterbase.hxx @@ -231,6 +231,10 @@ public: bool isMSO2007Document() const; + /// Signal that an MSO 2007-created SmartArt was found, need to warn the + /// user about it. + void setMissingExtDrawing(); + void checkDocumentProperties( css::uno::Reference<css::document::XDocumentProperties> xDocProps); @@ -254,6 +258,8 @@ private: sal_Int32 mnRelId; sal_Int32 mnMaxDocId; bool mbMSO2007; +protected: + bool mbMissingExtDrawing; }; } // namespace core diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc index afa3889..b73bc18 100644 --- a/include/svx/dialogs.hrc +++ b/include/svx/dialogs.hrc @@ -999,9 +999,10 @@ #define RID_SVXSTR_ERR_REPEAT_PASSWD (SVX_OOO_BUILD_START + 8) // 1238 #define RID_SVXBMP_ZOOM_PAGE (SVX_OOO_BUILD_START + 9) // 1239 #define RID_SVXSTR_FIT_SLIDE (SVX_OOO_BUILD_START + 10) // 1240 +#define RID_SVXSTR_WARN_MISSING_SMARTART (SVX_OOO_BUILD_START + 11) // 1241 // sidebar-related resources -#define RID_SVX_SIDEBAR_BEGIN (RID_SVX_START + 1241) +#define RID_SVX_SIDEBAR_BEGIN (RID_SVX_START + 1242) #define IMG_SPACE3 (RID_SVX_SIDEBAR_BEGIN + 0) #define IMG_INDENT_HANG (RID_SVX_SIDEBAR_BEGIN + 1) #define IMG_NONE_ICON (RID_SVX_SIDEBAR_BEGIN + 21) diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 3cda81e..b6b18af 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -192,7 +192,8 @@ XmlFilterBase::XmlFilterBase( const Reference< XComponentContext >& rxContext ) mxImpl( new XmlFilterBaseImpl( rxContext ) ), mnRelId( 1 ), mnMaxDocId( 0 ), - mbMSO2007(false) + mbMSO2007(false), + mbMissingExtDrawing(false) { } @@ -919,6 +920,11 @@ bool XmlFilterBase::isMSO2007Document() const return mbMSO2007; } +void XmlFilterBase::setMissingExtDrawing() +{ + mbMissingExtDrawing = true; +} + } // namespace core } // namespace oox diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx index 116f793..a1b6419 100644 --- a/oox/source/drawingml/graphicshapecontext.cxx +++ b/oox/source/drawingml/graphicshapecontext.cxx @@ -269,6 +269,11 @@ ContextHandlerRef DiagramGraphicDataContext::onCreateContext( ::sal_Int32 aEleme << "," << mpShapePtr->getSize().Width << "," << mpShapePtr->getSize().Height <<")"); + + // No DrawingML fallback, need to warn the user at the end. + if (mpShapePtr->getExtDrawings().empty()) + getFilter().setMissingExtDrawing(); + break; } default: diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx index 2cfe355..df84f79 100644 --- a/oox/source/ppt/pptimport.cxx +++ b/oox/source/ppt/pptimport.cxx @@ -22,6 +22,13 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <osl/diagnose.h> +#include <vcl/msgbox.hxx> +#include <vcl/svapp.hxx> +#include <svtools/sfxecode.hxx> +#include <svtools/ehdl.hxx> +#include <svtools/svtools.hrc> +#include <tools/urlobj.hxx> +#include <svx/dialogs.hrc> #include "oox/ppt/pptimport.hxx" #include "oox/drawingml/chart/chartconverter.hxx" #include "oox/dump/pptxdumper.hxx" @@ -89,7 +96,26 @@ bool PowerPointImport::importDocument() OUString aFragmentPath = getFragmentPathFromFirstTypeFromOfficeDoc( "officeDocument" ); FragmentHandlerRef xPresentationFragmentHandler( new PresentationFragmentHandler( *this, aFragmentPath ) ); maTableStyleListPath = xPresentationFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( "tableStyles" ); - return importFragment( xPresentationFragmentHandler ); + bool bRet = importFragment(xPresentationFragmentHandler); + + if (mbMissingExtDrawing) + { + // Construct a warning message. + INetURLObject aURL(getFileUrl()); + SfxErrorContext aContext(ERRCTX_SFX_OPENDOC, aURL.getName(INetURLObject::LAST_SEGMENT), nullptr, RID_ERRCTX); + OUString aWarning; + aContext.GetString(ERRCODE_WARNING_MASK, aWarning); + aWarning += ":\n"; + static ResMgr* pResMgr = ResMgr::CreateResMgr("svx", Application::GetSettings().GetUILanguageTag()); + aWarning += ResId(RID_SVXSTR_WARN_MISSING_SMARTART, *pResMgr).toString(); + + // Show it. + WinBits eBits = WB_OK | WB_DEF_OK; + ScopedVclPtrInstance<WarningBox> pBox(nullptr, eBits, aWarning); + pBox->Execute(); + } + + return bRet; } diff --git a/svx/source/stbctrls/stbctrls.src b/svx/source/stbctrls/stbctrls.src index 0337f77..2be3e63 100644 --- a/svx/source/stbctrls/stbctrls.src +++ b/svx/source/stbctrls/stbctrls.src @@ -119,6 +119,12 @@ String RID_SVXSTR_DOC_LOAD String RID_SVXSTR_FIT_SLIDE { Text [ en-US ] = "Fit slide to current window."; +} +; + +String RID_SVXSTR_WARN_MISSING_SMARTART +{ + Text [ en-US ] = "Could not load all SmartArts. Saving in Microsoft Office 2010 or later would avoid this issue."; }; String RID_SVXSTR_ZOOMTOOL_HINT
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits