[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/oox oox/source
include/oox/ppt/presentationfragmenthandler.hxx |6 + oox/source/ppt/presentationfragmenthandler.cxx | 137 2 files changed, 80 insertions(+), 63 deletions(-) New commits: commit 84ac58c37fffa0c8b6d55c70009515d013ad65b4 Author: Henry Castro AuthorDate: Thu Sep 28 14:23:55 2023 -0400 Commit: Caolán McNamara CommitDate: Tue Oct 3 11:28:41 2023 +0200 tdf#155512: oox: ppt: abstraction "importMasterSlide" Signed-off-by: Henry Castro Change-Id: Icfe8e3abbada7f728b2ad1f8e300a688f51d8f75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157386 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/include/oox/ppt/presentationfragmenthandler.hxx b/include/oox/ppt/presentationfragmenthandler.hxx index 7ac929ec555b..4685ea2d8316 100644 --- a/include/oox/ppt/presentationfragmenthandler.hxx +++ b/include/oox/ppt/presentationfragmenthandler.hxx @@ -38,6 +38,8 @@ namespace oox::core { class XmlFilterBase; } namespace oox::ppt { +class PowerPointImport; + class PresentationFragmentHandler final : public ::oox::core::FragmentHandler2 { public: @@ -50,6 +52,10 @@ private: void importSlide( const ::oox::core::FragmentHandlerRef& rSlideFragmentHandler, const oox::ppt::SlidePersistPtr& rPersist ); void importSlide(sal_uInt32 nSlide, bool bFirstSlide, bool bImportNotes); +oox::ppt::SlidePersistPtr importMasterSlide(const ::com::sun::star::uno::Reference<::com::sun::star::frame::XModel>& xModel, +::oox::ppt::PowerPointImport& rFilter, +const OUString& rLayoutFragmentPath, +const OUString& rMasterFragmentPath); void saveThemeToGrabBag(const oox::drawingml::ThemePtr& pThemePtr, sal_Int32 nThemeIdx); void importCustomSlideShow(std::vector& rCustomShowList); static void importSlideNames(::oox::core::XmlFilterBase& rFilter, const std::vector& rSlidePersist); diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 5f35dbdfdb1c..a0f13c83ae05 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -199,6 +199,79 @@ void PresentationFragmentHandler::importCustomSlideShow(std::vector& } } +SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const Reference& xModel, + PowerPointImport& rFilter, + const OUString& rLayoutFragmentPath, + const OUString& rMasterFragmentPath) +{ +SlidePersistPtr pMasterPersistPtr; +Reference< drawing::XDrawPage > xMasterPage; +Reference< drawing::XMasterPagesSupplier > xMPS( xModel, uno::UNO_QUERY_THROW ); +Reference< drawing::XDrawPages > xMasterPages( xMPS->getMasterPages(), uno::UNO_SET_THROW ); + +sal_Int32 nIndex; +if( rFilter.getMasterPages().empty() ) +{ +nIndex = 0; +xMasterPages->getByIndex( nIndex ) >>= xMasterPage; +} +else +{ +nIndex = xMasterPages->getCount(); +xMasterPage = xMasterPages->insertNewByIndex( nIndex ); +} + +pMasterPersistPtr = std::make_shared( rFilter, true, false, xMasterPage, + std::make_shared( Master, "com.sun.star.drawing.GroupShape" ), mpTextListStyle ); +pMasterPersistPtr->setLayoutPath( rLayoutFragmentPath ); +rFilter.getMasterPages().push_back( pMasterPersistPtr ); +rFilter.setActualSlidePersist( pMasterPersistPtr ); +FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, rMasterFragmentPath, pMasterPersistPtr, Master ) ); + +// set the correct theme +OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( u"theme" ); +if( !aThemeFragmentPath.isEmpty() ) +{ +std::map< OUString, oox::drawingml::ThemePtr >& rThemes( rFilter.getThemes() ); +std::map< OUString, oox::drawingml::ThemePtr >::iterator aIter2( rThemes.find( aThemeFragmentPath ) ); +if( aIter2 == rThemes.end() ) +{ +oox::drawingml::ThemePtr pThemePtr = std::make_shared(); +pMasterPersistPtr->setTheme( pThemePtr ); +Reference xDoc= +rFilter.importFragment(aThemeFragmentPath); + +auto pTheme = std::make_shared(); +pThemePtr->setTheme(pTheme); + +rFilter.importFragment( +new ThemeFragmentHandler(rFilter, aThemeFragmentPath, *pThemePtr, *pTheme), +Reference( +xDoc, +UNO_QUERY_THROW)); +rThemes[ aThemeFragmentPath ] = pThemePtr; +
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/oox oox/source sc/inc sc/source
include/oox/vml/vmlshape.hxx|8 +- oox/source/vml/vmlshape.cxx | 27 +++ sc/inc/postit.hxx | 20 + sc/source/core/data/postit.cxx | 78 +++-- sc/source/filter/excel/xeescher.cxx |9 +- sc/source/filter/inc/richstring.hxx |3 sc/source/filter/oox/commentsbuffer.cxx | 115 +--- sc/source/filter/oox/richstring.cxx | 14 ++- sc/source/ui/docshell/docfunc.cxx |9 +- sc/source/ui/inc/docfunc.hxx| 10 ++ 10 files changed, 214 insertions(+), 79 deletions(-) New commits: commit f17acc9d26650b051f9c59dc9646c00fd2794456 Author: Caolán McNamara AuthorDate: Fri Aug 11 10:46:53 2023 +0100 Commit: Caolán McNamara CommitDate: Tue Aug 15 13:40:21 2023 +0200 defer turning xlsx notes into SdrCaptions until activated to improve import performance Change-Id: I8dd3483372d20cbbb8694bae02a7d8b062324ff0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155613 Tested-by: Jenkins Reviewed-by: Caolán McNamara (cherry picked from commit 2bda87fd8758448267c447ba26f1932325a1338d) fairly unreadable as combined commit, but component commits are: refactor to return the position to be set by the caller instead no change in behavior intended Change-Id: I32043bdf1d29521d8503df315fa786236e272f7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155580 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara (cherry picked from commit 5aeb15e95d26ce6de28eb5f5933324828d553f41) split ShapeBase::convertShapeProperties into two parts Change-Id: I62f42e54c776f15ea83c5fc861bb4f4ff899e891 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155584 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara (cherry picked from commit c88855c45a675cf28e2cfe4fa261c2b0339f5898) move setting properties into note comments from oox to sc no change in behavior intended, the SdrCaption doesn't support the skipped conditions Change-Id: Id909ae4ed115c1ad3398d2a62c6432ff1dfde453 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155585 Tested-by: Jenkins Reviewed-by: Caolán McNamara (cherry picked from commit 6945d031e759823ab52bdf077e43196b67f594a4) avoid some UNO querying Change-Id: I5fa793ab979221252f66bdd38e6950c06a66b00a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152601 Tested-by: Jenkins Reviewed-by: Noel Grandin (cherry picked from commit 367f26ebf0f2be0c0c0ebeab1e14ee26960675e3) rearrange to collect the properties set on the annotation together and set them in one block. No behavior change intended. note: type passed as TextFitToSize seems to be wrong Change-Id: I349aeba5176ef6c10163069a73d0367469aadd6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155588 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara (cherry picked from commit e11a0e646b8eb75e102f878dc70f5196c4efbea2) split out common ScPostIt insertion piece Change-Id: Ie9d718293f907e19e29ed6f8aea4a2bf9d88dfe9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155610 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara (cherry picked from commit 5ae486eea7a381403a9f81e5aa8ef1a0a57b95b6) split out a common CreateNoteData Change-Id: Ieeaf50f3a086d01b5492eb3ab9b211f132f045ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155611 Tested-by: Jenkins Reviewed-by: Caolán McNamara (cherry picked from commit ac40c3923580e4ec0e738d57ff8b885da93301ef) add a CreateNoteFromObjectProperties which an importer can use to insert a note and defer instantiating an SdrCaption until the user activates it Change-Id: I7d4afe7857d4ee9c49e7b43c5f94150b72ce9a95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155612 Tested-by: Jenkins Reviewed-by: Caolán McNamara (cherry picked from commit 3cc72a1880d1fe2507892eabeb979aa0938dadc5) move GetEditTextObject to after it is potentially generated Change-Id: Iadd6a2b66e3131b8883cf3812b5f0a8153631abe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155661 Tested-by: Jenkins CollaboraOffice Reviewed-by: Noel Grandin Reviewed-by: Caolán McNamara diff --git a/include/oox/vml/vmlshape.hxx b/include/oox/vml/vmlshape.hxx index d46c23282324..e95e44053330 100644 --- a/include/oox/vml/vmlshape.hxx +++ b/include/oox/vml/vmlshape.hxx @@ -267,9 +267,11 @@ public: const css::uno::Reference< css::drawing::XShapes >& rxShapes, const ShapeParentAnchor* pParentAnchor = nullptr ) const; -/** Converts position and formatting into the passed existing XShape. */ -voidconvertFormatting( -
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/oox oox/source sc/source
include/oox/drawingml/color.hxx | 10 +++- oox/source/drawingml/color.cxx| 77 ++ sc/source/filter/inc/stylesbuffer.hxx |3 + sc/source/filter/oox/stylesbuffer.cxx | 17 +-- sc/source/ui/unoobj/styleuno.cxx |1 5 files changed, 102 insertions(+), 6 deletions(-) New commits: commit 1f2e110bfcd41707f2b0dbf6a296eb5cf79efe95 Author: Tomaž Vajngerl AuthorDate: Fri May 12 23:21:22 2023 +0900 Commit: Miklos Vajna CommitDate: Fri Aug 11 09:12:12 2023 +0200 sc: OOXML import of theme colors for char and background colors Change-Id: I8209238927bb425e8e306352f1fa78d63378f005 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151707 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit ea1cd4993be992b89930db4811d08a4a51b1f68d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155544 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna diff --git a/include/oox/drawingml/color.hxx b/include/oox/drawingml/color.hxx index 245e655d7c78..ea02ef8a03e4 100644 --- a/include/oox/drawingml/color.hxx +++ b/include/oox/drawingml/color.hxx @@ -37,6 +37,7 @@ namespace oox { class GraphicHelper; } namespace oox::drawingml { +model::ThemeColorType schemeTokenToThemeColorType(sal_uInt32 nToken); model::ThemeColorType schemeNameToThemeColorType(OUString const& rSchemeName); class OOX_DLLPUBLIC Color @@ -107,6 +108,13 @@ public: sal_Int16 getLumMod() const; sal_Int16 getLumOff() const; +model::ThemeColorType getThemeColorType() const +{ +return meThemeColorType; +} + +model::ComplexColor createComplexColor(const GraphicHelper& rGraphicHelper, sal_Int16 nPhClrTheme) const; + /** Returns the unaltered list of transformations for interoperability purposes */ const css::uno::Sequence< css::beans::PropertyValue >& getTransformations() const { return maInteropTransformations;} @@ -160,8 +168,8 @@ private: mutable sal_Int32 mnC2; /// Green, green%, saturation, or system default RGB. mutable sal_Int32 mnC3; /// Blue, blue%, or luminance. sal_Int32 mnAlpha;/// Alpha value (color opacity). - OUStringmsSchemeName; /// Scheme name from the a:schemeClr element for interoperability purposes +model::ThemeColorType meThemeColorType; css::uno::Sequence< css::beans::PropertyValue > maInteropTransformations; /// Unaltered list of transformations for interoperability purposes }; diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx index e9c645b99b7c..fca70e2018ab 100644 --- a/oox/source/drawingml/color.cxx +++ b/oox/source/drawingml/color.cxx @@ -250,6 +250,44 @@ model::ThemeColorType schemeNameToThemeColorType(OUString const& rSchemeName) return aIterator->second; } +model::ThemeColorType schemeTokenToThemeColorType(sal_uInt32 nToken) +{ +static std::unordered_map const constThemeColorTokenMap { +{ XML_dk1, model::ThemeColorType::Dark1 }, +{ XML_lt1, model::ThemeColorType::Light1 }, +{ XML_dk2, model::ThemeColorType::Dark2 }, +{ XML_lt2, model::ThemeColorType::Light2 }, +{ XML_accent1, model::ThemeColorType::Accent1 }, +{ XML_accent2, model::ThemeColorType::Accent2 }, +{ XML_accent3, model::ThemeColorType::Accent3 }, +{ XML_accent4, model::ThemeColorType::Accent4 }, +{ XML_accent5, model::ThemeColorType::Accent5 }, +{ XML_accent6, model::ThemeColorType::Accent6 }, +{ XML_hlink, model::ThemeColorType::Hyperlink }, +{ XML_folHlink, model::ThemeColorType::FollowedHyperlink }, +{ XML_tx1, model::ThemeColorType::Dark1 }, +{ XML_bg1, model::ThemeColorType::Light1 }, +{ XML_tx2, model::ThemeColorType::Dark2 }, +{ XML_bg2, model::ThemeColorType::Light2 }, +{ XML_dark1, model::ThemeColorType::Dark1 }, +{ XML_light1, model::ThemeColorType::Light1 }, +{ XML_dark2, model::ThemeColorType::Dark2 }, +{ XML_light2, model::ThemeColorType::Light2 }, +{ XML_text1, model::ThemeColorType::Dark1 }, +{ XML_background1, model::ThemeColorType::Light1 }, +{ XML_text2, model::ThemeColorType::Dark2 }, +{ XML_background2, model::ThemeColorType::Light2 }, +{ XML_hyperlink, model::ThemeColorType::Hyperlink }, +{ XML_followedHyperlink, model::ThemeColorType::FollowedHyperlink }, +}; + +auto aIterator = constThemeColorTokenMap.find(nToken); +if (aIterator == constThemeColorTokenMap.end()) +return model::ThemeColorType::Unknown; +else +return aIterator->second; +} + Color::Color() : meMode( COLOR_UNUSED ), mnC1( 0 ), @@ -346,6 +384,8 @@ void Color::setSchemeClr( sal_Int32 nToken ) OSL_ENSURE( nToken != XML_TOKEN_INVALID, "Color::setSchemeClr -
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/oox oox/source sd/qa sd/source
include/oox/export/drawingml.hxx | 27 - oox/source/export/drawingml.cxx | 55 oox/source/export/shapes.cxx |6 +-- sd/qa/unit/data/odp/tdf153107.odp|binary sd/qa/unit/export-tests-ooxml2.cxx | 60 +++ sd/source/filter/eppt/pptx-epptooxml.cxx |4 +- 6 files changed, 112 insertions(+), 40 deletions(-) New commits: commit df482562d2532956c197468740e2a02499a89f55 Author: Tibor Nagy AuthorDate: Mon Jan 23 09:33:13 2023 +0100 Commit: Caolán McNamara CommitDate: Tue Jun 27 14:16:25 2023 +0200 tdf#153107 OOXML export: fix scale of tile of shape background Relative scale values were exported as absolute values, resulting broken shape background. Change-Id: Ia38e125862e7f8ceff5d41754340723c3a9eb028 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145996 Tested-by: László Németh Reviewed-by: László Németh Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153576 Reviewed-by: Jaume Pujantell Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx index cdfb31af9c7c..89fb0cab1128 100644 --- a/include/oox/export/drawingml.hxx +++ b/include/oox/export/drawingml.hxx @@ -380,16 +380,18 @@ public: void WriteGrabBagGradientFill( const css::uno::Sequence< css::beans::PropertyValue >& aGradientStops, const basegfx::BGradient& rGradient); -void WriteBlipOrNormalFill( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet, -const OUString& rURLPropName ); -void WriteBlipFill( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet, -const OUString& sURLPropName ); -void WriteBlipFill( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet, - const OUString& sURLPropName, sal_Int32 nXmlNamespace ); +void WriteBlipOrNormalFill(const css::uno::Reference& rXPropSet, + const OUString& rURLPropName, const css::awt::Size& rSize = {}); +void WriteBlipFill(const css::uno::Reference& rXPropSet, + const OUString& sURLPropName, const css::awt::Size& rSize = {}); +void WriteBlipFill(const css::uno::Reference& rXPropSet, + const css::awt::Size& rSize, const OUString& sURLPropName, + sal_Int32 nXmlNamespace); void WriteXGraphicBlipFill(css::uno::Reference const & rXPropSet, css::uno::Reference const & rxGraphic, - sal_Int32 nXmlNamespace, bool bWriteMode, bool bRelPathToMedia = false); + sal_Int32 nXmlNamespace, bool bWriteMode, + bool bRelPathToMedia = false, css::awt::Size const& rSize = {}); void WritePattFill( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet ); void WritePattFill(const css::uno::Reference& rXPropSet, @@ -408,7 +410,8 @@ public: css::uno::Reference const & rxGraphic); void WriteXGraphicTile(css::uno::Reference const& rXPropSet, - css::uno::Reference const& rxGraphic); + css::uno::Reference const& rxGraphic, + css::awt::Size const& rSize); void WriteLinespacing(const css::style::LineSpacing& rLineSpacing, float fFirstCharHeight); @@ -418,8 +421,9 @@ public: void WriteImageBrightnessContrastTransparence(css::uno::Reference const & rXPropSet); -void WriteXGraphicBlipMode(css::uno::Reference const & rXPropSet, - css::uno::Reference const & rxGraphic); +void WriteXGraphicBlipMode(css::uno::Reference const& rXPropSet, + css::uno::Reference const& rxGraphic, + css::awt::Size const& rSize); void WriteShapeTransformation(const css::uno::Reference< css::drawing::XShape >& rXShape, sal_Int32 nXmlNamespace, bool bFlipH = false, bool bFlipV = false, bool bSuppressRotation = false, bool bSuppressFlipping = false, bool bFlippedBeforeRotation = false); @@ -459,7 +463,8 @@ public: void WriteEmptyCustomGeometry(); void WritePolyPolygon(const css::uno::Reference& rXShape, const bool bClosed); -void WriteFill( const css::uno::Reference< css::beans::XPropertySet >& xPropSet ); +void WriteFill(const css::uno::Reference& xPropSet, + const css::awt::Size& rSize = {}); void WriteShapeStyle( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet ); void WriteShapeEffects( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet ); void WriteShapeEffect( std::u16string_view sName, const css::uno::Sequence<