filter/source/svg/svgfilter.cxx | 44 ++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-)
New commits: commit 48b6965c1cbbd8087d476c74fc2c20faa3e5e2a8 Author: Marco Cecchetti <marco.cecche...@collabora.com> AuthorDate: Wed Jun 14 14:13:09 2023 +0200 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Oct 15 20:26:58 2023 +0200 fixup for: 7523efa svg export filter: not export hidden slides It seems that the Visible property does not always exist That was causing a failure in Online Impress: - swicth to master view - select any object in the master slide - result: the object is not selected or getting focus and the server report an error Change-Id: I77b0211c6e13da1804457ba48098bbee821b7d4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153049 Reviewed-by: Gökay ŞATIR <gokaysa...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157980 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx index 3a08bda76078..71483c209949 100644 --- a/filter/source/svg/svgfilter.cxx +++ b/filter/source/svg/svgfilter.cxx @@ -441,10 +441,16 @@ bool SVGFilter::filterImpressOrDraw( const Sequence< PropertyValue >& rDescripto Reference< XPropertySet > xPropSet( xDrawPage, UNO_QUERY ); bool bIsSlideVisible = true; // default: true - xPropSet->getPropertyValue( "Visible" ) >>= bIsSlideVisible; - if (!bIsSlideVisible) - continue; - + if (xPropSet.is()) + { + Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); + if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("Visible")) + { + xPropSet->getPropertyValue( "Visible" ) >>= bIsSlideVisible; + if (!bIsSlideVisible) + continue; + } + } mSelectedPages.push_back(xDrawPage); } } @@ -494,10 +500,16 @@ bool SVGFilter::filterImpressOrDraw( const Sequence< PropertyValue >& rDescripto uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), uno::UNO_QUERY ); Reference< XPropertySet > xPropSet( xDrawPage, UNO_QUERY ); bool bIsSlideVisible = true; // default: true - xPropSet->getPropertyValue( "Visible" ) >>= bIsSlideVisible; - if (!bIsSlideVisible) - continue; - + if (xPropSet.is()) + { + Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); + if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("Visible")) + { + xPropSet->getPropertyValue( "Visible" ) >>= bIsSlideVisible; + if (!bIsSlideVisible) + continue; + } + } mSelectedPages.push_back(xDrawPage); } } commit ca62ba974cc9ff737b82a450aabe7b8ef778207c Author: Marco Cecchetti <marco.cecche...@collabora.com> AuthorDate: Fri Jun 9 15:16:04 2023 +0200 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Oct 15 20:26:52 2023 +0200 svg export filter: not export hidden slides Change-Id: I6010f27812a783fd27a423a0f34e30a1b0c584f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152798 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Pranam Lashkari <lpra...@collabora.com> (cherry picked from commit 7523efa63a1334b36ad0a602054423b7f3c629b8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157727 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx index 963a9ae2c4d4..3a08bda76078 100644 --- a/filter/source/svg/svgfilter.cxx +++ b/filter/source/svg/svgfilter.cxx @@ -430,12 +430,23 @@ bool SVGFilter::filterImpressOrDraw( const Sequence< PropertyValue >& rDescripto { Sequence< Reference< XInterface > > aSelectedPageSequence; aSelection >>= aSelectedPageSequence; - mSelectedPages.resize( aSelectedPageSequence.getLength() ); - for( size_t j=0; j<mSelectedPages.size(); ++j ) + sal_Int32 nCount = aSelectedPageSequence.getLength(); + if (nCount > 0) { - uno::Reference< drawing::XDrawPage > xDrawPage( aSelectedPageSequence[j], - uno::UNO_QUERY ); - mSelectedPages[j] = xDrawPage; + size_t nSelectedPageCount = nCount; + for( size_t j=0; j<nSelectedPageCount; ++j ) + { + uno::Reference< drawing::XDrawPage > xDrawPage( aSelectedPageSequence[j], + uno::UNO_QUERY ); + + Reference< XPropertySet > xPropSet( xDrawPage, UNO_QUERY ); + bool bIsSlideVisible = true; // default: true + xPropSet->getPropertyValue( "Visible" ) >>= bIsSlideVisible; + if (!bIsSlideVisible) + continue; + + mSelectedPages.push_back(xDrawPage); + } } // and stop looping. It is likely not getting better @@ -470,19 +481,24 @@ bool SVGFilter::filterImpressOrDraw( const Sequence< PropertyValue >& rDescripto { sal_Int32 nDPCount = xDrawPages->getCount(); - mSelectedPages.resize( nPageToExport != -1 ? 1 : nDPCount ); sal_Int32 i; for( i = 0; i < nDPCount; ++i ) { if( nPageToExport != -1 && nPageToExport == i ) { uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), uno::UNO_QUERY ); - mSelectedPages[0] = xDrawPage; + mSelectedPages.push_back(xDrawPage); } else { uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), uno::UNO_QUERY ); - mSelectedPages[i] = xDrawPage; + Reference< XPropertySet > xPropSet( xDrawPage, UNO_QUERY ); + bool bIsSlideVisible = true; // default: true + xPropSet->getPropertyValue( "Visible" ) >>= bIsSlideVisible; + if (!bIsSlideVisible) + continue; + + mSelectedPages.push_back(xDrawPage); } } }