Rebased ref, commits from common ancestor: commit 2b1c644e8e4013d6c1160d71c7b64a7cf3905a63 Author: Sarper Akdemir <sarper.akde...@collabora.com> AuthorDate: Wed Jun 9 08:24:12 2021 +0300 Commit: Sarper Akdemir <sarper.akde...@collabora.com> CommitDate: Thu Jun 10 18:27:54 2021 +0300
tdf#59323: pptx export: slide footers roundtrip unit test Roundtrip test that checks the slide footers, and their placeholder indexes. Change-Id: I9c4b819092ac6699617d71538c35b066d6e6f974 diff --git a/sd/qa/unit/data/pptx/tdf59323.pptx b/sd/qa/unit/data/pptx/tdf59323.pptx new file mode 100755 index 000000000000..0660c0af4f23 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf59323.pptx differ diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index b2d30225af44..f057dd8e7e05 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -149,6 +149,7 @@ public: void testTdf118825(); void testTextColumns_tdf140852(); void testTextColumns_3columns(); + void testTdf59323_slideFooters(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -213,6 +214,7 @@ public: CPPUNIT_TEST(testTdf118825); CPPUNIT_TEST(testTextColumns_tdf140852); CPPUNIT_TEST(testTextColumns_3columns); + CPPUNIT_TEST(testTdf59323_slideFooters); CPPUNIT_TEST_SUITE_END(); @@ -1742,6 +1744,41 @@ void SdOOXMLExportTest2::testTextColumns_3columns() tempFile.EnableKillingFile(); } +void SdOOXMLExportTest2::testTdf59323_slideFooters() +{ + ::sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf59323.pptx"), PPTX); + + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + + uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(), + uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDoc->getDrawPages()->getCount()); + + for (int nPageIndex = 0; nPageIndex < 3; nPageIndex++) + { + uno::Reference<drawing::XDrawPage> xPage(getPage(0, xDocShRef)); + uno::Reference<beans::XPropertySet> xPropSet(xPage, uno::UNO_QUERY); + CPPUNIT_ASSERT(xPropSet->getPropertyValue("IsFooterVisible") == true); + CPPUNIT_ASSERT(xPropSet->getPropertyValue("IsDateTimeVisible") == true); + CPPUNIT_ASSERT(xPropSet->getPropertyValue("IsPageNumberVisible") == true); + } + + // Test placeholder indexes + xmlDocUniquePtr pXmlDocMaster = parseExport(tempFile, "ppt/slideMasters/slideMaster1.xml"); + assertXPath(pXmlDocMaster, "//p:ph [@type='dt']", "idx", "2"); + assertXPath(pXmlDocMaster, "//p:ph [@type='ftr']", "idx", "3"); + assertXPath(pXmlDocMaster, "//p:ph [@type='sldNum']", "idx", "4"); + + xmlDocUniquePtr pXmlDocSlide1 = parseExport(tempFile, "ppt/slides/slide1.xml"); + assertXPath(pXmlDocSlide1, "//p:ph [@type='dt']", "idx", "2"); + assertXPath(pXmlDocSlide1, "//p:ph [@type='ftr']", "idx", "3"); + assertXPath(pXmlDocSlide1, "//p:ph [@type='sldNum']", "idx", "4"); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2); CPPUNIT_PLUGIN_IMPLEMENT(); commit 5990cbbb7b921a7967f1de56c2d39a24743a049a Author: Sarper Akdemir <sarper.akde...@collabora.com> AuthorDate: Wed Jun 9 08:21:27 2021 +0300 Commit: Sarper Akdemir <sarper.akde...@collabora.com> CommitDate: Thu Jun 10 18:24:28 2021 +0300 tdf#59323: pptx export: add support for slide footers Adds support for exporting slide footers to PPTX. Slide footers are exported as shapes that use placeholder indexes to refer to the shapes on master. To make the references work they are exported to layout slides too. Change-Id: I8bfde520b0aec66405523c719844e69c6fc15b79 diff --git a/sd/source/filter/eppt/epptooxml.hxx b/sd/source/filter/eppt/epptooxml.hxx index f3a5377ac1cc..42fb0bf99bf1 100644 --- a/sd/source/filter/eppt/epptooxml.hxx +++ b/sd/source/filter/eppt/epptooxml.hxx @@ -124,6 +124,9 @@ private: @returns Placeholder index */ unsigned CreateNewPlaceholderIndex(const css::uno::Reference<css::drawing::XShape>& rXShape); + css::uno::Reference<css::drawing::XShape> GetReferencedPlaceholderXShape(const PlaceholderType eType, PageType ePageType) const; + void WritePlaceholderReferenceShapes(PowerPointShapeExport& rDML, PageType ePageType); + /// Should we export as .pptm, ie. do we contain macros? bool mbPptm; diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 85ac7ddf6b45..26f5d864cbb5 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -28,6 +28,7 @@ #include <comphelper/sequenceashashmap.hxx> #include <comphelper/storagehelper.hxx> +#include <comphelper/xmltools.hxx> #include <sax/fshelper.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> @@ -57,6 +58,10 @@ #include "pptx-animations.hxx" #include "../ppt/pptanimations.hxx" +#include <svx/svdpage.hxx> +#include <svx/unoapi.hxx> +#include <sdpage.hxx> + #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/document/XStorageBasedDocument.hpp> #include <utility> @@ -115,7 +120,11 @@ public: ShapeExport& WriteTextShape(const Reference< XShape >& xShape) override; ShapeExport& WriteUnknownShape(const Reference< XShape >& xShape) override; ShapeExport& WritePlaceholderShape(const Reference< XShape >& xShape, PlaceholderType ePlaceholder); + /** Writes a placeholder shape that references the placeholder on the master slide */ + ShapeExport& WritePlaceholderReferenceShape(PlaceholderType ePlaceholder, unsigned nReferencedPlaceholderIdx, PageType ePageType, Reference<XPropertySet>& rXPagePropSet); ShapeExport& WritePageShape(const Reference< XShape >& xShape, PageType ePageType, bool bPresObj); + /** Writes textbody of a placeholder that references the placeholder on the master slide */ + ShapeExport& WritePlaceholderReferenceTextBody(PlaceholderType ePlaceholder, PageType ePageType, const Reference<XPropertySet> xPagePropSet); // helper parts bool WritePlaceholder(const Reference< XShape >& xShape, PlaceholderType ePlaceholder, bool bMaster); @@ -1504,6 +1513,8 @@ void PowerPointExport::WriteShapeTree(const FSHelperPtr& pFS, PageType ePageType } } + if ( ePageType == NORMAL || ePageType == LAYOUT ) + WritePlaceholderReferenceShapes(aDML, ePageType); pFS->endElementNS(XML_p, XML_spTree); } @@ -1596,13 +1607,135 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderShape(const Reference< XShap } mpFS->endElementNS(XML_p, XML_spPr); - WriteTextBox(xShape, XML_p); + WriteTextBox(xShape, XML_p, bUsePlaceholderIndex); + + mpFS->endElementNS(XML_p, XML_sp); + + return *this; +} + +ShapeExport& PowerPointShapeExport::WritePlaceholderReferenceShape( + PlaceholderType ePlaceholder, unsigned nReferencedPlaceholderIdx, PageType ePageType, + Reference<XPropertySet>& rXPagePropSet) +{ + mpFS->startElementNS(XML_p, XML_sp); + + // non visual shape properties + mpFS->startElementNS(XML_p, XML_nvSpPr); + const OString aPlaceholderID("PlaceHolder " + OString::number(mnShapeIdMax++)); + GetFS()->singleElementNS(XML_p, XML_cNvPr, XML_id, OString::number(mnShapeIdMax), XML_name, + aPlaceholderID.getStr()); + + mpFS->startElementNS(XML_p, XML_cNvSpPr); + mpFS->singleElementNS(XML_a, XML_spLocks, XML_noGrp, "1"); + mpFS->endElementNS(XML_p, XML_cNvSpPr); + mpFS->startElementNS(XML_p, XML_nvPr); + + const char* pType = getPlaceholderTypeName(ePlaceholder); + mpFS->singleElementNS(XML_p, XML_ph, XML_type, pType, XML_idx, + OString::number(nReferencedPlaceholderIdx)); + mpFS->endElementNS(XML_p, XML_nvPr); + mpFS->endElementNS(XML_p, XML_nvSpPr); + + // visual shape properties + mpFS->startElementNS(XML_p, XML_spPr); + mpFS->endElementNS(XML_p, XML_spPr); + + WritePlaceholderReferenceTextBody(ePlaceholder, ePageType, rXPagePropSet); mpFS->endElementNS(XML_p, XML_sp); return *this; } +ShapeExport& PowerPointShapeExport::WritePlaceholderReferenceTextBody( + PlaceholderType ePlaceholder, PageType ePageType, const Reference<XPropertySet> xPagePropSet) +{ + mpFS->startElementNS(XML_p, XML_txBody); + mpFS->singleElementNS(XML_a, XML_bodyPr); + mpFS->startElementNS(XML_a, XML_p); + + switch (ePlaceholder) + { + case Header: + break; + case Footer: + { + OUString aFooterText; + if (ePageType == LAYOUT) + { + aFooterText = "Footer"; + } + else + { + xPagePropSet->getPropertyValue("FooterText") >>= aFooterText; + } + mpFS->startElementNS(XML_a, XML_r); + mpFS->startElementNS(XML_a, XML_t); + mpFS->writeEscaped(aFooterText); + mpFS->endElementNS(XML_a, XML_t); + mpFS->endElementNS(XML_a, XML_r); + break; + } + case SlideNumber: + { + OUString aSlideNum; + int nSlideNum = 0; + if (ePageType == LAYOUT) + { + aSlideNum = "<#>"; + } + else + { + xPagePropSet->getPropertyValue("Number") >>= nSlideNum; + aSlideNum = OUString::number(nSlideNum); + } + OString aUUID(comphelper::xml::generateGUIDString()); + mpFS->startElementNS(XML_a, XML_fld, XML_id, aUUID.getStr(), XML_type, "slidenum"); + mpFS->startElementNS(XML_a, XML_t); + mpFS->writeEscaped(aSlideNum); + mpFS->endElementNS(XML_a, XML_t); + mpFS->endElementNS(XML_a, XML_fld); + break; + } + case DateAndTime: + { + OString aDateTimeType = "datetime1"; + OUString aDateTimeText; + int nDateTimeFormat; + if (ePageType == LAYOUT) + { + aDateTimeText = "Date"; + } + else + { + xPagePropSet->getPropertyValue("DateTimeText") >>= aDateTimeText; + xPagePropSet->getPropertyValue("DateTimeFormat") >>= nDateTimeFormat; + + // 4 LSBs represent the date + SvxDateFormat eDate = static_cast<SvxDateFormat>(nDateTimeFormat & 0x0f); + // the 4 bits after the date bits represent the time + SvxTimeFormat eTime = static_cast<SvxTimeFormat>(nDateTimeFormat >> 4); + aDateTimeType = OUStringToOString(GetDatetimeTypeFromDateTime(eDate, eTime), + RTL_TEXTENCODING_UTF8); + if (aDateTimeType.equals("datetime")) + aDateTimeType = "datetime1"; + } + OString aUUID(comphelper::xml::generateGUIDString()); + mpFS->startElementNS(XML_a, XML_fld, XML_id, aUUID.getStr(), XML_type, aDateTimeType); + mpFS->endElementNS(XML_a, XML_fld); + break; + } + default: + SAL_INFO("sd.eppt", "warning: no defined textbody for referenced placeholder type: " + << ePlaceholder); + } + mpFS->endElementNS(XML_a, XML_p); + mpFS->endElementNS(XML_p, XML_txBody); + + return *this; +} + #define SYS_COLOR_SCHEMES " <a:dk1>\ <a:sysClr val=\"windowText\" lastClr=\"000000\"/>\ </a:dk1>\ @@ -2087,12 +2220,106 @@ void PowerPointExport::WriteDiagram(const FSHelperPtr& pFS, PowerPointShapeExpor pFS->endElementNS(XML_p, XML_graphicFrame); } +void PowerPointExport::WritePlaceholderReferenceShapes(PowerPointShapeExport& rDML, PageType ePageType) +{ + bool bCheckProps = ePageType == NORMAL; + Reference<XShape> xShape; + Any aAny; + OUString aText; + if (ePageType == LAYOUT + || (bCheckProps && PropValue::GetPropertyValue(aAny, mXPagePropSet, "IsFooterVisible", true) + && aAny == true && GetPropertyValue(aAny, mXPagePropSet, "FooterText", true) + && (aAny >>= aText) && !aText.isEmpty())) + { + if ((xShape = GetReferencedPlaceholderXShape(Footer, ePageType))) + rDML.WritePlaceholderReferenceShape(Footer, + maPlaceholderShapeToIndexMap.find(xShape)->second, + ePageType, mXPagePropSet); + } + + if (ePageType == LAYOUT + || (bCheckProps + && PropValue::GetPropertyValue(aAny, mXPagePropSet, "IsPageNumberVisible", true) + && aAny == true)) + { + if ((xShape = GetReferencedPlaceholderXShape(SlideNumber, ePageType))) + rDML.WritePlaceholderReferenceShape(SlideNumber, + maPlaceholderShapeToIndexMap.find(xShape)->second, + ePageType, mXPagePropSet); + } + + if (ePageType == LAYOUT + || (bCheckProps + && PropValue::GetPropertyValue(aAny, mXPagePropSet, "IsDateTimeVisible", true) + && aAny == true + && ((GetPropertyValue(aAny, mXPagePropSet, "DateTimeText", true) && (aAny >>= aText) + && !aText.isEmpty()) + || mXPagePropSet->getPropertyValue("IsDateTimeFixed") == false))) + { + if ((xShape = GetReferencedPlaceholderXShape(DateAndTime, ePageType))) + rDML.WritePlaceholderReferenceShape(DateAndTime, + maPlaceholderShapeToIndexMap.find(xShape)->second, + ePageType, mXPagePropSet); + } +} + unsigned PowerPointExport::CreateNewPlaceholderIndex(const css::uno::Reference<XShape> &rXShape) { maPlaceholderShapeToIndexMap.insert({rXShape, ++mnPlaceholderIndexMax}); return mnPlaceholderIndexMax; } +Reference<XShape> PowerPointExport::GetReferencedPlaceholderXShape(const PlaceholderType eType, + PageType ePageType) const +{ + PresObjKind ePresObjKind = PresObjKind::NONE; + switch (eType) + { + case oox::core::None: + break; + case oox::core::SlideImage: + break; + case oox::core::Notes: + break; + case oox::core::Header: + ePresObjKind = PresObjKind::Header; + break; + case oox::core::Footer: + ePresObjKind = PresObjKind::Footer; + break; + case oox::core::SlideNumber: + ePresObjKind = PresObjKind::SlideNumber; + break; + case oox::core::DateAndTime: + ePresObjKind = PresObjKind::DateTime; + break; + case oox::core::Outliner: + break; + case oox::core::Title: + ePresObjKind = PresObjKind::Title; + break; + case oox::core::Subtitle: + break; + } + if (ePresObjKind != PresObjKind::NONE) + { + SdPage* pMasterPage; + if (ePageType == LAYOUT) + { + // since Layout pages do not have drawpages themselves - mXDrawPage is still the master they reference to.. + pMasterPage = SdPage::getImplementation(mXDrawPage); + } + else + { + pMasterPage + = &static_cast<SdPage&>(SdPage::getImplementation(mXDrawPage)->TRG_GetMasterPage()); + } + if (SdrObject* pMasterFooter = pMasterPage->GetPresObj(ePresObjKind)) + return GetXShapeForSdrObject(pMasterFooter); + } + return nullptr; +} + // UNO component extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface* css_comp_Impress_oox_PowerPointExport(uno::XComponentContext* rxCtxt, commit 003f7359f4d28e51c1cff08ccf1280c442fcedfd Author: Sarper Akdemir <sarper.akde...@collabora.com> AuthorDate: Wed Jun 9 07:58:44 2021 +0300 Commit: Sarper Akdemir <sarper.akde...@collabora.com> CommitDate: Thu Jun 10 18:24:27 2021 +0300 tdf#59323: pptx export: add initial support for lstStyles in textboxes Adds initial support for writing lstStyles that are specific to a shape. Current implementation only writes first paragraph and first textruns properties in it. Made WriteParagraphProperties return a bool that determines whether or not it wrote a pPr tag. Needed this since lvl1pPr tag should be started even if there was no paragraph properties since run properties also written inside it. Change-Id: Ie0cfc9b9f221093db3a1111ca29140a6dfb5e8ad diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx index 6c15d8cc05fa..9b59b5fa8654 100644 --- a/include/oox/export/drawingml.hxx +++ b/include/oox/export/drawingml.hxx @@ -276,10 +276,19 @@ public: void WriteTransformation(const css::uno::Reference< css::drawing::XShape >& xShape, const tools::Rectangle& rRectangle, sal_Int32 nXmlNamespace, bool bFlipH = false, bool bFlipV = false, sal_Int32 nRotation = 0, bool bIsGroupShape = false); - void WriteText( const css::uno::Reference< css::uno::XInterface >& rXIface, bool bBodyPr, bool bText = true, sal_Int32 nXmlNamespace = 0); + void WriteText( const css::uno::Reference< css::uno::XInterface >& rXIface, bool bBodyPr, bool bText = true, sal_Int32 nXmlNamespace = 0, bool bWritePropertiesAsLstStyles = false); + + /** Populates the lstStyle with the shape's text run and paragraph properties */ + void WriteLstStyles(const css::uno::Reference<css::text::XTextContent>& rParagraph, + bool& rbOverridingCharHeight, sal_Int32& rnCharHeight, + const css::uno::Reference<css::beans::XPropertySet>& rXShapePropSet); void WriteParagraph( const css::uno::Reference< css::text::XTextContent >& rParagraph, bool& rbOverridingCharHeight, sal_Int32& rnCharHeight, const css::uno::Reference< css::beans::XPropertySet >& rXShapePropSet); - void WriteParagraphProperties(const css::uno::Reference< css::text::XTextContent >& rParagraph, float fFirstCharHeight); + /** Writes paragraph properties + + @returns true if there was paragraph properties written false otherwise + */ + bool WriteParagraphProperties(const css::uno::Reference< css::text::XTextContent >& rParagraph, float fFirstCharHeight, const sal_Int32 nElement = XML_pPr ); void WriteParagraphNumbering(const css::uno::Reference< css::beans::XPropertySet >& rXPropSet, float fFirstCharHeight, sal_Int16 nLevel ); void WriteParagraphTabStops(const css::uno::Reference<css::beans::XPropertySet>& rXPropSet); diff --git a/include/oox/export/shapes.hxx b/include/oox/export/shapes.hxx index 6ac3aa754cc5..3e9bf364d400 100644 --- a/include/oox/export/shapes.hxx +++ b/include/oox/export/shapes.hxx @@ -179,7 +179,7 @@ public: * @return <tt>*this</tt> */ ShapeExport& WriteShape( const css::uno::Reference< css::drawing::XShape >& xShape ); - ShapeExport& WriteTextBox( const css::uno::Reference< css::uno::XInterface >& xIface, sal_Int32 nXmlNamespace ); + ShapeExport& WriteTextBox( const css::uno::Reference< css::uno::XInterface >& xIface, sal_Int32 nXmlNamespace, bool bWritePropertiesAsLstStyles = false ); virtual ShapeExport& WriteTextShape( const css::uno::Reference< css::drawing::XShape >& xShape ); ShapeExport& diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 37ecdcaf0437..b5ef9069f89f 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1899,7 +1899,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool else if (GetProperty(rXPropSet, "CharHeight")) { nSize = static_cast<sal_Int32>(100*(*o3tl::doAccess<float>(mAny))); - if ( nElement == XML_rPr ) + if ( nElement == XML_rPr || nElement == XML_defRPr ) { rbOverridingCharHeight = true; rnCharHeight = nSize; @@ -2822,14 +2822,14 @@ void DrawingML::WriteLinespacing( const LineSpacing& rSpacing ) } } -void DrawingML::WriteParagraphProperties( const Reference< XTextContent >& rParagraph, float fFirstCharHeight) +bool DrawingML::WriteParagraphProperties( const Reference< XTextContent >& rParagraph, float fFirstCharHeight, sal_Int32 nElement) { Reference< XPropertySet > rXPropSet( rParagraph, UNO_QUERY ); Reference< XPropertyState > rXPropState( rParagraph, UNO_QUERY ); PropertyState eState; if( !rXPropSet.is() || !rXPropState.is() ) - return; + return false; sal_Int16 nLevel = -1; if (GetProperty(rXPropSet, "NumberingLevel")) @@ -2878,17 +2878,17 @@ void DrawingML::WriteParagraphProperties( const Reference< XTextContent >& rPara if( !(nLevel != -1 || nAlignment != style::ParagraphAdjust_LEFT || bHasLinespacing) ) - return; + return false; if (nParaLeftMargin) // For Paragraph - mpFS->startElementNS( XML_a, XML_pPr, + mpFS->startElementNS( XML_a, nElement, XML_lvl, sax_fastparser::UseIf(OString::number(nLevel), nLevel > 0), XML_marL, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nParaLeftMargin)), nParaLeftMargin > 0), XML_indent, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nParaFirstLineIndent)), nParaFirstLineIndent != 0), XML_algn, GetAlignment( nAlignment ), XML_rtl, sax_fastparser::UseIf(ToPsz10(bRtl), bRtl)); else - mpFS->startElementNS( XML_a, XML_pPr, + mpFS->startElementNS( XML_a, nElement, XML_lvl, sax_fastparser::UseIf(OString::number(nLevel), nLevel > 0), XML_marL, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeftMargin)), nLeftMargin > 0), XML_indent, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLineIndentation)), nLineIndentation != 0), @@ -2927,7 +2927,49 @@ void DrawingML::WriteParagraphProperties( const Reference< XTextContent >& rPara WriteParagraphTabStops( rXPropSet ); - mpFS->endElementNS( XML_a, XML_pPr ); + if( nElement == XML_pPr) + mpFS->endElementNS( XML_a, nElement ); + + return true; +} + +void DrawingML::WriteLstStyles(const css::uno::Reference<css::text::XTextContent>& rParagraph, + bool& rbOverridingCharHeight, sal_Int32& rnCharHeight, + const css::uno::Reference<css::beans::XPropertySet>& rXShapePropSet) +{ + Reference<XEnumerationAccess> access(rParagraph, UNO_QUERY); + if (!access.is()) + return; + + Reference<XEnumeration> enumeration(access->createEnumeration()); + if (!enumeration.is()) + return; + + + Reference<XTextRange> rRun; + + if (enumeration->hasMoreElements()) + { + Any aAny(enumeration->nextElement()); + if (aAny >>= rRun) + { + float fFirstCharHeight = rnCharHeight / 1000.; + Reference<XPropertySet> xFirstRunPropSet(rRun, UNO_QUERY); + Reference<XPropertySetInfo> xFirstRunPropSetInfo + = xFirstRunPropSet->getPropertySetInfo(); + + if (xFirstRunPropSetInfo->hasPropertyByName("CharHeight")) + fFirstCharHeight = xFirstRunPropSet->getPropertyValue("CharHeight").get<float>(); + + mpFS->startElementNS(XML_a, XML_lstStyle); + if( !WriteParagraphProperties(rParagraph, fFirstCharHeight, XML_lvl1pPr) ) + mpFS->startElementNS(XML_a, XML_lvl1pPr); + WriteRunProperties(xFirstRunPropSet, false, XML_defRPr, true, rbOverridingCharHeight, + rnCharHeight, GetScriptType(rRun->getString()), rXShapePropSet); + mpFS->endElementNS(XML_a, XML_lvl1pPr); + mpFS->endElementNS(XML_a, XML_lstStyle); + } + } } void DrawingML::WriteParagraph( const Reference< XTextContent >& rParagraph, @@ -3005,7 +3047,7 @@ bool DrawingML::IsFontworkShape(const css::uno::Reference<css::beans::XPropertyS } void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bool bText, - sal_Int32 nXmlNamespace) + sal_Int32 nXmlNamespace, bool bWritePropertiesAsLstStyles) { // ToDo: Fontwork in DOCX Reference< XText > xXText( rXIface, UNO_QUERY ); @@ -3433,6 +3475,7 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo bool bOverridingCharHeight = false; sal_Int32 nCharHeight = -1; + bool bFirstParagraph = true; while( enumeration->hasMoreElements() ) { @@ -3440,7 +3483,13 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo Any any ( enumeration->nextElement() ); if( any >>= paragraph) - WriteParagraph( paragraph, bOverridingCharHeight, nCharHeight, rXPropSet ); + { + if (bFirstParagraph && bWritePropertiesAsLstStyles) + WriteLstStyles(paragraph, bOverridingCharHeight, nCharHeight, rXPropSet); + + WriteParagraph(paragraph, bOverridingCharHeight, nCharHeight, rXPropSet); + bFirstParagraph = false; + } } } diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index f45b0aabc61d..a34d15205bc5 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1552,7 +1552,7 @@ ShapeExport& ShapeExport::WriteShape( const Reference< XShape >& xShape ) return *this; } -ShapeExport& ShapeExport::WriteTextBox( const Reference< XInterface >& xIface, sal_Int32 nXmlNamespace ) +ShapeExport& ShapeExport::WriteTextBox( const Reference< XInterface >& xIface, sal_Int32 nXmlNamespace, bool bWritePropertiesAsLstStyles) { // In case this shape has an associated textbox, then export that, and we're done. if (GetDocumentType() == DOCUMENT_DOCX && GetTextExport()) @@ -1577,7 +1577,7 @@ ShapeExport& ShapeExport::WriteTextBox( const Reference< XInterface >& xIface, s pFS->startElementNS(nXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_txBody : XML_txbx)); - WriteText( xIface, /*bBodyPr=*/(GetDocumentType() != DOCUMENT_DOCX) ); + WriteText( xIface, /*bBodyPr=*/(GetDocumentType() != DOCUMENT_DOCX), true, 0, bWritePropertiesAsLstStyles ); pFS->endElementNS( nXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_txBody : XML_txbx) ); if (GetDocumentType() == DOCUMENT_DOCX) WriteText( xIface, /*bBodyPr=*/true, /*bText=*/false, /*nXmlNamespace=*/nXmlNamespace ); commit 46f8ff0d2c2eab011fee43004b3362eae1fee55c Author: Sarper Akdemir <sarper.akde...@collabora.com> AuthorDate: Wed Jun 9 07:54:04 2021 +0300 Commit: Sarper Akdemir <sarper.akde...@collabora.com> CommitDate: Thu Jun 10 18:24:27 2021 +0300 tdf#59323: pptx export: add placeholder index to master footer placeholders OOXML uses placeholder index to determine from which layout placeholder it should be inheriting styles, position etc. Added maPlaceholderShapeToIndexMap that stores corresponding Placeholder index for a Placeholder XShape on the master slide. Right now only used for placeholder types Footer, DateAndTime and SlideNumber. Change-Id: If788f235d00b6d1cde7194d9e4a0789e019432c3 diff --git a/sd/source/filter/eppt/epptooxml.hxx b/sd/source/filter/eppt/epptooxml.hxx index 93029f073487..f3a5377ac1cc 100644 --- a/sd/source/filter/eppt/epptooxml.hxx +++ b/sd/source/filter/eppt/epptooxml.hxx @@ -118,6 +118,12 @@ private: static void WriteDiagram(const FSHelperPtr& pFS, PowerPointShapeExport& rDML, const css::uno::Reference<css::drawing::XShape>& rXShape, int nDiagramId); + /** Create a new placeholder index for a master placeholder shape + + @param rXShape Master placeholder shape + @returns Placeholder index + */ + unsigned CreateNewPlaceholderIndex(const css::uno::Reference<css::drawing::XShape>& rXShape); /// Should we export as .pptm, ie. do we contain macros? bool mbPptm; @@ -142,6 +148,10 @@ private: ::oox::drawingml::ShapeExport::ShapeHashMap maShapeMap; + unsigned mnPlaceholderIndexMax; //< Last used placeholder index + /// Map of placeholder indexes for Master placeholders + std::unordered_map< css::uno::Reference<css::drawing::XShape>, int > maPlaceholderShapeToIndexMap; + struct AuthorComments { sal_Int32 nId; sal_Int32 nLastIndex; diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 6a8502361061..85ac7ddf6b45 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -134,8 +134,35 @@ void WriteSndAc(const FSHelperPtr& pFS, const OUString& sSoundRelId, const OUStr pFS->endElement(FSNS(XML_p, XML_stSnd)); pFS->endElement(FSNS(XML_p, XML_sndAc)); } -} +const char* getPlaceholderTypeName(PlaceholderType ePlaceholder) +{ + switch (ePlaceholder) + { + case SlideImage: + return "sldImg"; + case Notes: + return "body"; + case Header: + return "hdr"; + case Footer: + return "ftr"; + case SlideNumber: + return "sldNum"; + case DateAndTime: + return "dt"; + case Outliner: + return "body"; + case Title: + return "title"; + case Subtitle: + return "subTitle"; + default: + SAL_INFO("sd.eppt", "warning: unhandled placeholder type: " << ePlaceholder); + return nullptr; + } +} +} } namespace { @@ -344,6 +371,7 @@ PowerPointExport::PowerPointExport(const Reference< XComponentContext >& rContex , mnAnimationNodeIdMax(1) , mnDiagramId(1) , mbCreateNotes(false) + , mnPlaceholderIndexMax(1) { comphelper::SequenceAsHashMap aArgumentsMap(rArguments); mbPptm = aArgumentsMap.getUnpackedValueOrDefault("IsPPTM", false); @@ -1522,41 +1550,22 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderShape(const Reference< XShap mpFS->endElementNS(XML_p, XML_cNvSpPr); mpFS->startElementNS(XML_p, XML_nvPr); - const char* pType = nullptr; - switch (ePlaceholder) + bool bUsePlaceholderIndex + = ePlaceholder == Footer || ePlaceholder == DateAndTime || ePlaceholder == SlideNumber; + const char* pType = getPlaceholderTypeName(ePlaceholder); + + SAL_INFO("sd.eppt", "write placeholder " << pType); + if (bUsePlaceholderIndex) { - case SlideImage: - pType = "sldImg"; - break; - case Notes: - pType = "body"; - break; - case Header: - pType = "hdr"; - break; - case Footer: - pType = "ftr"; - break; - case SlideNumber: - pType = "sldNum"; - break; - case DateAndTime: - pType = "dt"; - break; - case Outliner: - pType = "body"; - break; - case Title: - pType = "title"; - break; - case Subtitle: - pType = "subTitle"; - break; - default: - SAL_INFO("sd.eppt", "warning: unhandled placeholder type: " << ePlaceholder); + mpFS->singleElementNS( + XML_p, XML_ph, XML_type, pType, XML_idx, + OString::number( + static_cast<PowerPointExport*>(GetFB())->CreateNewPlaceholderIndex(xShape))); + } + else + { + mpFS->singleElementNS(XML_p, XML_ph, XML_type, pType); } - SAL_INFO("sd.eppt", "write placeholder " << pType); - mpFS->singleElementNS(XML_p, XML_ph, XML_type, pType); mpFS->endElementNS(XML_p, XML_nvPr); mpFS->endElementNS(XML_p, XML_nvSpPr); @@ -2078,6 +2087,12 @@ void PowerPointExport::WriteDiagram(const FSHelperPtr& pFS, PowerPointShapeExpor pFS->endElementNS(XML_p, XML_graphicFrame); } +unsigned PowerPointExport::CreateNewPlaceholderIndex(const css::uno::Reference<XShape> &rXShape) +{ + maPlaceholderShapeToIndexMap.insert({rXShape, ++mnPlaceholderIndexMax}); + return mnPlaceholderIndexMax; +} + // UNO component extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface* css_comp_Impress_oox_PowerPointExport(uno::XComponentContext* rxCtxt, commit 81d9f1f81febf0cdd14a4fd2775bb74610902451 Author: Sarper Akdemir <sarper.akde...@collabora.com> AuthorDate: Wed Jun 9 07:34:32 2021 +0300 Commit: Sarper Akdemir <sarper.akde...@collabora.com> CommitDate: Thu Jun 10 18:24:26 2021 +0300 tdf#59323: pptx export: add datetime field type helpers Creates helper functions to convert from LO time and date formats to datetime fields on OOXML Change-Id: Ibbfefa18d0422eddb6c37539294ed23e77fe5f22 diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx index 2876d59c5367..6c15d8cc05fa 100644 --- a/include/oox/export/drawingml.hxx +++ b/include/oox/export/drawingml.hxx @@ -46,6 +46,8 @@ class Graphic; class SdrObjCustomShape; +enum class SvxDateFormat; +enum class SvxTimeFormat; namespace com::sun::star { namespace awt { @@ -166,6 +168,22 @@ protected: const css::uno::Reference< css::beans::XPropertyState >& rXPropState, const OUString& aName, css::beans::PropertyState& eState ); OUString GetFieldValue( const css::uno::Reference< css::text::XTextRange >& rRun, bool& bIsURLField ); + /** Gets OOXML datetime field type from LO Date format + + @param eDate LO Date format + */ + OUString GetDatetimeTypeFromDate(SvxDateFormat eDate); + /** Gets OOXML datetime field type from LO Time format + + @param eTime LO Time format + */ + OUString GetDatetimeTypeFromTime(SvxTimeFormat eTime); + /** Gets OOXML datetime field type from combination of LO Time and Date formats + + @param eDate LO Date format + @param eTime LO Time format + */ + OUString GetDatetimeTypeFromDateTime(SvxDateFormat eDate, SvxTimeFormat eTime); /// Output the media (including copying a video from vnd.sun.star.Package: to the output if necessary). void WriteMediaNonVisualProperties(const css::uno::Reference<css::drawing::XShape>& xShape); diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 385af08d590b..37ecdcaf0437 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -2286,40 +2286,13 @@ OUString DrawingML::GetFieldValue( const css::uno::Reference< css::text::XTextRa { sal_Int32 nNumFmt = -1; rXPropSet->getPropertyValue(UNO_TC_PROP_NUMFORMAT) >>= nNumFmt; - switch(static_cast<SvxDateFormat>(nNumFmt)) - { - case SvxDateFormat::StdSmall: - case SvxDateFormat::A: aFieldValue = "datetime"; // 13/02/96 - break; - case SvxDateFormat::B: aFieldValue = "datetime1"; // 13/02/1996 - break; - case SvxDateFormat::StdBig: - case SvxDateFormat::D: aFieldValue = "datetime3"; // 13 February 1996 - break; - default: break; - } + aFieldValue = GetDatetimeTypeFromDate(static_cast<SvxDateFormat>(nNumFmt)); } else if(aFieldKind == "ExtTime") { sal_Int32 nNumFmt = -1; rXPropSet->getPropertyValue(UNO_TC_PROP_NUMFORMAT) >>= nNumFmt; - switch(static_cast<SvxTimeFormat>(nNumFmt)) - { - case SvxTimeFormat::Standard: - case SvxTimeFormat::HH24_MM_SS: - aFieldValue = "datetime11"; // 13:49:38 - break; - case SvxTimeFormat::HH24_MM: - aFieldValue = "datetime10"; // 13:49 - break; - case SvxTimeFormat::HH12_MM: - aFieldValue = "datetime12"; // 01:49 PM - break; - case SvxTimeFormat::HH12_MM_SS: - aFieldValue = "datetime13"; // 01:49:38 PM - break; - default: break; - } + aFieldValue = GetDatetimeTypeFromTime(static_cast<SvxTimeFormat>(nNumFmt)); } else if(aFieldKind == "ExtFile") { @@ -2346,6 +2319,83 @@ OUString DrawingML::GetFieldValue( const css::uno::Reference< css::text::XTextRa return aFieldValue; } +OUString DrawingML::GetDatetimeTypeFromDate(SvxDateFormat eDate) +{ + return GetDatetimeTypeFromDateTime(eDate, SvxTimeFormat::AppDefault); +} + +OUString DrawingML::GetDatetimeTypeFromTime(SvxTimeFormat eTime) +{ + return GetDatetimeTypeFromDateTime(SvxDateFormat::AppDefault, eTime); +} + +OUString DrawingML::GetDatetimeTypeFromDateTime(SvxDateFormat eDate, SvxTimeFormat eTime) +{ + OUString aDateField; + switch (eDate) + { + case SvxDateFormat::StdSmall: + case SvxDateFormat::A: + aDateField = "datetime"; + break; + case SvxDateFormat::B: + aDateField = "datetime1"; // 13/02/1996 + break; + case SvxDateFormat::StdBig: + case SvxDateFormat::C: + case SvxDateFormat::D: + aDateField = "datetime3"; // 13 February 1996 + break; + case SvxDateFormat::E: + case SvxDateFormat::F: + aDateField = "datetime2"; + break; + default: + break; + } + + OUString aTimeField; + switch (eTime) + { + case SvxTimeFormat::Standard: + case SvxTimeFormat::HH24_MM_SS: + case SvxTimeFormat::HH24_MM_SS_00: + aTimeField = "datetime11"; // 13:49:38 + break; + case SvxTimeFormat::HH24_MM: + aTimeField = "datetime10"; // 13:49 + break; + case SvxTimeFormat::HH12_MM: + case SvxTimeFormat::HH12_MM_AMPM: + aTimeField = "datetime12"; // 01:49 PM + break; + case SvxTimeFormat::HH12_MM_SS: + case SvxTimeFormat::HH12_MM_SS_AMPM: + case SvxTimeFormat::HH12_MM_SS_00: + case SvxTimeFormat::HH12_MM_SS_00_AMPM: + aTimeField = "datetime13"; // 01:49:38 PM + break; + default: + break; + } + + if (!aDateField.isEmpty() && aTimeField.isEmpty()) + return aDateField; + else if (!aTimeField.isEmpty() && aDateField.isEmpty()) + return aTimeField; + else if (!aDateField.isEmpty() && !aTimeField.isEmpty()) + { + if (aTimeField.equals("datetime11") || aTimeField.equals("datetime13")) + // only datetime format that has Date and HH:MM:SS + return "datetime9"; // dd/mm/yyyy H:MM:SS + else + // only datetime format that has Date and HH:MM + return "datetime8"; // dd/mm/yyyy H:MM + } + else + return OUString(); +} + void DrawingML::WriteRun( const Reference< XTextRange >& rRun, bool& rbOverridingCharHeight, sal_Int32& rnCharHeight, const css::uno::Reference< css::beans::XPropertySet >& rXShapePropSet) commit 8350f11280583df28373d501e7c77c537cb6ea66 Author: Sarper Akdemir <sarper.akde...@collabora.com> AuthorDate: Sun Apr 25 15:59:39 2021 +0300 Commit: Sarper Akdemir <sarper.akde...@collabora.com> CommitDate: Thu Jun 10 18:24:25 2021 +0300 tdf#59323: pptx import: import footer fields as properties Makes footer, slidenum and datetime placeholders that are inserted to the slides themselves on pptx files imported as slide properties if it is possible to do so without losing information (style, position etc.) If that is not the case and the footers have some special style applied to them that isn't inherited from master slides, fallbacks to the current implementation importing them as shapes. Also since the default way of displaying slide footers in LO use the respective text fields on master slides, information in master/layout slide datetime and footer placeholders respectively get replaced with <date/time> text fields and <footer> text fields. Change-Id: Ib2f7d18103b62c0c9a8453e01cfd2fd1aa1d39af diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 0c142a4e7f97..1d99898a3033 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -841,7 +841,7 @@ void Chart2ImportTest::testBnc864396() void Chart2ImportTest::testBnc889755() { load(u"/chart2/qa/extras/data/pptx/", "bnc889755.pptx"); - uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 6), uno::UNO_QUERY_THROW); + uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 5), uno::UNO_QUERY_THROW); CPPUNIT_ASSERT(xChartDoc->hasInternalDataProvider()); uno::Reference< chart2::XInternalDataProvider > xDataProvider( xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW ); @@ -869,7 +869,7 @@ void Chart2ImportTest::testBnc889755() uno::Reference<drawing::XDrawPagesSupplier> xDoc(mxComponent, uno::UNO_QUERY_THROW); uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW); // Shape "Title 3" - uno::Reference<beans::XPropertySet> xShapeProps(xPage->getByIndex(5), uno::UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xShapeProps(xPage->getByIndex(4), uno::UNO_QUERY_THROW); awt::Gradient aTransparence; xShapeProps->getPropertyValue("FillTransparenceGradient") >>= aTransparence; CPPUNIT_ASSERT(aTransparence.StartColor != aTransparence.EndColor); diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx index 4e07ae104db3..321c2eef6b2a 100644 --- a/oox/source/ppt/pptshape.cxx +++ b/oox/source/ppt/pptshape.cxx @@ -20,8 +20,12 @@ #include <oox/ppt/pptshape.hxx> #include <oox/core/xmlfilterbase.hxx> #include <drawingml/textbody.hxx> +#include <drawingml/textparagraph.hxx> +#include <drawingml/textfield.hxx> #include <drawingml/table/tableproperties.hxx> +#include <editeng/flditem.hxx> +#include <com/sun/star/text/XTextField.hpp> #include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -86,6 +90,19 @@ static const char* lclDebugSubType( sal_Int32 nType ) return "unknown - please extend lclDebugSubType"; } +namespace +{ +bool ShapeHasNoVisualPropertiesOnImport(oox::ppt::PPTShape& rPPTShape) +{ + return !rPPTShape.hasNonInheritedShapeProperties() + && !rPPTShape.hasShapeStyleRefs() + && !rPPTShape.getTextBody()->hasVisualRunProperties() + && !rPPTShape.getTextBody()->hasNoninheritedBodyProperties() + && !rPPTShape.getTextBody()->hasListStyleOnImport() + && !rPPTShape.getTextBody()->hasParagraphProperties(); +} +} + oox::drawingml::TextListStylePtr PPTShape::getSubTypeTextListStyle( const SlidePersist& rSlidePersist, sal_Int32 nSubType ) { oox::drawingml::TextListStylePtr pTextListStyle; @@ -178,6 +195,37 @@ void PPTShape::addShape( } break; case XML_dt : + if ( meShapeLocation == Slide && !rSlidePersist.isNotesPage() + && getTextBody()->getParagraphs().size() == 1 + && getTextBody()->getParagraphs().front()->getRuns().size() == 1 + && ShapeHasNoVisualPropertiesOnImport(*this) ) + { + TextRunPtr& pTextRun = getTextBody()->getParagraphs().front()->getRuns().front(); + oox::drawingml::TextField* pTextField = dynamic_cast<oox::drawingml::TextField*>(pTextRun.get()); + if (pTextField) + { + OUString aType = pTextField->getType(); + if ( aType.startsWith("datetime") ) + { + SvxDateFormat eDateFormat = drawingml::TextField::getLODateFormat(aType); + SvxTimeFormat eTimeFormat = drawingml::TextField::getLOTimeFormat(aType); + Reference< XPropertySet > xPropertySet( rSlidePersist.getPage(), UNO_QUERY ); + + if( eDateFormat != SvxDateFormat::AppDefault + || eTimeFormat != SvxTimeFormat::AppDefault ) + { + // DateTimeFormat property looks for the date in 4 LSBs + // and looks for time format in the 4 bits after that + int nDateTimeFormat = static_cast<int>(eDateFormat) | + static_cast<int>(eTimeFormat) << 4; + xPropertySet->setPropertyValue( "IsDateTimeVisible", Any(true) ); + xPropertySet->setPropertyValue( "IsDateTimeFixed", Any(false) ); + xPropertySet->setPropertyValue( "DateTimeFormat", Any(nDateTimeFormat) ); + return; + } + } + } + } sServiceName = "com.sun.star.presentation.DateTimeShape"; bClearText = true; break; @@ -186,10 +234,46 @@ void PPTShape::addShape( bClearText = true; break; case XML_ftr : + if ( meShapeLocation == Slide && !rSlidePersist.isNotesPage() + && getTextBody()->getParagraphs().size() == 1 + && getTextBody()->getParagraphs().front()->getRuns().size() == 1 + && ShapeHasNoVisualPropertiesOnImport(*this) ) + { + const OUString& rFooterText = getTextBody()->toString(); + + if( !rFooterText.isEmpty() ) + { + // if it is possible to get the footer as a property the LO way, + // get it and discard the shape + Reference< XPropertySet > xPropertySet( rSlidePersist.getPage(), UNO_QUERY ); + xPropertySet->setPropertyValue( "IsFooterVisible", Any( true ) ); + xPropertySet->setPropertyValue( "FooterText", Any(rFooterText) ); + return; + } + } sServiceName = "com.sun.star.presentation.FooterShape"; bClearText = true; break; case XML_sldNum : + if (meShapeLocation == Slide && !rSlidePersist.isNotesPage() + && getTextBody()->getParagraphs().size() == 1 + && getTextBody()->getParagraphs().front()->getRuns().size() == 1 + && ShapeHasNoVisualPropertiesOnImport(*this)) + { + TextRunPtr& pTextRun + = getTextBody()->getParagraphs().front()->getRuns().front(); + oox::drawingml::TextField* pTextField + = dynamic_cast<oox::drawingml::TextField*>(pTextRun.get()); + if (pTextField && pTextField->getType().equals("slidenum")) + { + // if it is possible to get the slidenum placeholder as a property + // do that and discard the shape + Reference<XPropertySet> xPropertySet(rSlidePersist.getPage(), + UNO_QUERY); + xPropertySet->setPropertyValue("IsPageNumberVisible", Any(true)); + return; + } + } sServiceName = "com.sun.star.presentation.SlideNumberShape"; bClearText = true; break; @@ -393,6 +477,26 @@ void PPTShape::addShape( } } + // we will be losing whatever information there is in the footer placeholder on master/layout slides + // since they should have the "<footer>" textfield in them in order to make LibreOffice process them as expected + // likewise DateTime placeholder data on master/layout slides will be lost and replaced + if( (mnSubType == XML_ftr || mnSubType == XML_dt) && meShapeLocation != Slide ) + { + OUString aFieldType; + if( mnSubType == XML_ftr ) + aFieldType = "com.sun.star.presentation.TextField.Footer"; + else + aFieldType = "com.sun.star.presentation.TextField.DateTime"; + Reference < XTextField > xField( xServiceFact->createInstance( aFieldType ), UNO_QUERY ); + Reference < XText > xText(mxShape, UNO_QUERY); + if(xText.is()) + { + xText->setString(""); + Reference < XTextCursor > xTextCursor = xText->createTextCursor(); + xText->insertTextContent( xTextCursor, xField, false); + } + } + // if this is a group shape, we have to add also each child shape Reference<XShapes> xShapes(xShape, UNO_QUERY); if (xShapes.is()) diff --git a/sd/qa/unit/data/pptx/numfmt.pptx b/sd/qa/unit/data/pptx/numfmt.pptx index aca6927101d6..e5f0f5cf151a 100644 Binary files a/sd/qa/unit/data/pptx/numfmt.pptx and b/sd/qa/unit/data/pptx/numfmt.pptx differ diff --git a/sd/qa/unit/data/pptx/slidenum_field.pptx b/sd/qa/unit/data/pptx/slidenum_field.pptx index f3c184056905..3388568831d7 100644 Binary files a/sd/qa/unit/data/pptx/slidenum_field.pptx and b/sd/qa/unit/data/pptx/slidenum_field.pptx differ diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index fec4db5b6586..69399a686162 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -1888,7 +1888,7 @@ void SdImportTest::testTdf95932() sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf95932.pptx"), PPTX); const SdrPage *pPage = GetPage( 1, xDocShRef ); - SdrObject *const pObj = pPage->GetObj(2); + SdrObject *const pObj = pPage->GetObj(1); CPPUNIT_ASSERT(pObj); const XFillStyleItem& rStyleItem = dynamic_cast<const XFillStyleItem&>( commit d79ab7098e75f49170fc31318dcd6a4b73d4e796 Author: Sarper Akdemir <sarper.akde...@collabora.com> AuthorDate: Sun May 9 20:56:41 2021 +0300 Commit: Sarper Akdemir <sarper.akde...@collabora.com> CommitDate: Thu Jun 10 18:23:55 2021 +0300 tdf#59323: ooxml import: hasListStyleOnImport Introduces hasListStyleOnImport to determine whether or not the textbody had a non-empty lstStyle tag in it on import. Change-Id: Iccb8cfb20e4402e7cadb8e2f2b9a1f6fa178ade4 diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx index f89e069d5ffe..2ac96011f3c8 100644 --- a/oox/inc/drawingml/textbody.hxx +++ b/oox/inc/drawingml/textbody.hxx @@ -80,6 +80,9 @@ public: /// Flags textbody as having a non-empty bodyPr tag void setHasNoninheritedBodyProperties() { mbHasNoninheritedBodyProperties = true; } + /// Returns whether the textbody had a non-empty lstStyle tag in it + bool hasListStyleOnImport() const { return maTextListStyle.hasListStyleOnImport(); } + void ApplyStyleEmpty( const ::oox::core::XmlFilterBase& rFilterBase, const css::uno::Reference < css::text::XText > & xText, diff --git a/oox/inc/drawingml/textliststyle.hxx b/oox/inc/drawingml/textliststyle.hxx index cd770457575f..7fe071af669b 100644 --- a/oox/inc/drawingml/textliststyle.hxx +++ b/oox/inc/drawingml/textliststyle.hxx @@ -50,6 +50,14 @@ public: }; TextParagraphPropertiesArray& getAggregationListStyle() { return maAggregationListStyle; }; + /// Flags ListStyle as having a non-empty lstStyle tag on import + void setHasListStyleOnImport() { mbHasListStyleOnImport = true; } + /** Returns whether the lstStyle tag was non-empty on import + * + * @return true if list style has it's own noninherited properties. + */ + bool hasListStyleOnImport() const { return mbHasListStyleOnImport; } + #ifdef DBG_UTIL void dump() const; #endif @@ -57,6 +65,8 @@ public: private: TextParagraphPropertiesArray maListStyle; TextParagraphPropertiesArray maAggregationListStyle; + /// Set if ListStyle has a non-empty lstStyle tag on import + bool mbHasListStyleOnImport; }; } diff --git a/oox/source/drawingml/textliststyle.cxx b/oox/source/drawingml/textliststyle.cxx index 0b757159e5bc..175b6caf879b 100644 --- a/oox/source/drawingml/textliststyle.cxx +++ b/oox/source/drawingml/textliststyle.cxx @@ -23,6 +23,7 @@ namespace oox::drawingml { TextListStyle::TextListStyle() + : mbHasListStyleOnImport(false) { } diff --git a/oox/source/drawingml/textliststylecontext.cxx b/oox/source/drawingml/textliststylecontext.cxx index f2abd9b91c21..62d81f9c7f4a 100644 --- a/oox/source/drawingml/textliststylecontext.cxx +++ b/oox/source/drawingml/textliststylecontext.cxx @@ -41,6 +41,7 @@ TextListStyleContext::~TextListStyleContext() ContextHandlerRef TextListStyleContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) { + mrTextListStyle.setHasListStyleOnImport(); switch( aElementToken ) { case A_TOKEN( defPPr ): // CT_TextParagraphProperties commit e20f343537f192c16b530415380003b9dc79cbb7 Author: Sarper Akdemir <sarper.akde...@collabora.com> AuthorDate: Sun May 9 20:55:17 2021 +0300 Commit: Sarper Akdemir <sarper.akde...@collabora.com> CommitDate: Thu Jun 10 18:22:09 2021 +0300 tdf#59323: ooxml import: hasNoninheritedBodyProperties Introduces hasNoninheritedBodyProperties. Change-Id: Id108f692005455376537e515f41528cc66a8c25c diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx index 25a6ab194089..f89e069d5ffe 100644 --- a/oox/inc/drawingml/textbody.hxx +++ b/oox/inc/drawingml/textbody.hxx @@ -75,6 +75,11 @@ public: /// Returns whether the textbody had a pPr tag in it bool hasParagraphProperties() const; + /// Returns whether the textbody had a non-empty bodyPr tag in it + bool hasNoninheritedBodyProperties() const { return mbHasNoninheritedBodyProperties; } + /// Flags textbody as having a non-empty bodyPr tag + void setHasNoninheritedBodyProperties() { mbHasNoninheritedBodyProperties = true; } + void ApplyStyleEmpty( const ::oox::core::XmlFilterBase& rFilterBase, const css::uno::Reference < css::text::XText > & xText, @@ -83,6 +88,8 @@ public: protected: TextParagraphVector maParagraphs; TextBodyProperties maTextProperties; + /// Set if bodyPr tag in this textbody is non-empty during import + bool mbHasNoninheritedBodyProperties; TextListStyle maTextListStyle; Text3DProperties ma3DProperties; }; diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx index 5924728430a8..b665e7b355a0 100644 --- a/oox/source/drawingml/textbody.cxx +++ b/oox/source/drawingml/textbody.cxx @@ -30,6 +30,7 @@ using namespace ::com::sun::star::beans; namespace oox::drawingml { TextBody::TextBody() + : mbHasNoninheritedBodyProperties( false ) { } diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx index a10ba58a0499..3f96eef47ec8 100644 --- a/oox/source/drawingml/textbodycontext.cxx +++ b/oox/source/drawingml/textbodycontext.cxx @@ -27,6 +27,8 @@ #include <drawingml/textfieldcontext.hxx> #include <oox/drawingml/shape.hxx> #include <oox/token/namespaces.hxx> +#include <oox/helper/attributelist.hxx> +#include <sax/fastattribs.hxx> #include <oox/mathml/import.hxx> @@ -177,6 +179,12 @@ ContextHandlerRef TextBodyContext::onCreateContext( sal_Int32 aElementToken, con switch( aElementToken ) { case A_TOKEN( bodyPr ): // CT_TextBodyPropertyBag + { + sax_fastparser::FastAttributeList& rFastAttributeList = + sax_fastparser::castToFastAttributeList(rAttribs.getFastAttributeList()); + if ( rFastAttributeList.getFastAttributeTokens().size() > 0 ) + mrTextBody.setHasNoninheritedBodyProperties(); + } if ( mpShapePtr ) return new TextBodyPropertiesContext( *this, rAttribs, mpShapePtr ); else commit da0ce6b2247455a54c46594f11e4566a2054936d Author: Sarper Akdemir <sarper.akde...@collabora.com> AuthorDate: Sun May 9 20:47:35 2021 +0300 Commit: Sarper Akdemir <sarper.akde...@collabora.com> CommitDate: Thu Jun 10 18:22:08 2021 +0300 tdf#59323: ooxml import: hasParagraphProperties Introduces hasParagraphProperties to determine whether or not there was a pPr tag in the textbody on import. Change-Id: I3c6815e8405b0087f64520ee4e0e39297b3b4548 diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx index 8d0ce417f6b9..25a6ab194089 100644 --- a/oox/inc/drawingml/textbody.hxx +++ b/oox/inc/drawingml/textbody.hxx @@ -72,6 +72,9 @@ public: */ bool hasVisualRunProperties() const; + /// Returns whether the textbody had a pPr tag in it + bool hasParagraphProperties() const; + void ApplyStyleEmpty( const ::oox::core::XmlFilterBase& rFilterBase, const css::uno::Reference < css::text::XText > & xText, diff --git a/oox/inc/drawingml/textparagraph.hxx b/oox/inc/drawingml/textparagraph.hxx index 4424eadf2cab..021434d6a5fb 100644 --- a/oox/inc/drawingml/textparagraph.hxx +++ b/oox/inc/drawingml/textparagraph.hxx @@ -53,6 +53,10 @@ public: TextParagraphProperties& getProperties() { return maProperties; } const TextParagraphProperties& getProperties() const { return maProperties; } + /// Flags the textparagraph as having a pPr tag in it + void setHasProperties() { mbHasProperties = true; } + /// Returns whether the textparagraph had an pPr tag in it during import + bool hasProperties() const { return mbHasProperties; } TextCharacterProperties& getEndProperties() { return maEndProperties; } const TextCharacterProperties& getEndProperties() const { return maEndProperties; } @@ -87,6 +91,7 @@ public: private: TextParagraphProperties maProperties; + bool mbHasProperties; TextCharacterProperties maEndProperties; TextRunVector maRuns; // temporarily store this here diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx index 9839f755dc39..5924728430a8 100644 --- a/oox/source/drawingml/textbody.cxx +++ b/oox/source/drawingml/textbody.cxx @@ -103,6 +103,16 @@ bool TextBody::hasVisualRunProperties() const return false; } +bool TextBody::hasParagraphProperties() const +{ + for ( auto& pTextParagraph : getParagraphs() ) + { + if ( pTextParagraph->hasProperties() ) + return true; + } + return false; +} + void TextBody::ApplyStyleEmpty( const ::oox::core::XmlFilterBase& rFilterBase, const Reference < XText > & xText, diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx index 49b50309f597..a10ba58a0499 100644 --- a/oox/source/drawingml/textbodycontext.cxx +++ b/oox/source/drawingml/textbodycontext.cxx @@ -89,6 +89,7 @@ ContextHandlerRef TextParagraphContext::onCreateContext( sal_Int32 aElementToken } case A_TOKEN( pPr ): case W_TOKEN( pPr ): + mrParagraph.setHasProperties(); return new TextParagraphPropertiesContext( *this, rAttribs, mrParagraph.getProperties() ); case A_TOKEN( endParaRPr ): return new TextCharacterPropertiesContext( *this, rAttribs, mrParagraph.getEndProperties() ); diff --git a/oox/source/drawingml/textparagraph.cxx b/oox/source/drawingml/textparagraph.cxx index b1c57205dc26..9e4f309e9391 100644 --- a/oox/source/drawingml/textparagraph.cxx +++ b/oox/source/drawingml/textparagraph.cxx @@ -38,6 +38,7 @@ using namespace ::com::sun::star::beans; namespace oox::drawingml { TextParagraph::TextParagraph() + : mbHasProperties( false ) { } commit edc4529af6e6df1218457d0c1ecf0685822741e1 Author: Sarper Akdemir <sarper.akde...@collabora.com> AuthorDate: Sun May 9 20:17:20 2021 +0300 Commit: Sarper Akdemir <sarper.akde...@collabora.com> CommitDate: Thu Jun 10 18:22:07 2021 +0300 tdf#59323: ooxml import: hasVisualRunProperties Introduces helper functions to determine whether a shape has non inherited run properties that change it visually. mbHasVisualRunProperties is set on import if there was a run property that alters visual appearance. Change-Id: Ie1e8e22d2757dc8594e7c6c3b8fc1dd7973c92af diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx index ac6c66b49515..8d0ce417f6b9 100644 --- a/oox/inc/drawingml/textbody.hxx +++ b/oox/inc/drawingml/textbody.hxx @@ -66,6 +66,12 @@ public: bool isEmpty() const; OUString toString() const; + /** Returns whether the textbody had a rPr tag in it that alters it visually + * + * For instance _lang_ doesn't have a visual effect. + */ + bool hasVisualRunProperties() const; + void ApplyStyleEmpty( const ::oox::core::XmlFilterBase& rFilterBase, const css::uno::Reference < css::text::XText > & xText, diff --git a/oox/inc/drawingml/textcharacterproperties.hxx b/oox/inc/drawingml/textcharacterproperties.hxx index 90d01ec9cde1..2724af43051b 100644 --- a/oox/inc/drawingml/textcharacterproperties.hxx +++ b/oox/inc/drawingml/textcharacterproperties.hxx @@ -58,6 +58,8 @@ struct TextCharacterProperties OptValue< bool > moUnderlineLineFollowText; OptValue< bool > moUnderlineFillFollowText; FillProperties maFillProperties; + /// Set if there was a property set that alters run visually during import + bool mbHasVisualRunProperties; std::vector<css::beans::PropertyValue> maTextEffectsProperties; @@ -78,6 +80,8 @@ struct TextCharacterProperties void pushToPropSet( PropertySet& rPropSet, const ::oox::core::XmlFilterBase& rFilter ) const; + + TextCharacterProperties() : mbHasVisualRunProperties(false) {} }; diff --git a/oox/inc/drawingml/textparagraph.hxx b/oox/inc/drawingml/textparagraph.hxx index df39f8841c76..4424eadf2cab 100644 --- a/oox/inc/drawingml/textparagraph.hxx +++ b/oox/inc/drawingml/textparagraph.hxx @@ -79,6 +79,12 @@ public: } formulaimport::XmlStreamBuilder & GetMathXml(); + /** Returns whether textparagraph had a rPr tag in it that alters it visually + * + * For instance _lang_ doesn't have a visual effect. + */ + bool hasVisualRunProperties() const; + private: TextParagraphProperties maProperties; TextCharacterProperties maEndProperties; diff --git a/oox/inc/drawingml/textrun.hxx b/oox/inc/drawingml/textrun.hxx index 355b8a684cc1..b3d1fe041ff8 100644 --- a/oox/inc/drawingml/textrun.hxx +++ b/oox/inc/drawingml/textrun.hxx @@ -43,6 +43,12 @@ public: void setLineBreak() { mbIsLineBreak = true; } bool isLineBreak() const { return mbIsLineBreak; } + /** Returns whether the textrun had properties that alter it visually in its rPr tag + * + * For instance _lang_ doesn't have a visual effect. + */ + bool hasVisualRunProperties() const { return maTextCharacterProperties.mbHasVisualRunProperties; } + virtual sal_Int32 insertAt( const ::oox::core::XmlFilterBase& rFilterBase, const css::uno::Reference < css::text::XText >& xText, diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx index 1326c790328f..9839f755dc39 100644 --- a/oox/source/drawingml/textbody.cxx +++ b/oox/source/drawingml/textbody.cxx @@ -93,6 +93,16 @@ OUString TextBody::toString() const return OUString(); } +bool TextBody::hasVisualRunProperties() const +{ + for ( auto& pTextParagraph : getParagraphs() ) + { + if ( pTextParagraph->hasVisualRunProperties() ) + return true; + } + return false; +} + void TextBody::ApplyStyleEmpty( const ::oox::core::XmlFilterBase& rFilterBase, const Reference < XText > & xText, diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx index 8fecb8bd2735..9363a69673bb 100644 --- a/oox/source/drawingml/textcharacterpropertiescontext.cxx +++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx @@ -27,6 +27,8 @@ #include "hyperlinkcontext.hxx" #include <oox/token/namespaces.hxx> #include <oox/token/tokens.hxx> +#include <sax/fastattribs.hxx> +#include <sax/fastparser.hxx> #include <sal/log.hxx> @@ -45,8 +47,16 @@ TextCharacterPropertiesContext::TextCharacterPropertiesContext( : ContextHandler2( rParent ) , mrTextCharacterProperties( rTextCharacterProperties ) { - if ( rAttribs.hasAttribute( XML_lang ) ) + int nVisualTokenAmount = sax_fastparser::castToFastAttributeList( + rAttribs.getFastAttributeList() ).getFastAttributeTokens().size(); + + if ( rAttribs.hasAttribute( XML_lang ) ){ mrTextCharacterProperties.moLang = rAttribs.getString( XML_lang ); + --nVisualTokenAmount; // Not a visual attribute + } + if ( rAttribs.hasAttribute( XML_altLang )){ + --nVisualTokenAmount; // Not a visual attribute + } if ( rAttribs.hasAttribute( XML_sz ) ) mrTextCharacterProperties.moHeight = rAttribs.getInteger( XML_sz ); if ( rAttribs.hasAttribute( XML_spc ) ) @@ -64,6 +74,17 @@ TextCharacterPropertiesContext::TextCharacterPropertiesContext( mrTextCharacterProperties.moItalic = rAttribs.getBool( XML_i ); if( rAttribs.hasAttribute( XML_cap ) ) mrTextCharacterProperties.moCaseMap = rAttribs.getToken( XML_cap ); + if ( rAttribs.hasAttribute( XML_dirty ) ) + { + --nVisualTokenAmount; // Not a visual attribute + } + if ( rAttribs.hasAttribute( XML_smtClean ) ) + { + --nVisualTokenAmount; // Not a visual attribute + } + + if ( nVisualTokenAmount > 0 ) + mrTextCharacterProperties.mbHasVisualRunProperties = true; /* TODO / unhandled so far: A_TOKEN( kern ) @@ -85,6 +106,9 @@ TextCharacterPropertiesContext::~TextCharacterPropertiesContext() ContextHandlerRef TextCharacterPropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) { + if( aElementToken != A_TOKEN(lang) ) + mrTextCharacterProperties.mbHasVisualRunProperties = true; + switch( aElementToken ) { // TODO unsupported yet diff --git a/oox/source/drawingml/textparagraph.cxx b/oox/source/drawingml/textparagraph.cxx index 88c086b0c07f..b1c57205dc26 100644 --- a/oox/source/drawingml/textparagraph.cxx +++ b/oox/source/drawingml/textparagraph.cxx @@ -194,6 +194,16 @@ formulaimport::XmlStreamBuilder & TextParagraph::GetMathXml() return *m_pMathXml; } +bool TextParagraph::hasVisualRunProperties() const +{ + for ( auto& pTextRun : getRuns() ) + { + if ( pTextRun->hasVisualRunProperties() ) + return true; + } + return false; +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 1321f88f72fc30b10d682579853f9ff72cf34cb1 Author: Sarper Akdemir <sarper.akde...@collabora.com> AuthorDate: Sun May 9 20:08:47 2021 +0300 Commit: Sarper Akdemir <sarper.akde...@collabora.com> CommitDate: Thu Jun 10 18:22:07 2021 +0300 tdf#59323: ooxml import: hasNonInheritedShapeProperties Introduces hasNonInheritedShapeProperties helper to PPTShape. If the shape has something imported from it's spPr tag mbHasNoninheritedShapeProperties set to true. Change-Id: I0529f1def8d2c32d5bf06172ce44facdde92893c diff --git a/include/oox/ppt/pptshape.hxx b/include/oox/ppt/pptshape.hxx index f452e585abcf..d27a116e2783 100644 --- a/include/oox/ppt/pptshape.hxx +++ b/include/oox/ppt/pptshape.hxx @@ -51,6 +51,8 @@ class PPTShape final : public oox::drawingml::Shape bool mbReferenced; // placeholdershapes on Layout are displayed only, if they are not referenced // placeholdershapes on Slide are displayed always oox::drawingml::ShapePtr mpPlaceholder; + /// Set if spPr tag is non empty for the shape + bool mbHasNoninheritedShapeProperties; public: @@ -73,6 +75,11 @@ public: void setPlaceholder( oox::drawingml::ShapePtr pPlaceholder ) { mpPlaceholder = pPlaceholder; } void setModelId( const OUString& rId ) { msModelId = rId; } + /// Flags shape as having a non-empty spPr tag + void setHasNoninheritedShapeProperties() { mbHasNoninheritedShapeProperties = true; } + /// Returns whether or not the shape had a non-empty spPr tag + bool hasNonInheritedShapeProperties() const { return mbHasNoninheritedShapeProperties; } + static oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nFirstSubType, const sal_Int32 nSecondSubType, const OptValue< sal_Int32 >& oSubTypeIndex, std::vector< oox::drawingml::ShapePtr >& rShapes, bool bMasterOnly = false ); diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx index 1756ad9e32ab..4e07ae104db3 100644 --- a/oox/source/ppt/pptshape.cxx +++ b/oox/source/ppt/pptshape.cxx @@ -50,6 +50,7 @@ PPTShape::PPTShape( const oox::ppt::ShapeLocation eShapeLocation, const char* pS : Shape( pServiceName ) , meShapeLocation( eShapeLocation ) , mbReferenced( false ) +, mbHasNoninheritedShapeProperties( false ) { } diff --git a/oox/source/ppt/pptshapepropertiescontext.cxx b/oox/source/ppt/pptshapepropertiescontext.cxx index 128272054b21..70ef2fcef872 100644 --- a/oox/source/ppt/pptshapepropertiescontext.cxx +++ b/oox/source/ppt/pptshapepropertiescontext.cxx @@ -20,6 +20,7 @@ #include <oox/ppt/pptshapepropertiescontext.hxx> #include <oox/token/namespaces.hxx> #include <oox/token/properties.hxx> +#include <oox/ppt/pptshape.hxx> using namespace oox::core; using namespace ::com::sun::star; @@ -35,6 +36,10 @@ PPTShapePropertiesContext::PPTShapePropertiesContext( ContextHandler2Helper cons ContextHandlerRef PPTShapePropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) { + PPTShape* pPPTShape = dynamic_cast<PPTShape*>(&mrShape); + if (pPPTShape) + pPPTShape->setHasNoninheritedShapeProperties(); + switch( aElementToken ) { case A_TOKEN( xfrm ): commit b806409bffefe1da3b803ef6d42f594939ea05d6 Author: Sarper Akdemir <sarper.akde...@collabora.com> AuthorDate: Sun May 9 20:00:21 2021 +0300 Commit: Sarper Akdemir <sarper.akde...@collabora.com> CommitDate: Thu Jun 10 18:22:06 2021 +0300 tdf#59323: ooxml import: hasShapeStyleRefs Helper function to determine whether the shape has style refs or not. Change-Id: I57b244b4af5b9e3abba90f0e4e25a35da27e3409 diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx index 53401d18a1c1..1abc9c0a211a 100644 --- a/include/oox/drawingml/shape.hxx +++ b/include/oox/drawingml/shape.hxx @@ -179,6 +179,7 @@ public: ShapeStyleRefMap& getShapeStyleRefs() { return maShapeStyleRefs; } const ShapeStyleRefMap& getShapeStyleRefs() const { return maShapeStyleRefs; } const ShapeStyleRef* getShapeStyleRef( sal_Int32 nRefType ) const; + bool hasShapeStyleRefs() const { return !maShapeStyleRefs.empty(); } // addShape is creating and inserting the corresponding XShape. void addShape( commit 09104c9ee82710dfb55bcb01c25e97cf041f3acd Author: Sarper Akdemir <sarper.akde...@collabora.com> AuthorDate: Sun May 9 19:46:21 2021 +0300 Commit: Sarper Akdemir <sarper.akde...@collabora.com> CommitDate: Thu Jun 10 18:22:05 2021 +0300 tdf#59323: ooxml import: add OOXML to LO datetime helper Added static helper functions getLOTimeFormat and getLODateFormat to TextField class for mapping datetime field types to SvxDateFomat and SvxTimeFormat. Change-Id: I9c1553cc89d47855dc7af06a8ea995de01692ded diff --git a/oox/inc/drawingml/textfield.hxx b/oox/inc/drawingml/textfield.hxx index f365238bd54b..f18eee94ea36 100644 --- a/oox/inc/drawingml/textfield.hxx +++ b/oox/inc/drawingml/textfield.hxx @@ -23,6 +23,9 @@ #include <drawingml/textrun.hxx> #include <drawingml/textparagraphproperties.hxx> +enum class SvxTimeFormat; +enum class SvxDateFormat; + namespace oox::drawingml { struct TextCharacterProperties; @@ -48,6 +51,16 @@ public: const TextCharacterProperties& rTextCharacterStyle, float nDefaultCharHeight) const override; + /** Gets the corresponding LO Date format for given OOXML datetime field type + * + * @param rDateTimeType PPTX datetime field type e.g. datetime3 + */ + static SvxDateFormat getLODateFormat( const OUString& rDateTimeType ); + /** Gets the corresponding LO Time format for given OOXML datetime field type + * + * @param rDateTimeType PPTX datetime field type e.g. datetime3 + */ + static SvxTimeFormat getLOTimeFormat( const OUString& rDateTimeType ); private: TextParagraphProperties maTextParagraphProperties; OUString msType; diff --git a/oox/source/drawingml/textfield.cxx b/oox/source/drawingml/textfield.cxx index 7425e0416fec..c2180c675f1c 100644 --- a/oox/source/drawingml/textfield.cxx +++ b/oox/source/drawingml/textfield.cxx @@ -32,6 +32,7 @@ #include <drawingml/textparagraphproperties.hxx> #include <drawingml/textcharacterproperties.hxx> #include <tools/diagnose_ex.h> +#include <editeng/flditem.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -71,68 +72,28 @@ void lclCreateTextFields( std::vector< Reference< XTextField > > & aFields, aFields.emplace_back( xIface, UNO_QUERY ); return; } - bool bIsDate = true; - int idx = p.toInt32(); - sal_uInt16 nNumFmt; - xIface = xFactory->createInstance( "com.sun.star.text.TextField.DateTime" ); - aFields.emplace_back( xIface, UNO_QUERY ); - Reference< XPropertySet > xProps( xIface, UNO_QUERY_THROW ); - - // here we should format the field properly. waiting after #i81091. - switch( idx ) + + SvxDateFormat eDateFormat = TextField::getLODateFormat(sType); + if (eDateFormat != SvxDateFormat::AppDefault) { - case 1: // Date dd/mm/yyyy - // this is the default format... - nNumFmt = 5; - xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt)); - break; - case 2: // Date Day, Month dd, yyyy - break; - case 3: // Date dd Month yyyy - nNumFmt = 3; - xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt)); - break; - case 4: // Date Month dd, yyyy - break; - case 5: // Date dd-Mon-yy - break; - case 6: // Date Month yy - break; - case 7: // Date Mon-yy - break; - case 8: // DateTime dd/mm/yyyy H:MM PM - lclCreateTextFields( aFields, xModel, "datetime12" ); - break; - case 9: // DateTime dd/mm/yy H:MM:SS PM - lclCreateTextFields( aFields, xModel, "datetime13" ); - break; - case 10: // Time H:MM - bIsDate = false; - nNumFmt = 3; - xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt)); - break; - case 11: // Time H:MM:SS - bIsDate = false; - // this is the default format - nNumFmt = 2; - xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt)); - break; - case 12: // Time H:MM PM - bIsDate = false; - nNumFmt = 6; - xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt)); - break; - case 13: // Time H:MM:SS PM - bIsDate = false; - nNumFmt = 7; - xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt)); - break; - default: - nNumFmt = 2; - xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt)); + xIface = xFactory->createInstance( "com.sun.star.text.TextField.DateTime" ); + aFields.emplace_back( xIface, UNO_QUERY ); + Reference< XPropertySet > xProps( xIface, UNO_QUERY_THROW ); + xProps->setPropertyValue("NumberFormat", Any(static_cast<int>(eDateFormat))); + xProps->setPropertyValue("IsDate", Any(true)); + xProps->setPropertyValue("IsFixed", Any(false)); + } + + SvxTimeFormat eTimeFormat = TextField::getLOTimeFormat(sType); + if (eTimeFormat != SvxTimeFormat::AppDefault) + { + xIface = xFactory->createInstance( "com.sun.star.text.TextField.DateTime" ); + aFields.emplace_back( xIface, UNO_QUERY ); + Reference< XPropertySet > xProps( xIface, UNO_QUERY_THROW ); + xProps->setPropertyValue("NumberFormat", Any(static_cast<int>(eTimeFormat))); + xProps->setPropertyValue("IsDate", Any(false)); + xProps->setPropertyValue("IsFixed", Any(false)); } - xProps->setPropertyValue( "IsDate", makeAny( bIsDate ) ); - xProps->setPropertyValue( "IsFixed", makeAny( false ) ); } catch(const Exception &) { @@ -245,6 +206,66 @@ sal_Int32 TextField::insertAt( return nCharHeight; } +SvxDateFormat TextField::getLODateFormat(const OUString& rDateTimeType) +{ + OString aDateTimeNum = (OUStringToOString(rDateTimeType, RTL_TEXTENCODING_UTF8).pData->buffer + 8); + + if( aDateTimeNum.isEmpty() ) // "datetime" + return SvxDateFormat::StdSmall; + + int nDateTimeNum = aDateTimeNum.toInt32(); + + switch( nDateTimeNum ) + { + case 1: // Date dd/mm/yyyy + case 2: // Date Day, Month dd, yyyy + case 5: // Date dd-Mon-yy + case 6: // Date Month yy + case 7: // Date Mon-yy + case 8: // DateTime dd/mm/yyyy H:MM PM + case 9: // DateTime dd/mm/yyyy H:MM:SS PM + return SvxDateFormat::B; + case 3: // Date dd Month yyyy + return SvxDateFormat::StdBig; + case 4: // Date Month dd, yyyy + return SvxDateFormat::StdSmall; + case 10: // Time H:MM + case 11: // Time H:MM:SS + case 12: // Time H:MM PM + case 13: // Time H:MM:SS PM + default: + return SvxDateFormat::AppDefault; + } +} + +SvxTimeFormat TextField::getLOTimeFormat(const OUString& rDateTimeType) +{ + OString aDateTimeNum = (OUStringToOString(rDateTimeType, RTL_TEXTENCODING_UTF8).pData->buffer + 8); + int nDateTimeNum = aDateTimeNum.toInt32(); + + switch( nDateTimeNum ) + { + case 8: // DateTime dd/mm/yyyy H:MM PM + case 12: // Time H:MM PM + return SvxTimeFormat::HH12_MM; + case 9: // DateTime dd/mm/yyyy H:MM:SS PM + case 13: // Time H:MM:SS PM + return SvxTimeFormat::HH12_MM_SS; + case 10: // Time H:MM + return SvxTimeFormat::HH24_MM; + case 11: // Time H:MM:SS + return SvxTimeFormat::Standard; + case 1: // Date dd/mm/yyyy + case 2: // Date Day, Month dd, yyyy + case 3: // Date dd Month yyyy + case 4: // Date Month dd, yyyy + case 5: // Date dd-Mon-yy + case 6: // Date Month yy + case 7: // Date Mon-yy + default: + return SvxTimeFormat::AppDefault; + } +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 72bc2412db4f621d2c08e9b539fc9b9f441065e3 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Thu Jun 10 15:34:54 2021 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Thu Jun 10 16:54:48 2021 +0200 -Werror,-Wunused-but-set-variable (Clang 13 trunk) ...ever since the code block's introduction in 14bc62ad0d9e0179f4178d2913ebba7abf99755e "INTEGRATION: CWS aquafilepicker02_DEV300" Change-Id: Id4cda7ed087b350361b0207034fc31819d65efad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116992 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/fpicker/source/aqua/ControlHelper.mm b/fpicker/source/aqua/ControlHelper.mm index 100e00dc662a..22b7f37b1a13 100644 --- a/fpicker/source/aqua/ControlHelper.mm +++ b/fpicker/source/aqua/ControlHelper.mm @@ -817,7 +817,6 @@ void ControlHelper::layoutControls() //get the control's bounds NSRect controlRect = [activeControl frame]; int nControlHeight = controlRect.size.height; - int nControlWidth = controlRect.size.width; //subtract the height from the current vertical position, because the control's bounds origin rect will be its lower left hand corner currenttop -= nControlHeight; @@ -859,7 +858,6 @@ void ControlHelper::layoutControls() } else { currenttop += kAquaSpaceSwitchButtonFrameBoundsDiff;//from top - nControlWidth = nCheckboxMaxWidth; int left = (nUsableWidth - nCheckboxMaxWidth) / 2; controlRect.origin.x = left; controlRect.origin.y = currenttop; commit e97a9211c08fe28d2b46d0a1371f0b391b5343b2 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Thu Jun 10 14:58:23 2021 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Thu Jun 10 16:44:43 2021 +0200 -Werror,-Wunused-but-set-variable (Clang 13 trunk) ...ever since the code's introduction in adf0066a17538a394550237a54f6fc0027f6ed29 "#i91478# aqua implementation (continued)" Change-Id: I2dd7bbaba9e8068929f4792b7f953cbf01e03a7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116989 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/vcl/osx/printaccessoryview.mm b/vcl/osx/printaccessoryview.mm index 7656c1b9df06..92c09f7dd47f 100644 --- a/vcl/osx/printaccessoryview.mm +++ b/vcl/osx/printaccessoryview.mm @@ -1063,7 +1063,6 @@ static void addEdit( NSView* pCurParent, CGFloat rCurX, CGFloat& rCurY, CGFloat OUString aPropertyName; OUString aGroupHint; Sequence< OUString > aChoices; - bool bEnabled = true; sal_Int64 nMinValue = 0, nMaxValue = 0; CGFloat nAttachOffset = 0; bool bIgnore = false; @@ -1089,12 +1088,6 @@ static void addEdit( NSView* pCurParent, CGFloat rCurX, CGFloat& rCurY, CGFloat rEntry.Value >>= aVal; aPropertyName = aVal.Name; } - else if( rEntry.Name == "Enabled" ) - { - bool bValue = true; - rEntry.Value >>= bValue; - bEnabled = bValue; - } else if( rEntry.Name == "MinValue" ) { rEntry.Value >>= nMinValue; commit 5951da5175b9d7e5b3b47bd0d90989d2ef528c79 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu Jun 10 15:11:03 2021 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Thu Jun 10 16:35:34 2021 +0200 sw image anchor type: add style UI for this A frame style contains RES_ANCHOR, and SwFormatAnchor::m_eAnchorId already describes an anchor type. This is even exposed on the UNO API as the AnchorType property and its ODF import/export is also implemented. Enable UI for this, so that templates can decide the default anchor type when inserting images. Still keep the "to frame" anchor type disabled as its meaning is unclear for frame styles. Change-Id: I5d8ef63af9c8f2efa6485c4ec827ba9aef9b8956 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116990 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index dc148972e277..09d732efce5a 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -884,8 +884,8 @@ void SwFramePage::Reset( const SfxItemSet *rSet ) if (m_bFormat) { - // at formats no anchor editing - m_xAnchorFrame->set_sensitive(false); + // at formats no to-fly anchor + m_xAnchorAtFrameRB->set_sensitive(false); if (rSet->GetItemState(FN_KEEP_ASPECT_RATIO) != SfxItemState::SET) { m_xFixedRatioCB->set_sensitive(false); @@ -1047,7 +1047,7 @@ bool SwFramePage::FillItemSet(SfxItemSet *rSet) RndStdIds eAnchorId = GetAnchor(); - if ( !m_bFormat ) + if ( !m_bFormat || eAnchorId != RndStdIds::FLY_AT_FLY ) { pOldItem = GetOldItem(*rSet, RES_ANCHOR); if (m_bNew || !pOldItem || eAnchorId != static_cast<const SwFormatAnchor*>(pOldItem)->GetAnchorId()) @@ -2287,7 +2287,7 @@ void SwFramePage::SetFormatUsed(bool bFormatUsed) { m_bFormat = bFormatUsed; if (m_bFormat) - m_xAnchorFrame->hide(); + m_xAnchorAtFrameRB->hide(); } void SwFramePage::EnableVerticalPositioning( bool bEnable ) commit 71070e7df254ffdcf57f4c82b1597d9855218f23 Author: Olivier Hallot <olivier.hal...@libreoffice.org> AuthorDate: Thu Jun 10 11:32:25 2021 -0300 Commit: Gerrit Code Review <ger...@gerrit.libreoffice.org> CommitDate: Thu Jun 10 16:32:25 2021 +0200 Update git submodules * Update helpcontent2 from branch 'master' to 2b074d47c5f66d96576df2003b29d3cf09b4702a - tdf#130063 Add Help page for revamped B&N dialog for Impress and Draw Change-Id: I770a45ff062056ee38d904324e1f0148a7eec9da Reviewed-on: https://gerrit.libreoffice.org/c/help/+/116945 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hal...@libreoffice.org> diff --git a/helpcontent2 b/helpcontent2 index db2d4a1373cc..2b074d47c5f6 160000 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit db2d4a1373cc1a025888c4ef0359620eac3f88f6 +Subproject commit 2b074d47c5f66d96576df2003b29d3cf09b4702a commit 57b80927410a2020c34ff0775931b08b2f7dfffd Author: Olivier Hallot <olivier.hal...@libreoffice.org> AuthorDate: Thu Jun 10 11:31:49 2021 -0300 Commit: Gerrit Code Review <ger...@gerrit.libreoffice.org> CommitDate: Thu Jun 10 16:31:49 2021 +0200 Update git submodules * Update helpcontent2 from branch 'master' to db2d4a1373cc1a025888c4ef0359620eac3f88f6 - tdf#112685 Advanced TSCP classification help page * Refactor TSCP pages * Add help page for Classification dialog * Add Help page for Classification Toolbar Change-Id: Id11c15d6937400b7cd28a5d80c4e9438693b28a1 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/116874 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hal...@libreoffice.org> diff --git a/helpcontent2 b/helpcontent2 index e5ac483bab25..db2d4a1373cc 160000 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit e5ac483bab252537ccbd087e6a133230cb8bae70 +Subproject commit db2d4a1373cc1a025888c4ef0359620eac3f88f6 commit 0c8e119c9732e21b9391a4751200988b08594138 Author: Olivier Hallot <olivier.hal...@libreoffice.org> AuthorDate: Wed Jun 9 10:05:45 2021 -0300 Commit: Olivier Hallot <olivier.hal...@libreoffice.org> CommitDate: Thu Jun 10 16:30:06 2021 +0200 Add extended tips to document classification dialog Change-Id: I41ffe5c66e56ec7add2d4fcbb129ae2e3ff13b20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116915 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hal...@libreoffice.org> diff --git a/svx/uiconfig/ui/classificationdialog.ui b/svx/uiconfig/ui/classificationdialog.ui index 713d3c3e0d78..e0f40e1edd03 100644 --- a/svx/uiconfig/ui/classificationdialog.ui +++ b/svx/uiconfig/ui/classificationdialog.ui @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.22.1 --> +<!-- Generated with glade 3.38.2 --> <interface domain="svx"> <requires lib="gtk+" version="3.20"/> <object class="GtkImage" id="image1"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="icon_name">cmd/lc_bold.png</property> + <property name="can-focus">False</property> + <property name="icon-name">cmd/lc_bold.png</property> </object> <object class="GtkTreeStore" id="liststore1"> <columns> @@ -32,33 +32,30 @@ </columns> </object> <object class="GtkDialog" id="AdvancedDocumentClassificationDialog"> - <property name="can_focus">False</property> - <property name="border_width">6</property> + <property name="can-focus">False</property> + <property name="border-width">6</property> <property name="title" translatable="yes" context="classificationdialog|dialogname">Classification</property> <property name="modal">True</property> - <property name="default_width">0</property> - <property name="default_height">0</property> - <property name="type_hint">dialog</property> - <child> - <placeholder/> - </child> + <property name="default-width">0</property> + <property name="default-height">0</property> + <property name="type-hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="orientation">vertical</property> <property name="spacing">12</property> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area1"> - <property name="can_focus">False</property> - <property name="layout_style">end</property> + <property name="can-focus">False</property> + <property name="layout-style">end</property> <child> <object class="GtkButton" id="ok"> <property name="label" translatable="yes" context="stock">_OK</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="has-default">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -71,8 +68,8 @@ <object class="GtkButton" id="cancel"> <property name="label" translatable="yes" context="stock">_Cancel</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -85,8 +82,8 @@ <object class="GtkButton" id="help"> <property name="label" translatable="yes" context="stock">_Help</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can-focus">True</property> + <property name="receives-default">True</property> <property name="use-underline">True</property> </object> <packing> @@ -100,28 +97,28 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="pack_type">end</property> + <property name="pack-type">end</property> <property name="position">0</property> </packing> </child> <child> - <!-- n-columns=1 n-rows=1 --> + <!-- n-columns=2 n-rows=2 --> <object class="GtkGrid"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> + <property name="can-focus">False</property> + <property name="row-spacing">6</property> + <property name="column-spacing">6</property> <child> - <!-- n-columns=1 n-rows=1 --> + <!-- n-columns=2 n-rows=5 --> <object class="GtkGrid"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> + <property name="can-focus">False</property> + <property name="row-spacing">6</property> + <property name="column-spacing">6</property> <child> <object class="GtkLabel" id="classificationLabel"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="classificationdialog|label-Classification">Classification:</property> <property name="xalign">0</property> <accessibility> @@ -129,14 +126,14 @@ </accessibility> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="left-attach">0</property> + <property name="top-attach">1</property> </packing> </child> <child> <object class="GtkLabel" id="internationalClassificationLabel"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes" context="classificationdialog|label-InternationalClassification">International:</property> <property name="xalign">0</property> <accessibility> @@ -144,41 +141,51 @@ </accessibility> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="left-attach">0</property> + <property name="top-attach">2</property> </packing> </child> <child> <object class="GtkComboBoxText" id="classificationCB"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="hexpand">True</property> <accessibility> <relation type="labelled-by" target="classificationLabel"/> </accessibility> + <child internal-child="accessible"> + <object class="AtkObject" id="classificationCB-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="classificationdialog|extended_tip|classiticationCB">Lists the translated document and paragraph classification levels of your installation.</property> + </object> + </child> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> + <property name="left-attach">1</property> + <property name="top-attach">1</property> </packing> </child> <child> <object class="GtkComboBoxText" id="internationalClassificationCB"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <accessibility> <relation type="labelled-by" target="internationalClassificationLabel"/> </accessibility> + <child internal-child="accessible"> + <object class="AtkObject" id="internationalClassificationCB-atkobject"> ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits