core.git: xmloff/source
xmloff/source/core/xmlimp.cxx | 35 +++ 1 file changed, 27 insertions(+), 8 deletions(-) New commits: commit bf02c5fa586d2ff7dbfac37d3ea0a07675efc15e Author: Mike Kaganski AuthorDate: Mon Jun 10 11:08:56 2024 +0500 Commit: Mike Kaganski CommitDate: Mon Jun 10 09:16:49 2024 +0200 tdf#161488: allow failed image loading in repair mode Change-Id: I19a68f2f016b5ab95565c7fbcc4c435cf13c6b48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168596 Reviewed-by: Mike Kaganski Tested-by: Jenkins diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index b39775f0699d..016ca91dc014 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -1303,19 +1303,38 @@ uno::Reference SvXMLImport::loadGraphicByURL(OUString const & { uno::Reference xGraphic; -if (mxGraphicStorageHandler.is()) +try { -if (IsPackageURL(rURL)) +if (mxGraphicStorageHandler.is()) { -xGraphic = mxGraphicStorageHandler->loadGraphic(rURL); +if (IsPackageURL(rURL)) +{ +xGraphic = mxGraphicStorageHandler->loadGraphic(rURL); +} +else +{ +OUString const& rAbsoluteURL = GetAbsoluteReference(rURL); +GraphicExternalLink aExternalLink(rAbsoluteURL); +Graphic aGraphic(aExternalLink); +xGraphic = aGraphic.GetXGraphic(); +} } -else +} +catch (...) +{ +bool bRepairPackage = false; +if (auto const xStorProps{ GetSourceStorage().query() }) { -OUString const & rAbsoluteURL = GetAbsoluteReference(rURL); -GraphicExternalLink aExternalLink(rAbsoluteURL); -Graphic aGraphic(aExternalLink); -xGraphic = aGraphic.GetXGraphic(); +try +{ +xStorProps->getPropertyValue(u"RepairPackage"_ustr) >>= bRepairPackage; +} +catch (uno::Exception&) +{ +} } +if (!bRepairPackage) +throw; } return xGraphic;
core.git: xmloff/source
xmloff/source/chart/SchXMLChartContext.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 15160b7af066579b7600ecf6b28c2099d2553563 Author: Laurent Balland AuthorDate: Sat Apr 6 15:12:45 2024 +0200 Commit: Laurent Balland CommitDate: Fri May 31 10:24:54 2024 +0200 tdf#160564 Treat xlink:type for embedded chart xlink:type is a valid attribute for chart:chart according to ODF [1] As this attribute is not yet used, this change just avoids the warning message [1] https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part3-schema/OpenDocument-v1.3-os-part3-schema.html#__RefHeading__1419428_253892949 Change-Id: I836c8ff4a284bafa8e0c8049ae6ae60c9fbe7a4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165853 Reviewed-by: Laurent Balland Tested-by: Jenkins diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index 540f39ca9f01..418bea825054 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -327,6 +327,9 @@ void SchXMLChartContext::startFastElement( sal_Int32 /*nElement*/, case XML_ELEMENT(LO_EXT, XML_DATA_PILOT_SOURCE): msDataPilotSource = aIter.toString(); break; +case XML_ELEMENT( XLINK, XML_TYPE ): +// Ignored for now. +break; case XML_ELEMENT(XLINK, XML_HREF): m_aXLinkHRefAttributeToIndicateDataProvider = aIter.toString(); break;
core.git: xmloff/source
xmloff/source/transform/EventMap.cxx | 140 - xmloff/source/transform/EventMap.hxx |7 - xmloff/source/transform/EventOASISTContext.cxx |6 - xmloff/source/transform/EventOOoTContext.cxx |6 - 4 files changed, 80 insertions(+), 79 deletions(-) New commits: commit 84687944439f5a2d96d771429bf58bf49b084d8c Author: Noel Grandin AuthorDate: Fri May 3 10:50:55 2024 +0200 Commit: Noel Grandin CommitDate: Mon May 6 13:56:26 2024 +0200 replace createFromAscii with OUString literals in XMLTransformerOASISEventMap Change-Id: I48e04ebfac7898747b3481d4359f3ed4dd4c351d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167169 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/transform/EventMap.cxx b/xmloff/source/transform/EventMap.cxx index 3cfa08a15db0..d509de7352b9 100644 --- a/xmloff/source/transform/EventMap.cxx +++ b/xmloff/source/transform/EventMap.cxx @@ -23,81 +23,81 @@ XMLTransformerEventMapEntry const aTransformerEventMap[] = { -{ XML_NAMESPACE_DOM,"select", "on-select" }, -{ XML_NAMESPACE_OFFICE, "insert-start", "on-insert-start" }, -{ XML_NAMESPACE_OFFICE, "insert-done", "on-insert-done" }, -{ XML_NAMESPACE_OFFICE, "mail-merge", "on-mail-merge" }, -{ XML_NAMESPACE_OFFICE, "alpha-char-input", "on-alpha-char-input" }, -{ XML_NAMESPACE_OFFICE, "non-alpha-char-input", "on-non-alpha-char-input" }, -{ XML_NAMESPACE_DOM,"resize", "on-resize" }, -{ XML_NAMESPACE_OFFICE, "move", "on-move" }, -{ XML_NAMESPACE_OFFICE, "page-count-change", "on-page-count-change" }, -{ XML_NAMESPACE_DOM,"mouseover","on-mouse-over" }, -{ XML_NAMESPACE_DOM,"click","on-click" }, -{ XML_NAMESPACE_DOM,"mouseout", "on-mouse-out" }, -{ XML_NAMESPACE_OFFICE, "load-error", "on-load-error" }, -{ XML_NAMESPACE_OFFICE, "load-cancel", "on-load-cancel" }, -{ XML_NAMESPACE_OFFICE, "load-done","on-load-done" }, -{ XML_NAMESPACE_DOM,"load", "on-load" }, -{ XML_NAMESPACE_DOM,"unload", "on-unload" }, -{ XML_NAMESPACE_OFFICE, "start-app","on-start-app" }, -{ XML_NAMESPACE_OFFICE, "close-app","on-close-app" }, -{ XML_NAMESPACE_OFFICE, "new", "on-new" }, -{ XML_NAMESPACE_OFFICE, "save", "on-save" }, -{ XML_NAMESPACE_OFFICE, "save-as", "on-save-as" }, -{ XML_NAMESPACE_DOM,"DOMFocusIn", "on-focus" }, -{ XML_NAMESPACE_DOM,"DOMFocusOut", "on-unfocus" }, -{ XML_NAMESPACE_OFFICE, "print","on-print" }, -{ XML_NAMESPACE_DOM,"error","on-error" }, -{ XML_NAMESPACE_OFFICE, "load-finished","on-load-finished" }, -{ XML_NAMESPACE_OFFICE, "save-finished","on-save-finished" }, -{ XML_NAMESPACE_OFFICE, "modify-changed", "on-modify-changed" }, -{ XML_NAMESPACE_OFFICE, "prepare-unload", "on-prepare-unload" }, -{ XML_NAMESPACE_OFFICE, "new-mail", "on-new-mail" }, -{ XML_NAMESPACE_OFFICE, "toggle-fullscreen","on-toggle-fullscreen" }, -{ XML_NAMESPACE_OFFICE, "save-done","on-save-done" }, -{ XML_NAMESPACE_OFFICE, "save-as-done", "on-save-as-done" }, -{ XML_NAMESPACE_OFFICE, "create","on-create" }, -{ XML_NAMESPACE_OFFICE, "save-as-failed","on-save-as-failed" }, -{ XML_NAMESPACE_OFFICE, "save-failed","on-save-failed" }, -{ XML_NAMESPACE_OFFICE, "copy-to-failed","on-copy-to-failed" }, -{ XML_NAMESPACE_OFFICE, "title-changed","on-title-changed" }, +{ XML_NAMESPACE_DOM,u"select"_ustr, u"on-select"_ustr }, +{ XML_NAMESPACE_OFFICE, u"insert-start"_ustr, u"on-insert-start"_ustr }, +{ XML_NAMESPACE_OFFICE, u"insert-done"_ustr, u"on-insert-done"_ustr }, +{ XML_NAMESPACE_OFFICE, u"mail-merge"_ustr, u"on-mail-merge"_ustr }, +{ XML_NAMESPACE_OFFICE, u"alpha-char-input"_ustr, u"on-alpha-char-input"_ustr }, +{ XML_NAMESPACE_OFFICE, u"non-alpha-char-input"_ustr, u"on-non-alpha-char-input"_ustr }, +{ XML_NAMESPACE_DOM,u"resize"_ustr, u"on-resize"_ustr }, +{ XML_NAMESPACE_OFFICE, u"move"_ustr, u"on-move"_ustr }, +{ XML_NAMESPACE_OFFICE, u"page-count-change"_ustr, u"on-page-count-change"_ustr }, +{ XML_NAMESPACE_DOM,u"mouseover"_ustr,u"on-mouse-over"_ustr }, +{ XML_NAMESPACE_DOM,u"click"_ustr,u"on-click"_ustr }, +{ XML_NAMESPACE_DOM,u"mouseout"_ustr, u"on-mouse-out"_ustr }, +{ XML_NAMESPACE_OFFICE, u"load-error"_ustr, u"on-load-error"_ustr }, +{ XML_NAMESPACE_OFFICE, u"load-cancel"_ustr, u"on-load-cancel"_ustr }, +{ XML_NAMESPACE_OFFICE, u"load-done"_ustr,u"on-load-done"_ustr }, +{ XML_NAMESPACE_DOM,u"load"_ustr, u"on-load"_ustr }, +{ XML_NAMESPACE_DOM,u"unload"_ustr, u"on-unload"_ustr }, +{ XML_NAMESPACE_OFFICE, u"start-app"_ustr,u"on-start-app"_ustr }, +{ XML_NAMESPACE_OFFICE, u"close-app"_ustr,u"on-close-app"_ustr }, +{ XML_NAMESPACE_OFFICE,
core.git: xmloff/source
xmloff/source/xforms/xformsexport.cxx | 125 -- 1 file changed, 62 insertions(+), 63 deletions(-) New commits: commit 5326e00cf37ebc796c650bff774441b7ec40dec8 Author: Noel Grandin AuthorDate: Fri May 3 10:56:18 2024 +0200 Commit: Noel Grandin CommitDate: Mon May 6 12:03:15 2024 +0200 replace createFromAscii with OUString literals in xforms Change-Id: I30e56eb11635227616a5cf2dee2c166bdd383498 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167170 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx index b0d5c9e99820..713fc7f04b88 100644 --- a/xmloff/source/xforms/xformsexport.cxx +++ b/xmloff/source/xforms/xformsexport.cxx @@ -110,10 +110,10 @@ namespace { struct ExportTable { -const char* pPropertyName; -sal_uInt16 const nNamespace; +OUString pPropertyName; +sal_uInt16 nNamespace; sal_uInt16 nToken; -convert_t const aConverter; +convert_t aConverter; }; } @@ -122,7 +122,7 @@ static void lcl_export( const Reference& rPropertySet, SvXMLExport& rExport, const ExportTable* pTable ); -#define TABLE_END { nullptr, 0, 0, nullptr } +#define TABLE_END { u""_ustr, 0, 0, nullptr } // any conversion functions static OUString xforms_string( const Any& ); @@ -153,10 +153,10 @@ static OUString lcl_getXSDType( SvXMLExport const & rExport, // the model -const ExportTable aXFormsModelTable[] = +constexpr ExportTable aXFormsModelTable[] = { -{ "ID", XML_NAMESPACE_NONE, xmloff::token::XML_ID, xforms_string }, -{ "SchemaRef", XML_NAMESPACE_NONE, xmloff::token::XML_SCHEMA, xforms_string }, +{ u"ID"_ustr, XML_NAMESPACE_NONE, xmloff::token::XML_ID, xforms_string }, +{ u"SchemaRef"_ustr, XML_NAMESPACE_NONE, xmloff::token::XML_SCHEMA, xforms_string }, TABLE_END }; @@ -252,15 +252,15 @@ void exportXFormsInstance( SvXMLExport& rExport, // the binding -const ExportTable aXFormsBindingTable[] = +constexpr ExportTable aXFormsBindingTable[] = { -{ "BindingID", XML_NAMESPACE_NONE, xmloff::token::XML_ID, xforms_string }, -{ "BindingExpression", XML_NAMESPACE_NONE, xmloff::token::XML_NODESET, xforms_string }, -{ "ReadonlyExpression", XML_NAMESPACE_NONE, xmloff::token::XML_READONLY, xforms_string }, -{ "RelevantExpression", XML_NAMESPACE_NONE, xmloff::token::XML_RELEVANT, xforms_string }, -{ "RequiredExpression", XML_NAMESPACE_NONE, xmloff::token::XML_REQUIRED, xforms_string }, -{ "ConstraintExpression", XML_NAMESPACE_NONE, xmloff::token::XML_CONSTRAINT, xforms_string }, -{ "CalculateExpression", XML_NAMESPACE_NONE, xmloff::token::XML_CALCULATE, xforms_string }, +{ u"BindingID"_ustr, XML_NAMESPACE_NONE, xmloff::token::XML_ID, xforms_string }, +{ u"BindingExpression"_ustr, XML_NAMESPACE_NONE, xmloff::token::XML_NODESET, xforms_string }, +{ u"ReadonlyExpression"_ustr, XML_NAMESPACE_NONE, xmloff::token::XML_READONLY, xforms_string }, +{ u"RelevantExpression"_ustr, XML_NAMESPACE_NONE, xmloff::token::XML_RELEVANT, xforms_string }, +{ u"RequiredExpression"_ustr, XML_NAMESPACE_NONE, xmloff::token::XML_REQUIRED, xforms_string }, +{ u"ConstraintExpression"_ustr, XML_NAMESPACE_NONE, xmloff::token::XML_CONSTRAINT, xforms_string }, +{ u"CalculateExpression"_ustr, XML_NAMESPACE_NONE, xmloff::token::XML_CALCULATE, xforms_string }, // type handled separately, for type name <-> XSD type conversion // { "Type", XML_NAMESPACE_NONE, xmloff::token::XML_TYPE, xforms_string }, TABLE_END @@ -366,23 +366,23 @@ void exportXFormsBinding( SvXMLExport& rExport, // the submission -const ExportTable aXFormsSubmissionTable[] = +constexpr ExportTable aXFormsSubmissionTable[] = { -{ "ID", XML_NAMESPACE_NONE, xmloff::token::XML_ID, xforms_string }, -{ "Bind", XML_NAMESPACE_NONE, xmloff::token::XML_BIND, xforms_string }, -{ "Ref", XML_NAMESPACE_NONE, xmloff::token::XML_REF, xforms_string }, -{ "Action", XML_NAMESPACE_NONE, xmloff::token::XML_ACTION, xforms_string }, -{ "Method", XML_NAMESPACE_NONE, xmloff::token::XML_METHOD, xforms_string }, -{ "Version", XML_NAMESPACE_NONE, xmloff::token::XML_VERSION, xforms_string }, -{ "Indent", XML_NAMESPACE_NONE, xmloff::token::XML_INDENT, xforms_bool }, -{ "MediaType", XML_NAMESPACE_NONE, xmloff::token::XML_MEDIATYPE, xforms_string }, -{ "Encoding", XML_NAMESPACE_NONE, xmloff::token::XML_ENCODING, xforms_string }, -{ "OmitXmlDeclaration", XML_NAMESPACE_NONE, xmloff::token::XML_OMIT_XML_DECLARATION, xforms_bool }, -{ "Standalone", XML_NAMESPACE_NONE, xmloff::token::XML_STANDALONE, xforms_bool }, -{ "CDataSectionElement", XML_NAMESPACE_NONE, xmloff::token::XML_CDATA_SECTION_ELEMENTS, xforms_string }, -{ "Replace", XML_NAMESPACE_NONE, xmloff::token::XML_REPLACE, xforms_string }, -{ "Separator",
core.git: xmloff/source
xmloff/source/draw/XMLNumberStyles.cxx | 55 - 1 file changed, 27 insertions(+), 28 deletions(-) New commits: commit 8fe2ab985d974440265f48c6f70dbf813a760c40 Author: Noel Grandin AuthorDate: Fri May 3 10:08:20 2024 +0200 Commit: Noel Grandin CommitDate: Mon May 6 08:26:50 2024 +0200 replace createFromAscii with OUString literals in SdXMLNumberFormatImport Change-Id: I17c9bad132b55b120a3b67cdda39d5a603baeae4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167154 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/xmloff/source/draw/XMLNumberStyles.cxx b/xmloff/source/draw/XMLNumberStyles.cxx index 87a34cdcf6c1..ff6a809e7c8d 100644 --- a/xmloff/source/draw/XMLNumberStyles.cxx +++ b/xmloff/source/draw/XMLNumberStyles.cxx @@ -40,33 +40,33 @@ struct SdXMLDataStyleNumber boolmbLong; boolmbTextual; boolmbDecimal02; -const char* mpText; +OUString maText; }; } -SdXMLDataStyleNumber const aSdXMLDataStyleNumbers[] = -{ -{ XML_DAY, false, false, false, nullptr }, -{ XML_DAY, true, false, false, nullptr }, -{ XML_MONTH,true, false, false, nullptr }, -{ XML_MONTH,false, true, false, nullptr }, -{ XML_MONTH,true, true, false, nullptr }, -{ XML_YEAR, false, false, false, nullptr }, -{ XML_YEAR, true, false, false, nullptr }, -{ XML_DAY_OF_WEEK, false, false, false, nullptr }, -{ XML_DAY_OF_WEEK, true, false, false, nullptr }, -{ XML_TEXT, false, false, false, "." }, -{ XML_TEXT, false, false, false, " " }, -{ XML_TEXT, false, false, false, ", " }, -{ XML_TEXT, false, false, false, ". " }, -{ XML_HOURS,false, false, false, nullptr }, -{ XML_MINUTES, false, false, false, nullptr }, -{ XML_TEXT, false, false, false, ":" }, -{ XML_AM_PM,false, false, false, nullptr }, -{ XML_SECONDS, false, false, false, nullptr }, -{ XML_SECONDS, false, false, true, nullptr }, -{ XML_TOKEN_INVALID,false, false, false, nullptr } +SdXMLDataStyleNumber constexpr aSdXMLDataStyleNumbers[] = +{ +{ XML_DAY, false, false, false, u""_ustr }, +{ XML_DAY, true, false, false, u""_ustr }, +{ XML_MONTH,true, false, false, u""_ustr }, +{ XML_MONTH,false, true, false, u""_ustr }, +{ XML_MONTH,true, true, false, u""_ustr }, +{ XML_YEAR, false, false, false, u""_ustr }, +{ XML_YEAR, true, false, false, u""_ustr }, +{ XML_DAY_OF_WEEK, false, false, false, u""_ustr }, +{ XML_DAY_OF_WEEK, true, false, false, u""_ustr }, +{ XML_TEXT, false, false, false, u"."_ustr }, +{ XML_TEXT, false, false, false, u" "_ustr }, +{ XML_TEXT, false, false, false, u", "_ustr }, +{ XML_TEXT, false, false, false, u". "_ustr }, +{ XML_HOURS,false, false, false, u""_ustr }, +{ XML_MINUTES, false, false, false, u""_ustr }, +{ XML_TEXT, false, false, false, u":"_ustr }, +{ XML_AM_PM,false, false, false, u""_ustr }, +{ XML_SECONDS, false, false, false, u""_ustr }, +{ XML_SECONDS, false, false, true, u""_ustr }, +{ XML_TOKEN_INVALID,false, false, false, u""_ustr } }; // date @@ -339,10 +339,9 @@ static void SdXMLExportDataStyleNumber( SdXMLExport& rExport, SdXMLDataStyleNumb } SvXMLElementExport aNumberStyle( rExport, XML_NAMESPACE_NUMBER, rElement.meNumberStyle, true, false ); -if( rElement.mpText ) +if( !rElement.maText.isEmpty() ) { -OUString sAttrValue( OUString::createFromAscii( rElement.mpText ) ); -rExport.GetDocHandler()->characters( sAttrValue ); +rExport.GetDocHandler()->characters( rElement.maText ); } } @@ -613,8 +612,8 @@ void SdXMLNumberFormatImportContext::add( std::u16string_view rNumberStyle, bool (pStyleMember->mbLong == bLong) && (pStyleMember->mbTextual == bTextual) && (pStyleMember->mbDecimal02 == bDecimal02) && -( ( (pStyleMember->mpText == nullptr) && (rText.empty()) ) || - ( pStyleMember->mpText && (o3tl::equalsAscii( rText,
core.git: xmloff/source
xmloff/source/text/txtparae.cxx | 43 1 file changed, 43 deletions(-) New commits: commit e73e117c1309b586f59a4c901aa30117f457727c Author: Mike Kaganski AuthorDate: Fri Apr 26 00:44:45 2024 +0500 Commit: Mike Kaganski CommitDate: Fri Apr 26 05:49:50 2024 +0200 This block seems obsolete now, try to drop it ... and see if something breaks. Unit tests pass. Likely obsoleted by commit 69ed893087f89d176a5ec4b263ce8d75774be72b (tdf#160253: fix list identifier export decision code, 2024-04-24). Change-Id: I4fde19e1047104686df22053c9b140819ea72963 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166651 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 09af34d44648..df324c16acad 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -1684,49 +1684,6 @@ void XMLTextParagraphExport::collectTextAutoStylesAndNodeExportOrder(bool bIsPro } } -Reference< XNumberingRulesSupplier > xNumberingRulesSupp( GetExport().GetModel(), UNO_QUERY ); -if ( xNumberingRulesSupp.is() ) -{ -Reference< XIndexAccess > xNumberingRules = xNumberingRulesSupp->getNumberingRules(); -sal_Int32 nCount = xNumberingRules->getCount(); -// Custom outline assignment lost after re-importing sxw (#i73361#) -for( sal_Int32 i = 0; i < nCount; ++i ) -{ -Reference< XIndexReplace > xNumRule( xNumberingRules->getByIndex( i ), UNO_QUERY ); -if( xNumRule.is() && xNumRule->getCount() ) -{ -Reference < XNamed > xNamed( xNumRule, UNO_QUERY ); -OUString sName; -if( xNamed.is() ) -sName = xNamed->getName(); -bool bAdd = sName.isEmpty(); -if( !bAdd ) -{ -Reference < XPropertySet > xNumPropSet( xNumRule, -UNO_QUERY ); -if( xNumPropSet.is() && -xNumPropSet->getPropertySetInfo() - ->hasPropertyByName( "IsAutomatic" ) ) -{ -bAdd = *o3tl::doAccess(xNumPropSet->getPropertyValue( "IsAutomatic" )); -// Check on outline style (#i73361#) -if ( bAdd && - xNumPropSet->getPropertySetInfo() - ->hasPropertyByName( "NumberingIsOutline" ) ) -{ -bAdd = !(*o3tl::doAccess(xNumPropSet->getPropertyValue( "NumberingIsOutline" ))); -} -} -else -{ -bAdd = true; -} -} -if( bAdd ) -maListAutoPool.Add( xNumRule ); -} -} -} mbCollected = true; }
core.git: xmloff/source
xmloff/source/text/txtparai.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit e7df78e1d4ac17ae5a17c4a151eefe2a6f2b0e4a Author: Mike Kaganski AuthorDate: Thu Apr 25 11:50:38 2024 +0500 Commit: Mike Kaganski CommitDate: Thu Apr 25 13:00:25 2024 +0200 Fix UBSan failure: omission from 69ed893087f89d176a5ec4b263ce8d75774be72b This failure was seen: /xmloff/source/text/txtparai.cxx:1816:37: runtime error: downcast of address 0x604000d86710 which does not point to an object of type 'XMLStyleHint_Impl' 0x604000d86710: note: object is of type 'XMLTextFrameHint_Impl' 00 00 00 00 00 4b 83 40 b3 7f 00 00 70 bf 22 00 b0 60 00 00 70 bf 22 00 b0 60 00 00 06 00 00 00 ^~~ vptr for 'XMLTextFrameHint_Impl' #0 0x7fb33f2d224d in XMLParaContext::endFastElement(int) /xmloff/source/text/txtparai.cxx:1816:37 #1 0x7fb33dc76333 in SvXMLImport::endFastElement(int) /xmloff/source/core/xmlimp.cxx:885:15 #2 0x7fb36ee0bfca in (anonymous namespace)::Entity::endElement() /sax/source/fastparser/fastparser.cxx:514:27 #3 0x7fb36ee0b998 in sax_fastparser::FastSaxParserImpl::callbackEndElement() /sax/source/fastparser/fastparser.cxx:1331:17 #4 0x7fb36edfb444 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) /sax/source/fastparser/fastparser.cxx:338:18 #5 0x7fb3bacb8eaa in xmlParseEndTag2 /workdir/UnpackedTarball/libxml2/parser.c:10089:2 #6 0x7fb3bac5fa45 in xmlParseTryOrFinish /workdir/UnpackedTarball/libxml2/parser.c:11867:14 #7 0x7fb3bac533c4 in xmlParseChunk /workdir/UnpackedTarball/libxml2/parser.c:12150:5 #8 0x7fb36edf6231 in sax_fastparser::FastSaxParserImpl::parse() /sax/source/fastparser/fastparser.cxx:1085:21 #9 0x7fb36edefd18 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:890:9 #10 0x7fb36ee11950 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:1470:13 #11 0x7fb33dc60551 in SvXMLImport::parseStream(com::sun::star::xml::sax::InputSource const&) /xmloff/source/core/xmlimp.cxx:528:15 #12 0x7fb31916b4f1 in (anonymous namespace)::ReadThroughComponent(com::sun::star::uno::Reference const&, com::sun::star::uno::Reference const&, rtl::OUString const&, com::sun::star::uno::Reference const&, char const*, com::sun::star::uno::Sequence const&, rtl::OUString const&, bool, bool) /sw/source/filter/xml/swxml.cxx:181:26 #13 0x7fb3191609f1 in (anonymous namespace)::ReadThroughComponent(com::sun::star::uno::Reference const&, com::sun::star::uno::Reference const&, char const*, com::sun::star::uno::Reference const&, char const*, com::sun::star::uno::Sequence const&, rtl::OUString const&, bool) /sw/source/filter/xml/swxml.cxx:323:16 #14 0x7fb319159e4c in XMLReader::Read(SwDoc&, rtl::OUString const&, SwPaM&, rtl::OUString const&) /sw/source/filter/xml/swxml.cxx:833:16 #15 0x7fb3187eda73 in SwReader::Read(Reader const&) /sw/source/filter/basflt/shellio.cxx:203:22 #16 0x7fb3195ecd45 in SwDocShell::Load(SfxMedium&) /sw/source/uibase/app/docshini.cxx:533:37 #17 0x7fb382833c33 in SfxObjectShell::LoadOwnFormat(SfxMedium&) /sfx2/source/doc/objstor.cxx:3619:20 #18 0x7fb38283a353 in SfxObjectShell::DoLoad(SfxMedium*) /sfx2/source/doc/objstor.cxx:705:40 #19 0x7fb382aca503 in SfxBaseModel::load(com::sun::star::uno::Sequence const&) /sfx2/source/doc/sfxbasemodel.cxx:1980:36 #20 0x7fb38333d8c9 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence const&, com::sun::star::uno::Reference const&) /sfx2/source/view/frmload.cxx:720:28 #21 0x7fb371713419 in framework::LoadEnv::impl_loadContent() /framework/source/loadenv/loadenv.cxx:1176:37 #22 0x7fb37170a43b in framework::LoadEnv::start() /framework/source/loadenv/loadenv.cxx:412:20 #23 0x7fb371702a79 in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequence const&, com::sun::star::uno::Reference const&, rtl::OUString const&, int, LoadEnvFeatures) /framework/source/loadenv/loadenv.cxx:308:5 #24 0x7fb3716fe207 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference const&, com::sun::star::uno::Reference const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence const&) /framework/source/loadenv/loadenv.cxx:168:14 #25 0x7fb3717d23fd in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence const&) /framework/source/services/desktop.cxx:591:16 #26 0x7fb3717d2626 in non-virtual thunk to
core.git: xmloff/source
xmloff/source/text/txtparae.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit e902fe1b8bf03f9c3747685314f4d443bcea9333 Author: Mike Kaganski AuthorDate: Mon Apr 22 08:58:32 2024 +0200 Commit: Mike Kaganski CommitDate: Mon Apr 22 10:02:50 2024 +0200 Use designated initializers for clarity Change-Id: Ie10e657e07981e6fd0f0804371fd30f2b3f143b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166430 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index c95eb4886120..6153fb09d7a8 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -1358,8 +1358,9 @@ struct XMLTextParagraphExport::DocumentListNodes for (const auto& node : nodes) { assert(node.getLength() == 3); -docListNodes.push_back({ node[0].get(), node[1].get(), - node[2].get() }); +docListNodes.push_back({ .index = node[0].get(), + .style_id = node[1].get(), + .list_id = node[2].get() }); } std::sort(docListNodes.begin(), docListNodes.end(),
core.git: xmloff/source
xmloff/source/chart/SchXMLTools.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 91bdf6c3ad57a0cc74aad64aa9828ba6b95468b7 Author: Andrea Gelmini AuthorDate: Fri Apr 19 09:29:33 2024 +0200 Commit: Julien Nabet CommitDate: Fri Apr 19 12:17:26 2024 +0200 Fix typo Change-Id: Ia0262b3424eb6f05020e48dd0a497e27cfd10ad8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166282 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index d846b4a27a3e..42d93685342c 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -654,7 +654,7 @@ void importFormattedText( SvXMLImport& rImport, const std::vector
core.git: xmloff/source
xmloff/source/chart/SchXMLTools.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 558990c0f0fb749f1907ffbc3859001aa3e48e63 Author: Andrea Gelmini AuthorDate: Fri Apr 19 09:29:49 2024 +0200 Commit: Julien Nabet CommitDate: Fri Apr 19 12:17:05 2024 +0200 Fix typo Change-Id: Icff58bb1e1c0f409003cb3a97a10182fa4ded41a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166283 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index a317d9b412e5..d846b4a27a3e 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -665,7 +665,7 @@ void importFormattedText( SvXMLImport& rImport, const std::vector xInfo = xNewFmtStr->getPropertySetInfo(); for (const beans::Property& rProp : xFullTextTitleProps->getPropertySetInfo()->getProperties())
core.git: xmloff/source
xmloff/source/chart/SchXMLTools.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 7f95972026ec78b925fd7d67be6756625b73002a Author: Andrea Gelmini AuthorDate: Fri Apr 19 09:29:13 2024 +0200 Commit: Julien Nabet CommitDate: Fri Apr 19 12:16:49 2024 +0200 Fix typo Change-Id: I0f745fa74b0de96df7d2b887fca460d32faf77e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166281 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index fb3dc9e29c56..a317d9b412e5 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -653,7 +653,7 @@ void importFormattedText( SvXMLImport& rImport, const std::vectorgetPropertyValue("FormattedStrings") >>= xFullTextTitle) && xFullTextTitle.hasElements()) { -// these are the properies from the textshape object - needs to apply them +// these are the properties from the textshape object - needs to apply them // to all the string parts firstly - (necessarry for backward compatibility) xFullTextTitleProps.set(xFullTextTitle.getArray()[0], uno::UNO_QUERY); }
core.git: xmloff/source
xmloff/source/text/txtimp.cxx |8 1 file changed, 8 insertions(+) New commits: commit 1b2a6b98291cf8b7022951be19b915fe2a9e18e6 Author: Michael Stahl AuthorDate: Thu Apr 18 13:00:04 2024 +0200 Commit: Michael Stahl CommitDate: Fri Apr 19 10:49:40 2024 +0200 tdf#159903 xmloff: ODF import: fix bug in margin compatibility override The check for the property being set was wrong: the state in a parent style may be DIRECT_VALUE but a derived style may have a list style set, which effectively overrides the ParaLeftMargin and ParaFirstLineIndent. Fix this so that the compatibility override only happens when required. (regression from commit 7cf5faec6fdbc27dd77d2d36fb2ff205322cba0d) Change-Id: I6c8ca493df946afcb48a63c01c132620bcd7b390 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166257 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index b98f6a41d3e4..b0790da2cf46 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -1014,6 +1014,10 @@ auto IsPropertySet(uno::Reference const& rxParaStyles { return true; } +if (xPropState->getPropertyState("NumberingStyleName") == beans::PropertyState_DIRECT_VALUE) +{ +return false; // tdf#159903 this overrides value in the parent style +} // check if it is set by any parent common style OUString style; rxPropSet->getPropertyValue("ParaStyleName") >>= style; @@ -1026,6 +1030,10 @@ auto IsPropertySet(uno::Reference const& rxParaStyles { return true; } +if (xStyleProps->getPropertyState("NumberingStyleName") == beans::PropertyState_DIRECT_VALUE) +{ +return false; // tdf#159903 this overrides value in the parent style +} style = xStyle->getParentStyle(); } return false;
core.git: xmloff/source
xmloff/source/core/xmlexp.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 432c866072aa62cf90168d569dc56cbc7269bcda Author: Taichi Haradaguchi <20001...@ymail.ne.jp> AuthorDate: Mon Apr 8 15:38:44 2024 +0200 Commit: Taichi Haradaguchi <20001...@ymail.ne.jp> CommitDate: Tue Apr 9 01:46:04 2024 +0200 Revert "Fix typo" This reverts commit 659051b7aa7eb9a142d044693409631cfa319b40. Reason for revert: "fo" is the "formatting objects" namespace in ODF, not a typo for "for". Change-Id: If2bef82b9aacb32a125728f548db4d85bee3ed56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165838 Tested-by: Jenkins Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp> diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index b04c42cb0432..140b264f6d41 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -982,7 +982,7 @@ void SvXMLExport::AddLanguageTagAttributes( sal_uInt16 nPrefix, sal_uInt16 nPref { if (getSaneDefaultVersion() >= SvtSaveOptions::ODFSVER_012) AddAttribute( nPrefixRfc, XML_RFC_LANGUAGE_TAG, rLanguageTag.getBcp47()); -// Also in case of non-pure-ISO tag store best matching for: attributes +// Also in case of non-pure-ISO tag store best matching fo: attributes // for consumers not handling *:rfc-language-tag, ensuring that only // valid ISO codes are stored. Here the bWriteEmpty parameter has no // meaning.
core.git: xmloff/source
xmloff/source/core/xmlexp.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 659051b7aa7eb9a142d044693409631cfa319b40 Author: Andrea Gelmini AuthorDate: Wed Apr 3 12:28:02 2024 +0200 Commit: Taichi Haradaguchi <20001...@ymail.ne.jp> CommitDate: Sat Apr 6 16:26:02 2024 +0200 Fix typo Change-Id: I92c1b5f2ff3ba1e39b204a5b23f9bbc71e2b05f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165742 Tested-by: Taichi Haradaguchi <20001...@ymail.ne.jp> Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp> diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 140b264f6d41..b04c42cb0432 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -982,7 +982,7 @@ void SvXMLExport::AddLanguageTagAttributes( sal_uInt16 nPrefix, sal_uInt16 nPref { if (getSaneDefaultVersion() >= SvtSaveOptions::ODFSVER_012) AddAttribute( nPrefixRfc, XML_RFC_LANGUAGE_TAG, rLanguageTag.getBcp47()); -// Also in case of non-pure-ISO tag store best matching fo: attributes +// Also in case of non-pure-ISO tag store best matching for: attributes // for consumers not handling *:rfc-language-tag, ensuring that only // valid ISO codes are stored. Here the bWriteEmpty parameter has no // meaning.
core.git: xmloff/source
xmloff/source/text/txtflde.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit 86842d70e983913002ca0faf35c7288983007a12 Author: Stephan Bergmann AuthorDate: Fri Apr 5 16:48:03 2024 +0200 Commit: Stephan Bergmann CommitDate: Fri Apr 5 22:44:48 2024 +0200 Silence strange -Wmaybe-uninitialized with recent GCC 14 ...seen at least with some (--enable-dbgutil --enable-otpimized etc.) configuration and a recent GCC 14 trunk, > In file included from ~/gcc/inst/include/c++/14.0.1/map:62, > from xmloff/inc/txtflde.hxx:32, > from xmloff/source/text/txtflde.cxx:26: > In member function ‘std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_mbegin() const [with _Key = com::sun::star::uno::Reference; _Val = std::pair, std::__debug::set >; _KeyOfValue = std::_Select1st, std::__debug::set > >; _Compare = std::less >; _Alloc = std::allocator, std::__debug::set > >]’, > inlined from ‘std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_begin() [with _Key = com::sun::star::uno::Reference; _Val = std::pair, std::__debug::set >; _KeyOfValue = std::_Select1st, std::__debug::set > >; _Compare = std::less >; _Alloc = std::allocator, std::__debug::set > >]’ at ~/gcc/inst/include/c++/14.0.1/bits/stl_tree.h:737:25, > inlined from ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::~_Rb_tree() [with _Key = com::sun::star::uno::Reference; _Val = std::pair, std::__debug::set >; _KeyOfValue = std::_Select1st, std::__debug::set > >; _Compare = std::less >; _Alloc = std::allocator, std::__debug::set > >]’ at ~/gcc/inst/include/c++/14.0.1/bits/stl_tree.h:982:17, > inlined from ‘std::__cxx1998::map<_Key, _Tp, _Compare, _Alloc>::~map() [with _Key = com::sun::star::uno::Reference; _Tp = std::__debug::set; _Compare = std::less >; _Alloc = std::allocator, std::__debug::set > >]’ at ~/gcc/inst/include/c++/14.0.1/bits/stl_map.h:314:7, > inlined from ‘std::__debug::map<_Key, _Tp, _Cmp, _Allocator>::~map() [with _Key = com::sun::star::uno::Reference; _Tp = std::__debug::set; _Compare = std::less >; _Allocator = std::allocator, std::__debug::set > >]’ at ~/gcc/inst/include/c++/14.0.1/debug/map.h:136:7, > inlined from ‘constexpr void std::_Optional_payload_base<_Tp>::_M_destroy() [with _Tp = std::__debug::map, std::__debug::set >]’ at ~/gcc/inst/include/c++/14.0.1/optional:283:35, > inlined from ‘constexpr void std::_Optional_payload_base<_Tp>::_M_reset() [with _Tp = std::__debug::map, std::__debug::set >]’ at ~/gcc/inst/include/c++/14.0.1/optional:314:14, > inlined from ‘constexpr void std::_Optional_base_impl<_Tp, _Dp>::_M_reset() [with _Tp = std::__debug::map, std::__debug::set >; _Dp = std::_Optional_base, std::__debug::set >, false, false>]’ at ~/gcc/inst/include/c++/14.0.1/optional:466:53, > inlined from ‘constexpr std::enable_if_t<((bool)is_constructible_v<_Tp, _Args ...>), _Tp&> std::optional<_Tp>::emplace(_Args&& ...) [with _Args = {}; _Tp = std::__debug::map, std::__debug::set >]’ at ~/gcc/inst/include/c++/14.0.1/optional:915:18, > inlined from ‘void XMLTextFieldExport::SetExportOnlyUsedFieldDeclarations(bool)’ at xmloff/source/text/txtflde.cxx:2250:30: > ~/gcc/inst/include/c++/14.0.1/bits/stl_tree.h:733:73: error: ‘*(const std::_Rb_tree, std::pair, std::__debug::set, std::allocator > >, std::_Select1st, std::__debug::set, std::allocator > > >, std::less >, std::allocator, std::__debug::set, std::allocator > > > >*)((char*)this + 32).std::_Rb_tree, std::pair, std::__debug::set >, std::_Select1st , std::__debug::set > >, std::less >, std::allocator, std::__debug::set > > >::_M_impl.std::_Rb_tree, std::pair, std::__debug::set >, std::_Select1st, std::__debug::set > >, std::less >, std::allocator, std::__debug::set > > >::_Rb_tree_impl >, true>::std::_Rb_tree_header.std::_Rb_tree_header::_M_head er.std::_Rb_tree_node_base::_M_parent’ may be used uninitialized [-Werror=maybe-uninitialized] > 733 | { return static_cast<_Link_type>(this->_M_impl._M_header._M_parent); } > | ^ Change-Id: I827e5a1de31006fbedd7857fd21fc5a9cb652172 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165822 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index c90c3e8fb479..f517bf3595d7 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -2247,7 +2247,14 @@ void XMLTextFieldExport::SetExportOnlyUsedFieldDeclarations( // create used masters set (if none is used) if (bExportOnlyUsed) +#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 14 +#pragma GCC diagnostic push +#pragma GCC
core.git: xmloff/source
xmloff/source/transform/AttrTransformerAction.hxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 7357f3ff7a9bb1c292c2c413a5cb232e465414ab Author: Andrea Gelmini AuthorDate: Wed Apr 3 12:24:22 2024 +0200 Commit: Julien Nabet CommitDate: Wed Apr 3 14:25:24 2024 +0200 Fix typo Change-Id: I2271e31d2a57206954e166e71b16af092c11aab8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165741 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/xmloff/source/transform/AttrTransformerAction.hxx b/xmloff/source/transform/AttrTransformerAction.hxx index e302a9852593..97b51ca2d7e8 100644 --- a/xmloff/source/transform/AttrTransformerAction.hxx +++ b/xmloff/source/transform/AttrTransformerAction.hxx @@ -93,9 +93,9 @@ enum XMLAttrTransformerAction XML_ATACTION_MACRO_LOCATION, XML_ATACTION_DLG_BORDER, XML_ATACTION_URI_OOO,// a URI in OOo notation - // - param1: pacakage URI are supported + // - param1: package URI are supported XML_ATACTION_URI_OASIS, // a URI in OASIS notation - // - param1: pacakage URI are supported + // - param1: package URI are supported XML_ATACTION_RENAME_ATTRIBUTE, // rename up to 3 different possible values of an attribute // - param1: token of old attribute value (lower 16 bit) // + token of new attribute value (upper 16 bit)
core.git: xmloff/source
xmloff/source/draw/QRCodeContext.cxx|1 - xmloff/source/draw/descriptionimp.cxx |1 - xmloff/source/forms/formattributes.cxx |1 - xmloff/source/forms/formcellbinding.cxx |1 - xmloff/source/style/DrawAspectHdl.cxx |1 - xmloff/source/style/PageMasterExportPropMapper.cxx |1 - xmloff/source/style/PageMasterPropHdlFactory.cxx|1 - xmloff/source/style/PageMasterPropMapper.cxx|2 -- xmloff/source/style/XMLBackgroundImageContext.cxx |1 - xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx |1 - xmloff/source/text/XMLSectionSourceDDEImportContext.cxx |1 - xmloff/source/text/XMLTextNumRuleInfo.cxx |1 - xmloff/source/text/txtftne.cxx |1 - xmloff/source/text/txtparae.cxx |1 - xmloff/source/transform/Oasis2OOo.cxx |1 - xmloff/source/transform/PersAttrListTContext.cxx|1 - 16 files changed, 17 deletions(-) New commits: commit e2e9eeb822928255b3f2a31dfe98344f6d8e81cd Author: Gabor Kelemen AuthorDate: Sat Mar 16 18:09:20 2024 +0100 Commit: Gabor Kelemen CommitDate: Fri Mar 29 21:19:32 2024 +0100 tdf#146619 Recheck xmloff/*cxx with IWYU after cleaning up unused 'using namespace' clauses Change-Id: I9e4cd3790408ae6b0379819a8275feaf67e860cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164941 Tested-by: Jenkins Reviewed-by: Gabor Kelemen diff --git a/xmloff/source/draw/QRCodeContext.cxx b/xmloff/source/draw/QRCodeContext.cxx index 434065b5f203..580e4e8b9a41 100644 --- a/xmloff/source/draw/QRCodeContext.cxx +++ b/xmloff/source/draw/QRCodeContext.cxx @@ -10,7 +10,6 @@ #include "QRCodeContext.hxx" #include -#include #include #include diff --git a/xmloff/source/draw/descriptionimp.cxx b/xmloff/source/draw/descriptionimp.cxx index c553bb655287..e17980f55baa 100644 --- a/xmloff/source/draw/descriptionimp.cxx +++ b/xmloff/source/draw/descriptionimp.cxx @@ -18,7 +18,6 @@ */ #include -#include #include #include diff --git a/xmloff/source/forms/formattributes.cxx b/xmloff/source/forms/formattributes.cxx index 0b8b84d0f299..3a979f2599ab 100644 --- a/xmloff/source/forms/formattributes.cxx +++ b/xmloff/source/forms/formattributes.cxx @@ -20,7 +20,6 @@ #include "formattributes.hxx" #include -#include #include #include diff --git a/xmloff/source/forms/formcellbinding.cxx b/xmloff/source/forms/formcellbinding.cxx index 2a7a26bb71b0..9b19d2c3651e 100644 --- a/xmloff/source/forms/formcellbinding.cxx +++ b/xmloff/source/forms/formcellbinding.cxx @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/xmloff/source/style/DrawAspectHdl.cxx b/xmloff/source/style/DrawAspectHdl.cxx index 10cc762ec954..cc38523c8d06 100644 --- a/xmloff/source/style/DrawAspectHdl.cxx +++ b/xmloff/source/style/DrawAspectHdl.cxx @@ -21,7 +21,6 @@ #include #include -#include using namespace ::com::sun::star; diff --git a/xmloff/source/style/PageMasterExportPropMapper.cxx b/xmloff/source/style/PageMasterExportPropMapper.cxx index 9b7ff71874e8..7e5d2bcbee6e 100644 --- a/xmloff/source/style/PageMasterExportPropMapper.cxx +++ b/xmloff/source/style/PageMasterExportPropMapper.cxx @@ -19,7 +19,6 @@ #include "PageMasterExportPropMapper.hxx" #include -#include #include #include #include diff --git a/xmloff/source/style/PageMasterPropHdlFactory.cxx b/xmloff/source/style/PageMasterPropHdlFactory.cxx index 1cb396803aba..1617584839ab 100644 --- a/xmloff/source/style/PageMasterPropHdlFactory.cxx +++ b/xmloff/source/style/PageMasterPropHdlFactory.cxx @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/xmloff/source/style/PageMasterPropMapper.cxx b/xmloff/source/style/PageMasterPropMapper.cxx index 40f33139351c..6e7a4be35bba 100644 --- a/xmloff/source/style/PageMasterPropMapper.cxx +++ b/xmloff/source/style/PageMasterPropMapper.cxx @@ -23,8 +23,6 @@ #include #include -#include - using namespace ::com::sun::star; XMLPageMasterPropSetMapper::XMLPageMasterPropSetMapper(): diff --git a/xmloff/source/style/XMLBackgroundImageContext.cxx b/xmloff/source/style/XMLBackgroundImageContext.cxx index fb655d132385..686edd7ed1ed 100644 --- a/xmloff/source/style/XMLBackgroundImageContext.cxx +++ b/xmloff/source/style/XMLBackgroundImageContext.cxx @@ -18,7 +18,6 @@ */ -#include #include #include diff --git a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx index d1e435abc0c8..1be742637df0 100644 --- a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx +++
core.git: xmloff/source
xmloff/source/draw/eventimp.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 3f1272c0e2e3aa30e6c781a2bcd83e98d62408b7 Author: Caolán McNamara AuthorDate: Wed Mar 27 17:07:20 2024 + Commit: Caolán McNamara CommitDate: Wed Mar 27 20:46:57 2024 +0100 add notify for script use Change-Id: I84af197cec7755f6803a578e1e21c03966ad5f3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165403 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx index c03f312bd9d8..f7bcc529bbc6 100644 --- a/xmloff/source/draw/eventimp.cxx +++ b/xmloff/source/draw/eventimp.cxx @@ -206,6 +206,9 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, if( maData.mbValid ) maData.mbValid = !sEventName.isEmpty(); + +if (!maData.msMacroName.isEmpty()) +rImp.NotifyMacroEventRead(); } css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLEventContext::createFastChildContext(
core.git: xmloff/source
xmloff/source/script/XMLEventExport.cxx |2 +- xmloff/source/script/XMLScriptExportHandler.cxx |2 +- xmloff/source/style/prstylei.cxx|8 3 files changed, 6 insertions(+), 6 deletions(-) New commits: commit f16d04c95f6952c811b67c3891c27bd01a4824df Author: Arnaud VERSINI AuthorDate: Sun Mar 24 17:18:36 2024 +0100 Commit: Arnaud Versini CommitDate: Mon Mar 25 17:30:27 2024 +0100 xmloff : no need to use OUString literal for comparison Change-Id: I2b8f75ec56d93003d8c9c14b3cad1e3978cc6a39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165227 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/xmloff/source/script/XMLEventExport.cxx b/xmloff/source/script/XMLEventExport.cxx index 839944a2676d..3d37095f0b5e 100644 --- a/xmloff/source/script/XMLEventExport.cxx +++ b/xmloff/source/script/XMLEventExport.cxx @@ -185,7 +185,7 @@ void XMLEventExport::ExportEvent( { // search for EventType value and then delegate to EventHandler const PropertyValue* pValue = std::find_if(rEventValues.begin(), rEventValues.end(), -[](const PropertyValue& rValue) { return u"EventType"_ustr == rValue.Name; }); +[](const PropertyValue& rValue) { return u"EventType" == rValue.Name; }); if (pValue == rEventValues.end()) return; diff --git a/xmloff/source/script/XMLScriptExportHandler.cxx b/xmloff/source/script/XMLScriptExportHandler.cxx index 6b5075d02112..b60a3f27be75 100644 --- a/xmloff/source/script/XMLScriptExportHandler.cxx +++ b/xmloff/source/script/XMLScriptExportHandler.cxx @@ -53,7 +53,7 @@ void XMLScriptExportHandler::Export( for(const auto& rValue : rValues) { -if (u"Script"_ustr == rValue.Name) +if (u"Script" == rValue.Name) { OUString sTmp; rValue.Value >>= sTmp; diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index 95a869653fd9..a10fbbaed299 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -627,16 +627,16 @@ void XMLPropStyleContext::translateNameBasedDrawingLayerFillStyleDefinitionsToSt const OUString& rPropName = rMapper->GetEntryAPIName(a.mnIndex); XmlStyleFamily aStyleFamily(XmlStyleFamily::DATA_STYLE); -if(rPropName == u"FillGradientName"_ustr - || rPropName == u"FillTransparenceGradientName"_ustr) +if(rPropName == u"FillGradientName" + || rPropName == u"FillTransparenceGradientName") { aStyleFamily = XmlStyleFamily::SD_GRADIENT_ID; } -else if(rPropName == u"FillHatchName"_ustr) +else if(rPropName == u"FillHatchName") { aStyleFamily = XmlStyleFamily::SD_HATCH_ID; } -else if(rPropName == u"FillBitmapName"_ustr) +else if(rPropName == u"FillBitmapName") { aStyleFamily = XmlStyleFamily::SD_FILL_IMAGE_ID; }
core.git: xmloff/source
xmloff/source/draw/animimp.cxx | 40 +++- xmloff/source/draw/shapeimport.cxx | 16 +++-- xmloff/source/script/XMLEventExport.cxx |4 -- xmloff/source/script/XMLScriptExportHandler.cxx |4 -- xmloff/source/style/prstylei.cxx| 12 ++- 5 files changed, 23 insertions(+), 53 deletions(-) New commits: commit e7eae3aa6e3af0b05c6aa471d2c4892918757e7a Author: RMZeroFour AuthorDate: Sat Mar 23 19:21:44 2024 +0530 Commit: Mike Kaganski CommitDate: Sat Mar 23 20:49:49 2024 +0100 tdf#158067 Replace OUStringLiteral with _ustr As part of the efforts in #158067 to replace static constexpr OUStringLiteral variables with string literals of the form u""_ustr, this commit performs the replacements in some files of the xmloff module. Change-Id: Icce2ed7f9a69ef023aaff498975d6afabf161d4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165200 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/xmloff/source/draw/animimp.cxx b/xmloff/source/draw/animimp.cxx index 8248d51bd019..afd1fffd2f13 100644 --- a/xmloff/source/draw/animimp.cxx +++ b/xmloff/source/draw/animimp.cxx @@ -314,22 +314,6 @@ AnimationEffect ImplSdXMLgetEffect( XMLEffect eKind, XMLEffectDirection eDirecti } } -namespace -{ -constexpr OUStringLiteral gsDimColor = u"DimColor"; -constexpr OUStringLiteral gsDimHide = u"DimHide"; -constexpr OUStringLiteral gsDimPrev = u"DimPrevious"; -constexpr OUStringLiteral gsEffect = u"Effect"; -constexpr OUStringLiteral gsPlayFull = u"PlayFull"; -constexpr OUStringLiteral gsSound = u"Sound"; -constexpr OUStringLiteral gsSoundOn = u"SoundOn"; -constexpr OUStringLiteral gsSpeed = u"Speed"; -constexpr OUStringLiteral gsTextEffect = u"TextEffect"; -constexpr OUStringLiteral gsPresShapeService = u"com.sun.star.presentation.Shape"; -constexpr OUStringLiteral gsAnimPath = u"AnimationPath"; -constexpr OUStringLiteral gsIsAnimation = u"IsAnimation"; -}; - namespace { enum XMLActionKind @@ -501,7 +485,7 @@ void XMLAnimationsEffectContext::endFastElement(sal_Int32 ) // check for presentation shape service { Reference< XServiceInfo > xServiceInfo( xSet, UNO_QUERY ); -if( !xServiceInfo.is() || !xServiceInfo->supportsService( gsPresShapeService ) ) +if( !xServiceInfo.is() || !xServiceInfo->supportsService( u"com.sun.star.presentation.Shape"_ustr ) ) return; } @@ -518,13 +502,13 @@ void XMLAnimationsEffectContext::endFastElement(sal_Int32 ) { if( meKind == XMLE_DIM ) { -xSet->setPropertyValue( gsDimPrev, Any(true) ); +xSet->setPropertyValue( u"DimPrevious"_ustr, Any(true) ); -xSet->setPropertyValue( gsDimColor, Any(maDimColor) ); +xSet->setPropertyValue( u"DimColor"_ustr, Any(maDimColor) ); } else if( meKind == XMLE_PLAY ) { -xSet->setPropertyValue( gsIsAnimation, Any(true) ); +xSet->setPropertyValue( u"IsAnimation"_ustr, Any(true) ); // #i42894# speed is not supported for the old group animation fallback, so no need to set it // aAny <<= meSpeed; @@ -534,23 +518,23 @@ void XMLAnimationsEffectContext::endFastElement(sal_Int32 ) { if( meKind == XMLE_HIDE && !mbTextEffect && meEffect == EK_none ) { -xSet->setPropertyValue( gsDimHide, Any(true) ); +xSet->setPropertyValue( u"DimHide"_ustr, Any(true) ); } else { const AnimationEffect eEffect = ImplSdXMLgetEffect( meEffect, meDirection, mnStartScale, meKind == XMLE_SHOW ); if (mbTextEffect) -xSet->setPropertyValue( gsTextEffect, Any( eEffect ) ); +xSet->setPropertyValue( u"TextEffect"_ustr, Any( eEffect ) ); else -xSet->setPropertyValue( gsEffect, Any( eEffect ) ); -xSet->setPropertyValue( gsSpeed, Any( meSpeed ) ); +xSet->setPropertyValue( u"Effect"_ustr, Any( eEffect ) ); +xSet->setPropertyValue( u"Speed"_ustr, Any( meSpeed ) ); if( eEffect == AnimationEffect_PATH && !maPathShapeId.isEmpty() ) { Reference< XShape > xPath( GetImport().getInterfaceToIdentifierMapper().getReference( maPathShapeId ), UNO_QUERY ); if( xPath.is() ) -
core.git: xmloff/source
xmloff/source/core/XMLBase64ImportContext.cxx |1 - xmloff/source/core/XMLEmbeddedObjectImportContext.cxx |1 - xmloff/source/core/xmluconv.cxx |1 - xmloff/source/draw/QRCodeContext.cxx|1 - xmloff/source/draw/animimp.cxx |1 - xmloff/source/draw/descriptionimp.cxx |3 --- xmloff/source/draw/eventimp.cxx |2 -- xmloff/source/draw/layerexp.cxx |2 -- xmloff/source/draw/layerimp.cxx |2 -- xmloff/source/draw/ximpshow.cxx |1 - xmloff/source/forms/elementexport.cxx |1 - xmloff/source/forms/formattributes.cxx |2 -- xmloff/source/forms/formcellbinding.cxx |1 - xmloff/source/forms/formlayerexport.cxx |2 -- xmloff/source/forms/formlayerimport.cxx |2 -- xmloff/source/forms/propertyexport.cxx |1 - xmloff/source/script/xmlscripti.cxx |1 - xmloff/source/style/DrawAspectHdl.cxx |1 - xmloff/source/style/PageMasterExportPropMapper.cxx |1 - xmloff/source/style/PageMasterPropHdlFactory.cxx|1 - xmloff/source/style/PageMasterPropMapper.cxx|2 -- xmloff/source/style/StyleMap.cxx|3 --- xmloff/source/style/XMLBackgroundImageContext.cxx |1 - xmloff/source/style/XMLFontStylesContext.cxx|2 -- xmloff/source/style/xmlexppr.cxx|1 - xmloff/source/style/xmlprmap.cxx|2 -- xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx |1 - xmloff/source/text/XMLSectionSourceDDEImportContext.cxx |1 - xmloff/source/text/XMLTextListAutoStylePool.cxx |1 - xmloff/source/text/XMLTextNumRuleInfo.cxx |1 - xmloff/source/text/XMLTextTableContext.cxx |3 --- xmloff/source/text/txtftne.cxx |1 - xmloff/source/text/txtparae.cxx |1 - xmloff/source/text/txtprmap.cxx |1 - xmloff/source/text/txtstyle.cxx |1 - xmloff/source/transform/ControlOOoTContext.cxx |1 - xmloff/source/transform/Oasis2OOo.cxx |2 -- xmloff/source/transform/PersAttrListTContext.cxx|1 - xmloff/source/transform/TransformerActions.cxx |2 -- xmloff/source/transform/TransformerBase.cxx |1 - 40 files changed, 57 deletions(-) New commits: commit 4496544f5d7ea9eaf83478a8846e14455d5dda3c Author: Gabor Kelemen AuthorDate: Thu Mar 14 23:14:31 2024 +0100 Commit: Gabor Kelemen CommitDate: Tue Mar 19 09:28:41 2024 +0100 Remove unused namespaces from xmloff Change-Id: Id46c9512b8024c9dc50edfb200599b1901fbf3c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164940 Tested-by: Jenkins Reviewed-by: Gabor Kelemen diff --git a/xmloff/source/core/XMLBase64ImportContext.cxx b/xmloff/source/core/XMLBase64ImportContext.cxx index 1476733642a3..6997a08340a6 100644 --- a/xmloff/source/core/XMLBase64ImportContext.cxx +++ b/xmloff/source/core/XMLBase64ImportContext.cxx @@ -26,7 +26,6 @@ #include using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::io; diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx index 980dd8e0572d..d9d57af9f664 100644 --- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx +++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx @@ -37,7 +37,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; -using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::document; using namespace ::com::sun::star::xml::sax; diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx index 544bea50d3c5..27ed06144f54 100644 --- a/xmloff/source/core/xmluconv.cxx +++ b/xmloff/source/core/xmluconv.cxx @@ -54,7 +54,6 @@ using namespace com::sun::star; using namespace com::sun::star::uno; -using namespace com::sun::star::lang; using namespace com::sun::star::text; using namespace com::sun::star::style; using namespace ::com::sun::star::i18n; diff --git a/xmloff/source/draw/QRCodeContext.cxx b/xmloff/source/draw/QRCodeContext.cxx index 06477be637e0..434065b5f203 100644 ---
core.git: xmloff/source
xmloff/source/core/xmlexp.cxx | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) New commits: commit 2184692bbe69a093368e959e1096cb7506feceee Author: Michael Stahl AuthorDate: Mon Jan 8 19:44:50 2024 +0100 Commit: Michael Stahl CommitDate: Tue Jan 9 14:30:42 2024 +0100 xmloff: ODF export: if there's no checksum, don't generate chaff Change-Id: I2e1bb6ed33df327ebd797edeca7ee82b75c524b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161800 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 9900fa4d86fe..bb7ef1cc695d 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -95,7 +95,7 @@ #include #include #include -#include +#include #include #include #include @@ -1188,10 +1188,22 @@ lcl_AddGrddl(SvXMLExport const & rExport, const SvXMLExportFlags /*nExportMode*/ // note: the point of this is presumably to mitigate SHA/1k info leak of plain text void SvXMLExport::addChaffWhenEncryptedStorage() { -uno::Reference< embed::XEncryptionProtectedSource2 > xEncr(mpImpl->mxTargetStorage, uno::UNO_QUERY); +uno::Reference const xEncr(mpImpl->mxTargetStorage, uno::UNO_QUERY); if (xEncr.is() && xEncr->hasEncryptionData() && mxExtHandler.is()) { +uno::Sequence const algo(xEncr->getEncryptionAlgorithms()); +for (auto const& it : algo) +{ +if (it.Name == "ChecksumAlgorithm") +{ +if (!it.Value.hasValue()) +{ +return; // no checksum => no chaff +} +break; +} +} mxExtHandler->comment(OStringToOUString(comphelper::xml::makeXMLChaff(), RTL_TEXTENCODING_ASCII_US)); } }
core.git: xmloff/source
xmloff/source/text/XMLTextFrameContext.cxx |4 +++- xmloff/source/text/XMLTextShapeImportHelper.cxx |4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) New commits: commit 9122c6f9b4c6901ea0cedf6e655daa1afbb57ab3 Author: Caolán McNamara AuthorDate: Tue Jan 2 12:58:13 2024 + Commit: Caolán McNamara CommitDate: Tue Jan 2 15:58:29 2024 +0100 ofz#65464 Timeout with text:anchor-page-number="28031970720" text:anchor-page-number is problematic, possibly more so since commit 23eadd873de2e56d1e5f866fefae25c648f302f9 Date: Wed Jun 28 17:19:02 2023 +0200 tdf#156077 sw: layout: call AssertFlyPages() in Init() in that missing pages are added to get to the page the object claims to be anchored to, to a max of 32767 Limit this to 100 like: commit e4ee999d6d9c10ee10d6778eca9354d8fbaa720f Date: Sun Jul 23 21:34:23 2023 +0100 ofz#60533 Timeout with fo:font-size="842pt" when fuzzing to get reasonable performance Change-Id: Ic7568fe9535bdd07557434c8b51c1532415822a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161542 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index b00b2b84d90e..0ee7dcb7863b 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -896,7 +897,8 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( case XML_ELEMENT(TEXT, XML_ANCHOR_PAGE_NUMBER): { sal_Int32 nTmp; -if (::sax::Converter::convertNumber(nTmp, aIter.toView(), 1, SHRT_MAX)) +sal_Int32 nMax = !comphelper::IsFuzzing() ? SHRT_MAX : 100; +if (::sax::Converter::convertNumber(nTmp, aIter.toView(), 1, nMax)) nPage = static_cast(nTmp); } break; diff --git a/xmloff/source/text/XMLTextShapeImportHelper.cxx b/xmloff/source/text/XMLTextShapeImportHelper.cxx index aba039095a4d..314d394cc235 100644 --- a/xmloff/source/text/XMLTextShapeImportHelper.cxx +++ b/xmloff/source/text/XMLTextShapeImportHelper.cxx @@ -19,6 +19,7 @@ #include #include +#include #include @@ -103,7 +104,8 @@ void XMLTextShapeImportHelper::addShape( case XML_ELEMENT(TEXT, XML_ANCHOR_PAGE_NUMBER): { sal_Int32 nTmp; -if (::sax::Converter::convertNumber(nTmp, aIter.toView(), 1, SHRT_MAX)) +sal_Int32 nMax = !comphelper::IsFuzzing() ? SHRT_MAX : 100; +if (::sax::Converter::convertNumber(nTmp, aIter.toView(), 1, nMax)) nPage = static_cast(nTmp); } break;
core.git: xmloff/source
xmloff/source/forms/elementimport.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit db69ae30592c1621d73d6c75718f692ef1ab1154 Author: Julien Nabet AuthorDate: Fri Dec 29 14:04:35 2023 +0100 Commit: Julien Nabet CommitDate: Fri Dec 29 17:21:11 2023 +0100 Use emplace_back instead of push_back (xmloff) Change-Id: I9ef16abe07129d1ef8190cca5a094f0135f2a3de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161405 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index d1d691d6519a..7b7609107560 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -2018,7 +2018,7 @@ namespace xmloff "OFormImport::implTranslateStringListProperty: invalid quoted element name."); sElement = sElement.substr(1, nElementLength - 2); -aElements.push_back(OUString(sElement)); +aElements.emplace_back(sElement); // switch to the next element nElementStart = 1 + nNextSep;
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/forms/layerexport.cxx |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) New commits: commit 325ec1c1060ba29b24eb1acbc5451bc972b484fc Author: Caolán McNamara AuthorDate: Sun Dec 3 19:48:34 2023 + Commit: Caolán McNamara CommitDate: Mon Dec 4 10:48:19 2023 +0100 cid#1546476 COPY_INSTEAD_OF_MOVE Change-Id: Ic8133ebfb40c02eb95bdf95809aeca719f636acf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160276 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/xmloff/source/forms/layerexport.cxx b/xmloff/source/forms/layerexport.cxx index a75bceada634..dac9297679ae 100644 --- a/xmloff/source/forms/layerexport.cxx +++ b/xmloff/source/forms/layerexport.cxx @@ -561,10 +561,8 @@ namespace xmloff // generate a new control id -// find a free id -OUString sCurrentId = lcl_findFreeControlId( m_aControlIds ); -// add it to the map -m_aCurrentPageIds->second[ xColumnProperties ] = sCurrentId; +// find a free id and add it to the map +m_aCurrentPageIds->second[xColumnProperties] = lcl_findFreeControlId(m_aControlIds); // determine a number style, if needed xColumnPropertiesMeta = xColumnProperties->getPropertySetInfo();
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/core/namespacemap.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 09200875ce643e66f293d39bb27630a3fdbb984d Author: Julien Nabet AuthorDate: Sun Dec 3 20:50:50 2023 +0100 Commit: Julien Nabet CommitDate: Mon Dec 4 09:26:45 2023 +0100 cid#1546325, cid#1546212: invalid iterator (xmloff/namespacemap.cxx) Change-Id: I7a3377326daa5a0d933a68b9d4f5a64983ba2ab8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160278 Reviewed-by: Caolán McNamara Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/xmloff/source/core/namespacemap.cxx b/xmloff/source/core/namespacemap.cxx index c64f28087f36..1d844fe04cd9 100644 --- a/xmloff/source/core/namespacemap.cxx +++ b/xmloff/source/core/namespacemap.cxx @@ -360,6 +360,7 @@ sal_uInt16 SvXMLNamespaceMap::GetFirstKey() const sal_uInt16 SvXMLNamespaceMap::GetNextKey( sal_uInt16 nLastKey ) const { auto aIter = maKeyToNamespaceMap.find ( nLastKey ); +assert(aIter != maKeyToNamespaceMap.end()); return (++aIter == maKeyToNamespaceMap.end()) ? USHRT_MAX : (*aIter).first; } @@ -378,6 +379,7 @@ sal_uInt16 SvXMLNamespaceMap::GetFirstIndex() const sal_uInt16 SvXMLNamespaceMap::GetNextIndex( sal_uInt16 nOldIdx ) const { auto aIter = maKeyToNamespaceMap.find ( nOldIdx ); +assert(aIter != maKeyToNamespaceMap.end()); return (++aIter == maKeyToNamespaceMap.end()) ? USHRT_MAX : (*aIter).first; }
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/XMLTextFrameContext.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 91b39a9dad0563726ea2100557e3c88c24be2e61 Author: Tomaž Vajngerl AuthorDate: Sat Dec 2 21:42:25 2023 +0900 Commit: Tomaž Vajngerl CommitDate: Sat Dec 2 13:44:38 2023 +0100 remove printf Change-Id: Ib83b5c3b0f80310cd11f7cd8cd83e82d11e12eb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160241 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index 723a168a52b9..b00b2b84d90e 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -1082,7 +1082,6 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( case XML_ELEMENT(DRAW, XML_MIME_TYPE): case XML_ELEMENT(LO_EXT, XML_MIME_TYPE): sMimeType = aIter.toString(); -printf ("MIME %s\n", sMimeType.toUtf8().getStr()); break; case XML_ELEMENT(DRAW, XML_NOTIFY_ON_UPDATE_OF_RANGES): case XML_ELEMENT(DRAW, XML_NOTIFY_ON_UPDATE_OF_TABLE):
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/ximpshap.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 86dc86ac25b24aab25ad9947014bed898b0d591c Author: Andrea Gelmini AuthorDate: Fri Dec 1 12:12:00 2023 +0100 Commit: Julien Nabet CommitDate: Fri Dec 1 17:04:36 2023 +0100 Fix typo Change-Id: I9fae0349d8ecf4a4e11b23b46e5b593c07b05290 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160210 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 6cf226274115..3961c8d546f8 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -1785,7 +1785,7 @@ bool lcl_IsLikelyOOXMLCurve(const basegfx::B2DPolygon& rPolygon) basegfx::B2DVector aStartVec(rPolygon.getNextControlPoint(0) - rPolygon.getB2DPoint(0)); basegfx::B2DVector aEndVec(rPolygon.getPrevControlPoint(nCount-1) - rPolygon.getB2DPoint(nCount - 1)); -// LibreOffice uses one point less than OOXML for the same underlaying bentConnector or +// LibreOffice uses one point less than OOXML for the same underlying bentConnector or // STANDARD connector, respectively. A deeper inspection is only needed in case of 2 resulting // points. Those connector paths look like a quarter ellipse. switch (nCount)
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/core/xmluconv.cxx | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) New commits: commit 0c3f57487c9cc29d172121b178938cdb2a8adc7b Author: Eike Rathke AuthorDate: Wed Nov 29 19:11:22 2023 +0100 Commit: Eike Rathke CommitDate: Wed Nov 29 23:56:53 2023 +0100 Resolves: tdf#158265 Store more than 100th seconds precision in date+time e.g. office:date-value Change-Id: I9bb4b589cdb8c6f04fa39ba7ec4254207eaa3663 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160124 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx index a95de5ecb66c..544bea50d3c5 100644 --- a/xmloff/source/core/xmluconv.cxx +++ b/xmloff/source/core/xmluconv.cxx @@ -61,7 +61,6 @@ using namespace ::com::sun::star::i18n; using namespace ::xmloff::token; -const sal_Int8 XML_MAXDIGITSCOUNT_TIME = 11; constexpr OUStringLiteral XML_NULLDATE = u"NullDate"; struct SvXMLUnitConverter::Impl @@ -444,6 +443,16 @@ void SvXMLUnitConverter::convertDateTime( OUStringBuffer& rBuffer, else fCount = 0.0; const int nDigits = sal_Int16(fCount) + 4; // +4 for *86400 in seconds + +// Since the beginning from initial source code import this was 11 without +// further explanation, effectively limiting fractions in ~current +// date+time to 2 decimals (maybe because old class Time code had a +// resolution of only 100th seconds). Preserve at least milliseconds, but +// strive for more. +// NOTE: sax/source/tools/converter.cxx uses 14-5 in a different context +// rounding nanoseconds and fractions of seconds. +constexpr int XML_MAXDIGITSCOUNT_TIME = 14; + const int nFractionDecimals = std::max( XML_MAXDIGITSCOUNT_TIME - nDigits, 0); sal_uInt16 nHour, nMinute, nSecond;
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/shapeimport.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d8b7558d8a462649fa3b2df2748e92377917e3fd Author: Noel Grandin AuthorDate: Thu Oct 19 12:07:26 2023 +0200 Commit: Noel Grandin CommitDate: Thu Oct 19 16:03:34 2023 +0200 SAL_WARN->SAL_INFO in XMLShapeImportHelper::CreateGroupChildContext Change-Id: Ia4bdbfdf6d85999e4cf8fa78131aec2dc776f41a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158175 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index 5b0e6d101787..5186c8be2b47 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -341,7 +341,7 @@ SvXMLShapeContext* XMLShapeImportHelper::CreateGroupChildContext( return new SdXMLShapeLinkContext( rImport, xAttrList, rShapes ); // add other shapes here... default: -XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement); +XMLOFF_INFO_UNKNOWN_ELEMENT("xmloff", nElement); return new SvXMLShapeContext( rImport, bTemporaryShape ); }
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/core/PropertySetMerger.cxx |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) New commits: commit d6d0bd11ec38978156b9dbbda50bdddc9159e064 Author: Noel Grandin AuthorDate: Sat Sep 9 13:57:30 2023 +0200 Commit: Noel Grandin CommitDate: Sun Sep 10 13:44:15 2023 +0200 PropertySetMergerImpl does not need to implement XAggreggation Checked on jenkins using 'make check' and +void SAL_CALL setDelegator(css::uno::Reference const &) final { assert(false); } Change-Id: I40f4906723ab040b95a8db5c34e81b09a5ede38c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156772 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/core/PropertySetMerger.cxx b/xmloff/source/core/PropertySetMerger.cxx index 7663aef638d3..65a936bb3d80 100644 --- a/xmloff/source/core/PropertySetMerger.cxx +++ b/xmloff/source/core/PropertySetMerger.cxx @@ -19,18 +19,17 @@ #include #include +#include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; -#include -#include - namespace { -class PropertySetMergerImpl : public ::cppu::WeakAggImplHelper3< XPropertySet, XPropertyState, XPropertySetInfo > +class PropertySetMergerImpl : public ::cppu::WeakImplHelper< XPropertySet, XPropertyState, XPropertySetInfo > { private: Reference< XPropertySet > mxPropSet1;
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/XMLIndexSimpleEntryContext.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 425ca75d71497aebae5f5fdfdb20f65a6422a9d3 Author: Noel Grandin AuthorDate: Fri Sep 8 13:29:49 2023 +0200 Commit: Noel Grandin CommitDate: Fri Sep 8 15:36:48 2023 +0200 WARN->INFO in XMLIndexSimpleEntryContext This is not generally a problem Change-Id: If7957da45e5ad00f881ef3a7c5c676b09494ec77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156713 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/text/XMLIndexSimpleEntryContext.cxx b/xmloff/source/text/XMLIndexSimpleEntryContext.cxx index d8f2e79bc259..6c59f13380f3 100644 --- a/xmloff/source/text/XMLIndexSimpleEntryContext.cxx +++ b/xmloff/source/text/XMLIndexSimpleEntryContext.cxx @@ -75,7 +75,7 @@ void XMLIndexSimpleEntryContext::startFastElement( m_bCharStyleNameOK = false; } else -XMLOFF_WARN_UNKNOWN("xmloff", aIter); +XMLOFF_INFO_UNKNOWN("xmloff", aIter); } // if we have a style name, set it!
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/ximpshap.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 2b807baa2fd596ce4728cbc5ffbf8f8a50a60a54 Author: Andrea Gelmini AuthorDate: Thu Sep 7 08:45:29 2023 +0200 Commit: Julien Nabet CommitDate: Thu Sep 7 10:52:01 2023 +0200 Fix typo Change-Id: I4f2f281c12fefe6f69ceacb715faf2b8644abeaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156635 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 7532b4320099..24475522f1e5 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -1964,7 +1964,7 @@ void SdXMLConnectorShapeContext::startFastElement (sal_Int32 nElement, if ( bApplySVGD ) { // tdf#83360 use path data only when redundant data of start and end point coordinates of -// path start/end and connector start/end is equal. This is to avoid using erraneous +// path start/end and connector start/end is equal. This is to avoid using erroneous // or inconsistent path data at import of foreign formats. Office itself always // writes out a consistent data set. Not using it when there is inconsistency // is okay since the path data is redundant, buffered data just to avoid recalculation
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/ximpshap.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 8658568f8c3946cf88af708928e092f7c5835b17 Author: Andrea Gelmini AuthorDate: Thu Sep 7 08:45:46 2023 +0200 Commit: Julien Nabet CommitDate: Thu Sep 7 10:50:22 2023 +0200 Fix typo Change-Id: I8902bfb3c779471d4aff80ca7e94a9848b9ece51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156636 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index efc94e7c1c86..1dc5a2618d16 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -2159,7 +2159,7 @@ void SdXMLPageShapeContext::startFastElement (sal_Int32 nElement, // add, set style and properties from base shape // #86163# take into account which type of PageShape needs to -// be constructed. It's a pres shape if presentation:XML_CLASS == XML_PAGE. +// be constructed. It's a presentation shape if presentation:XML_CLASS == XML_PAGE. bool bIsPresentation = !maPresentationClass.isEmpty() && GetImport().GetShapeImport()->IsPresentationShapesSupported();
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/ximpshap.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit fc3d33858629279f88717e3cec9b1761de890774 Author: Noel Grandin AuthorDate: Wed Sep 6 09:33:22 2023 +0200 Commit: Noel Grandin CommitDate: Wed Sep 6 13:07:42 2023 +0200 improve debug logging in SdXMLShapeContext::AddShape so we get source info for the exception Change-Id: Icd54a4d1388c7a48ab3e0c8bd17c21f6004a470b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156589 Tested-by: Noel Grandin Reviewed-by: Noel Grandin diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index c64a80b756a1..6dea8cab5e2f 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -513,6 +513,7 @@ void SdXMLShapeContext::AddShape(OUString const & serviceName) } catch(const uno::Exception& e) { +TOOLS_WARN_EXCEPTION("xmloff", "AddShape " << serviceName); uno::Sequence aSeq { serviceName }; GetImport().SetError( XMLERROR_FLAG_ERROR | XMLERROR_API, aSeq, e.Message, nullptr );
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/core/xmlexp.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 6d9b793512a60f18db624452d8773f0e52c00081 Author: Caolán McNamara AuthorDate: Tue Sep 5 15:21:59 2023 +0100 Commit: Caolán McNamara CommitDate: Tue Sep 5 21:39:43 2023 +0200 drop a stray printf Change-Id: Ie9b48ab2db03c7c45aa4ffc24ca4532522bb60a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156571 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index eb173fc4d98c..1f0f5a9780d8 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1070,7 +1070,6 @@ void SvXMLExport::ImplExportSettings() void SvXMLExport::ImplExportStyles() { -printf ("SvXMLExport::ImplExportStyles\n"); CheckAttrList(); {
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/txtparae.cxx | 200 1 file changed, 100 insertions(+), 100 deletions(-) New commits: commit 12364a7d4ca2f74f57d9a4f3a63ad4dfe8205bb6 Author: Stephan Bergmann AuthorDate: Tue Jun 20 09:20:12 2023 +0200 Commit: Stephan Bergmann CommitDate: Tue Jun 20 12:57:37 2023 +0200 XMLTextParagraphExport::DocumentListNodes must be a complete type ...at least when building with --with-latest-c++ against recent LLVM 17 trunk libc++, > In file included from xmloff/source/text/txtparae.cxx:22: > In file included from include/o3tl/any.hxx:21: > In file included from include/com/sun/star/uno/Any.hxx:28: > In file included from ~/llvm/inst/bin/../include/c++/v1/algorithm:1779: > In file included from ~/llvm/inst/bin/../include/c++/v1/__algorithm/inplace_merge.h:27: > In file included from ~/llvm/inst/bin/../include/c++/v1/__memory/uninitialized_buffer.h:14: > ~/llvm/inst/bin/../include/c++/v1/__memory/unique_ptr.h:63:19: error: invalid application of 'sizeof' to an incomplete type 'XMLTextParagraphExport::DocumentListNodes' >63 | static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type"); > | ^~~ > ~/llvm/inst/bin/../include/c++/v1/__memory/unique_ptr.h:297:7: note: in instantiation of member function 'std::default_delete::operator()' requested here > 297 | __ptr_.second()(__tmp); > | ^ > ~/llvm/inst/bin/../include/c++/v1/__memory/unique_ptr.h:263:75: note: in instantiation of member function 'std::unique_ptr::reset' requested here > 263 | _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); } > | ^ > xmloff/source/text/txtparae.cxx:1333:25: note: in instantiation of member function 'std::unique_ptr::~unique_ptr' requested here > 1333 | XMLTextParagraphExport::XMLTextParagraphExport( > | ^ > include/xmloff/txtparae.hxx:115:12: note: forward declaration of 'XMLTextParagraphExport::DocumentListNodes' > 115 | struct DocumentListNodes; > |^ Change-Id: I319c1f682258950caf3571f51e5443d6753bcccd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153312 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 34e12aec02b2..6407e0248626 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -1330,6 +1330,106 @@ struct XMLTextParagraphExport::Impl } }; +struct XMLTextParagraphExport::DocumentListNodes +{ +struct NodeData +{ +sal_Int32 index; // see SwNode::GetIndex and SwNodeOffset +sal_uInt64 style_id; // actually a pointer to NumRule +OUString list_id; +}; +std::vector docListNodes; +DocumentListNodes(const css::uno::Reference& xModel) +{ +// Sequence of nodes, each of them represented by three-element sequence, +// corresponding to NodeData members +css::uno::Sequence> nodes; +if (auto xPropSet = xModel.query()) +{ +try +{ +// See SwXTextDocument::getPropertyValue +xPropSet->getPropertyValue("ODFExport_ListNodes") >>= nodes; +} +catch (css::beans::UnknownPropertyException&) +{ +// That's absolutely fine! +} +} + +docListNodes.reserve(nodes.getLength()); +for (const auto& node : nodes) +{ +assert(node.getLength() == 3); +docListNodes.push_back({ node[0].get(), node[1].get(), + node[2].get() }); +} + +std::sort(docListNodes.begin(), docListNodes.end(), + [](const NodeData& lhs, const NodeData& rhs) { return lhs.index < rhs.index; }); +} +bool ShouldSkipListId(const Reference& xTextContent) const +{ +if (docListNodes.empty()) +return false; + +if (auto xPropSet = xTextContent.query()) +{ +sal_Int32 index = 0; +try +{ +// See SwXParagraph::Impl::GetPropertyValues_Impl +xPropSet->getPropertyValue("ODFExport_NodeIndex") >>= index; +} +catch (css::beans::UnknownPropertyException&) +{ +// That's absolutely fine! +return false; +} + +auto it = std::lower_bound(docListNodes.begin(), docListNodes.end(), index, + [](const NodeData& lhs, sal_Int32 rhs) + { return lhs.index < rhs; }); +if (it == docListNodes.end() || it->index != index) +return
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/style/GradientStyle.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit c58ff5befa4c9704ab54f365811af4beeea384a8 Author: Andrea Gelmini AuthorDate: Wed May 31 19:26:21 2023 +0200 Commit: Julien Nabet CommitDate: Wed May 31 21:03:54 2023 +0200 Fix typo Change-Id: I9c58980de73dc2f00802f0d589d0c6fafe11d16a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152460 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx index fb1fc68fb077..7598074fc409 100644 --- a/xmloff/source/style/GradientStyle.cxx +++ b/xmloff/source/style/GradientStyle.cxx @@ -231,7 +231,7 @@ void XMLGradientStyleExport::exportXML( // MCGR: For better compatibility with LO versions before MCGR, try // to re-create a 'border' value based on the existing gradient stops. // With MCGR we do not need 'border' anymore in quite some cases since -// no Start/EndColor at 0.0 resp. 1.0 is explicitely needed. Since we +// no Start/EndColor at 0.0 resp. 1.0 is explicitly needed. Since we // (unfortunately need to) internally continue to support border // anyways it does no harm to fallback to use the border value - if // there is an equivalent representation as this helper checks for.
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/txtparae.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit d2c02a9aba3c05e4b3072596d2b3871b7fe67864 Author: Mike Kaganski AuthorDate: Tue May 30 13:25:24 2023 +0200 Commit: Mike Kaganski CommitDate: Tue May 30 15:58:49 2023 +0200 Fix wrong check It was introduced in commit 286ba5b6ca60c7f67106059ea56721b86c36925b (#79947#: Improve performance, 2001-11-01), and there the size of xPropStates did not change when incrementing nIgnoreProps. But later commit 8195d7061ed52ebb98f46d35fe5929762c71e4b3 (INTEGRATION: CWS swautomatic01 (1.126.4); FILE MERGED, 2006-12-01) started to remove the ignored items from xPropStates. Change-Id: Ida864a83c32dec2884beba9ad68943e936655fc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152326 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index e5344665b5e6..2b3af03b93dd 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -691,7 +691,6 @@ void XMLTextParagraphExport::Add( XmlStyleFamily nFamily, Reference< XPropertySetInfo > xPropSetInfo(rPropSet->getPropertySetInfo()); OUString sParent, sCondParent; -sal_uInt16 nIgnoreProps = 0; switch( nFamily ) { case XmlStyleFamily::TEXT_PARAGRAPH: @@ -744,6 +743,7 @@ void XMLTextParagraphExport::Add( XmlStyleFamily nFamily, { // Get parent and remove hyperlinks (they aren't of interest) rtl::Reference< XMLPropertySetMapper > xPM(xPropMapper->getPropertySetMapper()); +sal_uInt16 nIgnoreProps = 0; for( ::std::vector< XMLPropertyState >::iterator i(aPropStates.begin()); nIgnoreProps < 2 && i != aPropStates.end(); ) { @@ -780,7 +780,7 @@ void XMLTextParagraphExport::Add( XmlStyleFamily nFamily, break; default: break; } -if (aPropStates.size() - nIgnoreProps) +if (aPropStates.size()) // could change after the previous check { GetAutoStylePool().Add( nFamily, sParent, std::vector(aPropStates), bDontSeek ); if( !sCondParent.isEmpty() && sParent != sCondParent )
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/chart/PropertyMaps.cxx | 240 ++--- xmloff/source/forms/elementexport.cxx | 44 ++--- xmloff/source/forms/property_meta_data.cxx | 19 -- xmloff/source/style/xmlexppr.cxx | 29 +-- xmloff/source/transform/OOo2Oasis.cxx | 58 +++ xmloff/source/xforms/xformsapi.cxx | 25 +-- xmloff/source/xforms/xformsexport.cxx | 105 ++-- 7 files changed, 257 insertions(+), 263 deletions(-) New commits: commit 9ffaf2cbfb855390954380eb40ebd7415b26e067 Author: Vojtěch Doležal AuthorDate: Wed May 17 09:01:23 2023 +0200 Commit: Miklos Vajna CommitDate: Thu May 18 09:07:16 2023 +0200 Removed remaining macro concatenations from xmloff/ For PropertyMaps.cxx used: (MAP_FULL\( *[A-Za-z0-9_]+ *, *) => \1XML_NAMESPACE_ (MAP_ENTRY\( *[A-Za-z0-9_]+ *, *) => \1XML_NAMESPACE_ (MAP_ENTRY_ODF12\( *[A-Za-z0-9_]+ *, *) => \1XML_NAMESPACE_ (MAP_ENTRY_ODF_EXT\( *[A-Za-z0-9_]+ *, *) => \1XML_NAMESPACE_ (MAP_ENTRY_ODF_EXT_IMPORT\( *[A-Za-z0-9_]+ *, *) => \1XML_NAMESPACE_ (MAP_CONTEXT\( *[A-Za-z0-9_]+ *, *) => \1XML_NAMESPACE_ (MAP_SPECIAL\( *[A-Za-z0-9_]+ *, *) => \1XML_NAMESPACE_ (MAP_SPECIAL_ODF12\( *[A-Za-z0-9_]+ *, *) => \1XML_NAMESPACE_ (MAP_SPECIAL_ODF13\( *[A-Za-z0-9_]+ *, *) => \1XML_NAMESPACE_ For xmlexppr.cxx used: ENTRY\( *([A-Za-z0-9_]+) *\) => { GET_PROP_TYPE(XML_TYPE_PROP_\1), XML_\1_PROPERTIES } For OOo2Oasis.cxx used: (OOO_IMPORTER\( *)([A-Za-z]+) => \1xmloff_\2_get_implementation For xformsapi.cxx used: TOKEN_MAP_ENTRY\( *([A-Za-z0-9"]+) *, *([A-Za-z0-9_]+) *\) => { XML_NAMESPACE_\1, xmloff::token::XML_\2, xmloff::token::XML_\2 } For xformsexport.cxx used: TABLE_ENTRY\( *([A-Za-z0-9"_]+) *, *([A-Za-z0-9"_]+) *, *([A-Za-z0-9"_]+) *, *([A-Za-z0-9"_]+) *\) => { \1, XML_NAMESPACE_\2, xmloff::token::XML_\3, \4 } elementexport.cxx and property_meta_data.cxx done by hand. Change-Id: Ifb0c76a60f95e74ff1f9d596afdaff138c2228c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151867 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx index ea40bd4c7e6b..964e317e780c 100644 --- a/xmloff/source/chart/PropertyMaps.cxx +++ b/xmloff/source/chart/PropertyMaps.cxx @@ -60,16 +60,16 @@ using namespace ::xmloff::token; using namespace css::chart2; -#define MAP_FULL( ApiName, NameSpace, XMLTokenName, XMLType, ContextId, EarliestODFVersionForExport ) { ApiName, XML_NAMESPACE_##NameSpace, xmloff::token::XMLTokenName, XMLType|XML_TYPE_PROP_CHART, ContextId, EarliestODFVersionForExport, false } -#define MAP_ENTRY( a, ns, nm, t ){ a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_010, false } -#define MAP_ENTRY_ODF12( a, ns, nm, t ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_012, false } +#define MAP_FULL( ApiName, NameSpace, XMLTokenName, XMLType, ContextId, EarliestODFVersionForExport ) { ApiName, NameSpace, xmloff::token::XMLTokenName, XMLType|XML_TYPE_PROP_CHART, ContextId, EarliestODFVersionForExport, false } +#define MAP_ENTRY( a, ns, nm, t ){ a, ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_010, false } +#define MAP_ENTRY_ODF12( a, ns, nm, t ) { a, ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_012, false } #define MAP_ENTRY_ODF13( a, ns, nm, t ) { a, ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_013, false } -#define MAP_ENTRY_ODF_EXT( a, ns, nm, t ){ a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED, false } -#define MAP_ENTRY_ODF_EXT_IMPORT( a, ns, nm, t ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED, true } -#define MAP_CONTEXT( a, ns, nm, t, c ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, c, SvtSaveOptions::ODFSVER_010, false } -#define MAP_SPECIAL( a, ns, nm, t, c ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFSVER_010, false } -#define MAP_SPECIAL_ODF12( a, ns, nm, t, c ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFSVER_012, false } -#define MAP_SPECIAL_ODF13( a, ns, nm, t, c ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFSVER_013, false } +#define MAP_ENTRY_ODF_EXT( a, ns, nm, t ){ a, ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED, false } +#define
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/transform/OOo2Oasis.cxx| 1180 +++ xmloff/source/transform/Oasis2OOo.cxx| 1045 +++ xmloff/source/transform/StyleOOoTContext.cxx | 56 - 3 files changed, 992 insertions(+), 1289 deletions(-) New commits: commit 24b15bc11b57aaeb3961b26ab636c3cf2d18fddc Author: Vojtěch Doležal AuthorDate: Tue May 16 09:02:45 2023 +0200 Commit: Miklos Vajna CommitDate: Wed May 17 08:48:43 2023 +0200 Removed more constant concatenations Change-Id: I4fce6eeb6652914e1883037b41a2dc3c09a88ada Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151826 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx index a11baa98a8e9..150de69aebc6 100644 --- a/xmloff/source/transform/OOo2Oasis.cxx +++ b/xmloff/source/transform/OOo2Oasis.cxx @@ -76,7 +76,7 @@ enum XMLUserDefinedTransformerAction } #define ENTRY3( n, l, a, p1, p2, p3 ) \ -{ XML_NAMESPACE_##n, XML_##l, a, p1, p2, p3 } +{ n, l, a, p1, p2, p3 } #define ENTRY3QQN( n, l, a, n1, l1, n2, l2, p3 ) \ ENTRY3( n, l, a, XMLTransformerActionInit::QNameParam( n1, l1 ), \ XMLTransformerActionInit::QNameParam( n2, l2 ), p3 ) @@ -104,613 +104,447 @@ static constexpr sal_Int32 RENAME_ENTRY( XMLTokenEnum f, XMLTokenEnum s ) XMLTransformerActionInit const aActionTable[] = { // remove office:class from and -ENTRY0( OFFICE, DOCUMENT, XML_ETACTION_DOCUMENT ), -ENTRY0( OFFICE, DOCUMENT_CONTENT, XML_ETACTION_DOCUMENT ), -ENTRY0( OFFICE, DOCUMENT_STYLES, XML_ETACTION_DOCUMENT ), -ENTRY0( OFFICE, DOCUMENT_SETTINGS, XML_ETACTION_DOCUMENT ), -ENTRY1Q( OFFICE, AUTO_TEXT_EVENTS, XML_ETACTION_DOCUMENT_RENAME, - XML_NAMESPACE_OOO, XML_AUTO_TEXT_EVENTS), +ENTRY0( XML_NAMESPACE_OFFICE, XML_DOCUMENT, XML_ETACTION_DOCUMENT ), +ENTRY0( XML_NAMESPACE_OFFICE, XML_DOCUMENT_CONTENT, XML_ETACTION_DOCUMENT ), +ENTRY0( XML_NAMESPACE_OFFICE, XML_DOCUMENT_STYLES, XML_ETACTION_DOCUMENT ), +ENTRY0( XML_NAMESPACE_OFFICE, XML_DOCUMENT_SETTINGS, XML_ETACTION_DOCUMENT ), +ENTRY1Q( XML_NAMESPACE_OFFICE, XML_AUTO_TEXT_EVENTS, XML_ETACTION_DOCUMENT_RENAME, XML_NAMESPACE_OOO, XML_AUTO_TEXT_EVENTS), // remove -ENTRY0( META, KEYWORDS, XML_ETACTION_COPY_CONTENT ), +ENTRY0( XML_NAMESPACE_META, XML_KEYWORDS, XML_ETACTION_COPY_CONTENT ), // rename to -ENTRY1Q( OFFICE, SCRIPT, XML_ETACTION_RENAME_ELEM, -XML_NAMESPACE_OFFICE, XML_SCRIPTS ), +ENTRY1Q( XML_NAMESPACE_OFFICE, XML_SCRIPT, XML_ETACTION_RENAME_ELEM, XML_NAMESPACE_OFFICE, XML_SCRIPTS ), // rename to and process attributes -ENTRY2QN( OFFICE, SCRIPT_DATA, XML_ETACTION_RENAME_ELEM_PROC_ATTRS, -XML_NAMESPACE_OFFICE, XML_SCRIPT, -OOO_SCRIPT_ACTIONS ), +ENTRY2QN( XML_NAMESPACE_OFFICE, XML_SCRIPT_DATA, XML_ETACTION_RENAME_ELEM_PROC_ATTRS, XML_NAMESPACE_OFFICE, XML_SCRIPT, OOO_SCRIPT_ACTIONS ), // rename to -ENTRY1Q( SCRIPT, LIBRARIES, XML_ETACTION_RENAME_ELEM, -XML_NAMESPACE_OOO, XML_LIBRARIES ), +ENTRY1Q( XML_NAMESPACE_SCRIPT, XML_LIBRARIES, XML_ETACTION_RENAME_ELEM, XML_NAMESPACE_OOO, XML_LIBRARIES ), // rename to and process attributes -ENTRY2QN( SCRIPT, LIBRARY_LINKED, XML_ETACTION_RENAME_ELEM_PROC_ATTRS, -XML_NAMESPACE_OOO, XML_LIBRARY_LINKED, -OOO_SCRIPT_ACTIONS ), +ENTRY2QN( XML_NAMESPACE_SCRIPT, XML_LIBRARY_LINKED, XML_ETACTION_RENAME_ELEM_PROC_ATTRS, XML_NAMESPACE_OOO, XML_LIBRARY_LINKED, OOO_SCRIPT_ACTIONS ), // rename to and process attributes -ENTRY2QN( SCRIPT, LIBRARY_EMBEDDED, XML_ETACTION_RENAME_ELEM_PROC_ATTRS, -XML_NAMESPACE_OOO, XML_LIBRARY_EMBEDDED, -OOO_SCRIPT_ACTIONS ), +ENTRY2QN( XML_NAMESPACE_SCRIPT, XML_LIBRARY_EMBEDDED, XML_ETACTION_RENAME_ELEM_PROC_ATTRS, XML_NAMESPACE_OOO, XML_LIBRARY_EMBEDDED, OOO_SCRIPT_ACTIONS ), // rename to and process attributes -ENTRY2QN( SCRIPT, MODULE, XML_ETACTION_RENAME_ELEM_PROC_ATTRS, -XML_NAMESPACE_OOO, XML_MODULE, -OOO_SCRIPT_ACTIONS ), +ENTRY2QN( XML_NAMESPACE_SCRIPT, XML_MODULE, XML_ETACTION_RENAME_ELEM_PROC_ATTRS, XML_NAMESPACE_OOO, XML_MODULE, OOO_SCRIPT_ACTIONS ), // rename to -ENTRY1Q( SCRIPT, SOURCE_CODE, XML_ETACTION_RENAME_ELEM, -XML_NAMESPACE_OOO, XML_SOURCE_CODE ), +ENTRY1Q( XML_NAMESPACE_SCRIPT, XML_SOURCE_CODE, XML_ETACTION_RENAME_ELEM, XML_NAMESPACE_OOO, XML_SOURCE_CODE ), // rename to , // rename to , process attrs -ENTRY1Q( OFFICE, FONT_DECLS, XML_ETACTION_RENAME_ELEM, -XML_NAMESPACE_OFFICE, XML_FONT_FACE_DECLS ), -ENTRY2QN( STYLE, FONT_DECL,
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/txtprmap.cxx | 1163 1 file changed, 582 insertions(+), 581 deletions(-) New commits: commit 41d96a72fc0e0a9fa35b6ac88a389473f8baedaf Author: Vojtěch Doležal AuthorDate: Mon May 15 23:31:29 2023 +0200 Commit: Michael Stahl CommitDate: Tue May 16 12:17:37 2023 +0200 Removed constant concatenation macros from txtprmap.cxx Removed concatenation from the macros, because due to them I wasn't able to find anything relevant with grep when searching for them. Change-Id: Ic22d711d9e93bb89b402d141aa1ca3293bba866e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151819 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index 5d8ef1d3471e..418d4e396ff2 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -33,13 +33,13 @@ using namespace ::com::sun::star::uno; using namespace ::xmloff::token; #define M_E_( a, p, l, t, c ) \ -{ a, XML_NAMESPACE_##p, XML_##l, t, c, SvtSaveOptions::ODFSVER_010, false } +{ a, p, l, t, c, SvtSaveOptions::ODFSVER_010, false } #define M_EV_( a, p, l, t, c, v ) \ -{ a, XML_NAMESPACE_##p, XML_##l, t, c, v, false } +{ a, p, l, t, c, v, false } #define M_ED_( a, p, l, t, c ) \ -{ a, XML_NAMESPACE_##p, XML_##l, (t) | MID_FLAG_DEFAULT_ITEM_EXPORT, c, SvtSaveOptions::ODFSVER_010, false } +{ a, p, l, (t) | MID_FLAG_DEFAULT_ITEM_EXPORT, c, SvtSaveOptions::ODFSVER_010, false } // text properties #define MT_E( a, p, l, t, c ) \ @@ -90,7 +90,7 @@ using namespace ::xmloff::token; XMLPropertyMapEntry constexpr aXMLParaPropMap[] = { // RES_UNKNOWNATR_CONTAINER -MP_E( PROP_ParaUserDefinedAttributes, TEXT, XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ), +MP_E( PROP_ParaUserDefinedAttributes, XML_NAMESPACE_TEXT, XML_XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ), // fill attributes for paragraph backgrounds // #i125045# moved to the front to be able to exclude these in lcl_txtprmap_getMap @@ -118,187 +118,187 @@ XMLPropertyMapEntry constexpr aXMLParaPropMap[] = // RES_LR_SPACE // !!! DO NOT REORDER THE MARGINS !!! -MP_E( PROP_ParaLeftMargin, FO, MARGIN, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARAMARGINALL ), -MP_E( PROP_ParaLeftMarginRelative, FO, MARGIN, XML_TYPE_PERCENT16, CTF_PARAMARGINALL_REL ), -MP_E( PROP_ParaLeftMargin, FO, MARGIN_LEFT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARALEFTMARGIN ), -MP_E( PROP_ParaLeftMarginRelative, FO, MARGIN_LEFT, XML_TYPE_PERCENT16, CTF_PARALEFTMARGIN_REL ), -MP_E( PROP_ParaRightMargin,FO, MARGIN_RIGHT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARARIGHTMARGIN ), -MP_E( PROP_ParaRightMarginRelative,FO, MARGIN_RIGHT, XML_TYPE_PERCENT16, CTF_PARARIGHTMARGIN_REL ), +MP_E( PROP_ParaLeftMargin, XML_NAMESPACE_FO, XML_MARGIN, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARAMARGINALL ), +MP_E( PROP_ParaLeftMarginRelative, XML_NAMESPACE_FO, XML_MARGIN, XML_TYPE_PERCENT16, CTF_PARAMARGINALL_REL ), +MP_E( PROP_ParaLeftMargin, XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARALEFTMARGIN ), +MP_E( PROP_ParaLeftMarginRelative, XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_PERCENT16, CTF_PARALEFTMARGIN_REL ), +MP_E( PROP_ParaRightMargin, XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARARIGHTMARGIN ), +MP_E( PROP_ParaRightMarginRelative, XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_PERCENT16, CTF_PARARIGHTMARGIN_REL ), // RES_UL_SPACE -MP_E( PROP_ParaTopMargin, FO, MARGIN_TOP, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARATOPMARGIN ), -MP_E( PROP_ParaTopMarginRelative, FO, MARGIN_TOP, XML_TYPE_PERCENT16, CTF_PARATOPMARGIN_REL ), -MP_E( PROP_ParaBottomMargin, FO, MARGIN_BOTTOM, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARABOTTOMMARGIN ), -MP_E( PROP_ParaBottomMarginRelative,FO,MARGIN_BOTTOM, XML_TYPE_PERCENT16, CTF_PARABOTTOMMARGIN_REL ), -MAP_ODF13( PROP_ParaContextMargin, XML_NAMESPACE_STYLE, XML_CONTEXTUAL_SPACING, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0 ),// ODF 1.3 OFFICE-3767 and was written by LO<=4.2 -MAP_ODF13( PROP_ParaContextMargin, XML_NAMESPACE_LO_EXT, XML_CONTEXTUAL_SPACING, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0 ), // extension namespace +MP_E( PROP_ParaTopMargin,XML_NAMESPACE_FO,XML_MARGIN_TOP, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARATOPMARGIN ), +MP_E( PROP_ParaTopMarginRelative,XML_NAMESPACE_FO,XML_MARGIN_TOP, XML_TYPE_PERCENT16, CTF_PARATOPMARGIN_REL ), +MP_E( PROP_ParaBottomMargin, XML_NAMESPACE_FO,
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/style/xmlstyle.cxx | 65 +++ 1 file changed, 19 insertions(+), 46 deletions(-) New commits: commit 2059f242bd2d3e9cefa8cb38bcbef8cab120bab5 Author: Mike Kaganski AuthorDate: Mon May 1 14:49:05 2023 +0300 Commit: Mike Kaganski CommitDate: Mon May 1 15:02:22 2023 +0200 Simplify and unify a bit Change-Id: Ife4b4b3beb4d31948aebbb2028ef0683013a7b58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151229 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx index c72684102a5f..d0dc368870a2 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -67,6 +67,8 @@ using namespace ::xmloff::token; constexpr OUStringLiteral gsParaStyleServiceName( u"com.sun.star.style.ParagraphStyle" ); constexpr OUStringLiteral gsTextStyleServiceName( u"com.sun.star.style.CharacterStyle" ); +constexpr OUStringLiteral gsParagraphStyles(u"ParagraphStyles"); +constexpr OUStringLiteral gsCharacterStyles(u"CharacterStyles"); void SvXMLStyleContext::SetAttribute( sal_Int32 nElement, const OUString& rValue ) @@ -606,25 +608,19 @@ Reference < XAutoStyleFamily > SvXMLStylesContext::GetAutoStyles( XmlStyleFamily if( XmlStyleFamily::TEXT_TEXT == nFamily || XmlStyleFamily::TEXT_PARAGRAPH == nFamily) { bool bPara = XmlStyleFamily::TEXT_PARAGRAPH == nFamily; -if( !bPara && mxTextAutoStyles.is() ) -xAutoStyles = mxTextAutoStyles; -else if( bPara && mxParaAutoStyles.is() ) -xAutoStyles = mxParaAutoStyles; -else +const Reference& rxAutoStyles = bPara ? mxParaAutoStyles : mxTextAutoStyles; +if (!rxAutoStyles) { -OUString sName(bPara ? std::u16string_view( u"ParagraphStyles" ): std::u16string_view( u"CharacterStyles" )); +OUString sName(bPara ? gsParagraphStyles : gsCharacterStyles); Reference< XAutoStylesSupplier > xAutoStylesSupp( GetImport().GetModel(), UNO_QUERY ); Reference< XAutoStyles > xAutoStyleFamilies = xAutoStylesSupp->getAutoStyles(); if (xAutoStyleFamilies->hasByName(sName)) { Any aAny = xAutoStyleFamilies->getByName( sName ); -aAny >>= xAutoStyles; -if( bPara ) -const_cast(this)->mxParaAutoStyles = xAutoStyles; -else -const_cast(this)->mxTextAutoStyles = xAutoStyles; +aAny >>= const_cast&>(rxAutoStyles); } } +xAutoStyles = rxAutoStyles; } return xAutoStyles; } @@ -633,48 +629,25 @@ Reference < XNameContainer > SvXMLStylesContext::GetStylesContainer( XmlStyleFamily nFamily ) const { Reference < XNameContainer > xStyles; -OUString sName; -switch( nFamily ) +if (XmlStyleFamily::TEXT_TEXT == nFamily || XmlStyleFamily::TEXT_PARAGRAPH == nFamily) { -case XmlStyleFamily::TEXT_PARAGRAPH: -if( mxParaStyles.is() ) -xStyles = mxParaStyles; -else -sName = "ParagraphStyles"; -break; - -case XmlStyleFamily::TEXT_TEXT: -if( mxTextStyles.is() ) -xStyles = mxTextStyles; -else -sName = "CharacterStyles"; -break; -default: break; -} -if( !xStyles.is() && !sName.isEmpty() ) -{ -Reference< XStyleFamiliesSupplier > xFamiliesSupp( -GetImport().GetModel(), UNO_QUERY ); -if ( xFamiliesSupp.is() ) +bool bPara = XmlStyleFamily::TEXT_PARAGRAPH == nFamily; +const Reference& rxStyles = bPara ? mxParaStyles : mxTextStyles; +if (!rxStyles) { -Reference< XNameAccess > xFamilies = xFamiliesSupp->getStyleFamilies(); -if (xFamilies->hasByName(sName)) +OUString sName(bPara ? gsParagraphStyles : gsCharacterStyles); +Reference xFamiliesSupp(GetImport().GetModel(), UNO_QUERY); +if (xFamiliesSupp.is()) { -xStyles.set(xFamilies->getByName( sName ),uno::UNO_QUERY); - -switch( nFamily ) +Reference xFamilies = xFamiliesSupp->getStyleFamilies(); +if (xFamilies->hasByName(sName)) { -case XmlStyleFamily::TEXT_PARAGRAPH: -const_cast(this)->mxParaStyles = xStyles; -break; - -case XmlStyleFamily::TEXT_TEXT: -const_cast(this)->mxTextStyles = xStyles; -break; -default: break; +Any aAny = xFamilies->getByName(sName); +aAny >>= const_cast&>(rxStyles); } } } +xStyles =
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/chart/XMLChartStyleContext.cxx|1 - xmloff/source/core/DomBuilderContext.cxx|1 - xmloff/source/draw/XMLGraphicsDefaultStyle.cxx |1 - xmloff/source/draw/XMLImageMapContext.cxx |1 - xmloff/source/draw/layerimp.cxx |1 - xmloff/source/draw/xexptran.cxx |2 -- xmloff/source/forms/elementimport.cxx |1 - xmloff/source/forms/officeforms.cxx |1 - xmloff/source/forms/propertyimport.cxx |1 - xmloff/source/script/XMLEventImportHelper.cxx |2 -- xmloff/source/script/XMLEventsImportContext.cxx |1 - xmloff/source/style/PageHeaderFooterContext.cxx |1 - xmloff/source/style/XMLFootnoteSeparatorImport.cxx |1 - xmloff/source/text/XMLAutoMarkFileContext.cxx |2 -- xmloff/source/text/XMLAutoTextContainerEventImport.cxx |2 -- xmloff/source/text/XMLAutoTextEventExport.cxx |1 - xmloff/source/text/XMLAutoTextEventImport.cxx |1 - xmloff/source/text/XMLChangeElementImportContext.cxx|2 -- xmloff/source/text/XMLChangeImportContext.cxx |2 -- xmloff/source/text/XMLChangeInfoContext.cxx |1 - xmloff/source/text/XMLChangedRegionImportContext.cxx|1 - xmloff/source/text/XMLFootnoteBodyImportContext.cxx |1 - xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx|2 -- xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx |1 - xmloff/source/text/XMLIndexBibliographyEntryContext.cxx |1 - xmloff/source/text/XMLIndexBibliographySourceContext.cxx|1 - xmloff/source/text/XMLIndexBodyContext.cxx |1 - xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx |1 - xmloff/source/text/XMLIndexIllustrationSourceContext.cxx|2 -- xmloff/source/text/XMLIndexObjectSourceContext.cxx |2 -- xmloff/source/text/XMLIndexSimpleEntryContext.cxx |2 -- xmloff/source/text/XMLIndexSourceBaseContext.cxx|1 - xmloff/source/text/XMLIndexTOCContext.cxx |1 - xmloff/source/text/XMLIndexTOCSourceContext.cxx |1 - xmloff/source/text/XMLIndexTOCStylesContext.cxx |1 - xmloff/source/text/XMLIndexTabStopEntryContext.cxx |1 - xmloff/source/text/XMLIndexTableSourceContext.cxx |1 - xmloff/source/text/XMLIndexTemplateContext.cxx |1 - xmloff/source/text/XMLIndexTitleTemplateContext.cxx |2 -- xmloff/source/text/XMLIndexUserSourceContext.cxx|2 -- xmloff/source/text/XMLLineNumberingImportContext.cxx|1 - xmloff/source/text/XMLLineNumberingSeparatorImportContext.cxx |2 -- xmloff/source/text/XMLSectionFootnoteConfigImport.cxx |1 - xmloff/source/text/XMLSectionImportContext.cxx |1 - xmloff/source/text/XMLSectionSourceImportContext.cxx|1 - xmloff/source/text/XMLStringBufferImportContext.cxx |2 -- xmloff/source/text/XMLTextMasterStylesContext.cxx |1 - xmloff/source/text/XMLTrackedChangesImportContext.cxx |1 - xmloff/source/xforms/XFormsInstanceContext.cxx |1 - xmloff/source/xforms/XFormsSubmissionContext.cxx|1 - 50 files changed, 64 deletions(-) New commits: commit 36db242816099bdc3ed2573df1230313056c552c Author: Gabor Kelemen AuthorDate: Wed Apr 12 00:28:17 2023 +0200 Commit: Gabor Kelemen CommitDate: Fri Apr 21 22:22:33 2023 +0200 Run clang-tidy with misc-unused-using-decls on module xmloff To remove unneeded using declarations. Via the simple script: for i in $(find $dirname -name "*cxx" -o -name "*hxx" ); do clang-tidy-12 --checks="-*,misc-unused-using-decls" "$i"; done Change-Id: Iccae38de41c809b39345ec6b31c9f6346e620f53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150611 Tested-by: Jenkins Reviewed-by: Gabor Kelemen diff --git a/xmloff/source/chart/XMLChartStyleContext.cxx b/xmloff/source/chart/XMLChartStyleContext.cxx index db30d22c96b3..fd8ff45d162e 100644 --- a/xmloff/source/chart/XMLChartStyleContext.cxx +++ b/xmloff/source/chart/XMLChartStyleContext.cxx @@ -32,7 +32,6 @@ #include "XMLChartPropertyContext.hxx" using namespace com::sun::star; -using ::xmloff::token::IsXMLToken; using ::xmloff::token::XML_DATA_STYLE_NAME; using ::xmloff::token::XML_PERCENTAGE_DATA_STYLE_NAME; using ::xmloff::token::XML_TEXT_PROPERTIES; diff --git
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/ximpshap.cxx | 13 - xmloff/source/draw/ximpshap.hxx |2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) New commits: commit bafec47847a0b9697b3bbe9358e53f8118af3024 Author: Caolán McNamara AuthorDate: Mon Apr 17 16:53:44 2023 +0100 Commit: Caolán McNamara CommitDate: Tue Apr 18 21:53:35 2023 +0200 create the FloatingFrameShape in a separate step to inserting it this is derived from the path taken by the AddShape(const OUString&) function for this case. No change in behavior is intended. Change-Id: Id09ae0c65a55a37743ad7c184070fb8dd97d8a7f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150526 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 5b671ab1caf4..552414b06c9a 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -3133,10 +3133,21 @@ SdXMLFloatingFrameShapeContext::~SdXMLFloatingFrameShapeContext() { } +uno::Reference SdXMLFloatingFrameShapeContext::CreateFloatingFrameShape() const +{ +uno::Reference xServiceFact(GetImport().GetModel(), uno::UNO_QUERY); +if (!xServiceFact.is()) +return nullptr; +uno::Reference xShape( +xServiceFact->createInstance("com.sun.star.drawing.FrameShape"), uno::UNO_QUERY); +return xShape; +} + void SdXMLFloatingFrameShapeContext::startFastElement (sal_Int32 /*nElement*/, const css::uno::Reference< css::xml::sax::XFastAttributeList >& /*xAttrList*/) { -AddShape("com.sun.star.drawing.FrameShape"); +uno::Reference xShape(SdXMLFloatingFrameShapeContext::CreateFloatingFrameShape()); +AddShape(xShape); if( !mxShape.is() ) return; diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx index 217c773c9785..64b28df579a0 100644 --- a/xmloff/source/draw/ximpshap.hxx +++ b/xmloff/source/draw/ximpshap.hxx @@ -528,6 +528,8 @@ private: OUString maFrameName; OUString maHref; +css::uno::Reference CreateFloatingFrameShape() const; + public: SdXMLFloatingFrameShapeContext( SvXMLImport& rImport,
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/shapeexport.cxx |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) New commits: commit 94e505b9ffbeb1695393d5dea0da84a0bf887fba Author: Noel Grandin AuthorDate: Mon Apr 17 19:25:26 2023 +0200 Commit: Noel Grandin CommitDate: Tue Apr 18 07:51:55 2023 +0200 no need to perform lookup twice in XMLShapeExport::seekShapes Change-Id: I833da530fdc43233e14482a17a60beadb6ef6043 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150530 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 056c3ce98267..94b7ad8e78a0 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -1092,11 +1092,9 @@ void XMLShapeExport::seekShapes( const uno::Reference< drawing::XShapes >& xShap maCurrentShapesIter = maShapesInfos.find( xShapes ); if( maCurrentShapesIter == maShapesInfos.end() ) { -ImplXMLShapeExportInfoVector aNewInfoVector; -aNewInfoVector.resize( static_cast(xShapes->getCount()) ); -maShapesInfos[ xShapes ] = aNewInfoVector; +auto itPair = maShapesInfos.emplace( xShapes, ImplXMLShapeExportInfoVector( static_cast(xShapes->getCount()) ) ); -maCurrentShapesIter = maShapesInfos.find( xShapes ); +maCurrentShapesIter = itPair.first; SAL_WARN_IF( maCurrentShapesIter == maShapesInfos.end(), "xmloff", "XMLShapeExport::seekShapes(): insert into stl::map failed" ); }
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/style/XMLFontAutoStylePool.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit c0400558ba9325bc19fd454bcb4b16498082842c Author: Caolán McNamara AuthorDate: Mon Apr 10 10:38:32 2023 +0100 Commit: Caolán McNamara CommitDate: Mon Apr 10 13:16:06 2023 +0200 crashreporting: getUsedFontList() crash e.g. https://crashreport.libreoffice.org/stats/crash_details/3a3c07aa-0f96-4efa-b55b-c3fe4e4b6ed8 ... Crash Reason EXCEPTION_ACCESS_VIOLATION_READ Crash Address 0x0 ... XMLFontAutoStylePool::getUsedFontList() xmloff\source\style\XMLFontAutoStylePool.cxx:334 XMLFontAutoStylePool::exportXML() xmloff\source\style\XMLFontAutoStylePool.cxx:408 Change-Id: I5d057b8e639260f6d00e731c3af7bab7203a8814 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150177 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx index 0fbb57b78ec8..e86709b6cc3d 100644 --- a/xmloff/source/style/XMLFontAutoStylePool.cxx +++ b/xmloff/source/style/XMLFontAutoStylePool.cxx @@ -328,9 +328,9 @@ std::unordered_set XMLFontAutoStylePool::getUsedFontList() if (xStyle->isInUse()) { uno::Reference xPropertySet(xStyle, UNO_QUERY); -if (xPropertySet.is()) +uno::Reference xInfo(xPropertySet ? xPropertySet->getPropertySetInfo() : nullptr); +if (xInfo) { -uno::Reference xInfo(xPropertySet->getPropertySetInfo()); if (m_bEmbedLatinScript && xInfo->hasPropertyByName("CharFontName")) { OUString sCharFontName;
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/core/DomExport.cxx | 12 +-- xmloff/source/core/namespacemap.cxx | 29 ++- xmloff/source/core/xmlerror.cxx | 43 --- xmloff/source/core/xmluconv.cxx |6 - xmloff/source/draw/propimp0.cxx |3 xmloff/source/draw/sdxmlexp.cxx |9 -- xmloff/source/meta/xmlmetae.cxx |6 - xmloff/source/style/XMLBitmapRepeatOffsetPropertyHandler.cxx |3 xmloff/source/style/XMLClipPropertyHandler.cxx |3 xmloff/source/style/bordrhdl.cxx |4 - xmloff/source/style/chrhghdl.cxx |3 xmloff/source/style/fonthdl.cxx |5 - xmloff/source/style/impastpl.cxx | 40 -- xmloff/source/style/xmlnumfe.cxx | 13 +-- xmloff/source/text/XMLTextListAutoStylePool.cxx |5 - xmloff/source/text/txtprhdl.cxx |3 xmloff/source/transform/TransformerBase.cxx |6 - 17 files changed, 72 insertions(+), 121 deletions(-) New commits: commit 5988a3cf91e2cb5bf1628b88965e3652932e4eb6 Author: Noel Grandin AuthorDate: Thu Mar 30 10:57:25 2023 +0200 Commit: Noel Grandin CommitDate: Thu Mar 30 13:53:28 2023 + loplugin:stringadd in xmloff when applying my upcoming patch to also consider O[U]StringBuffer Change-Id: Id38d983e59386554c61e9bdcd9333554bbf4665c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149756 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/core/DomExport.cxx b/xmloff/source/core/DomExport.cxx index 9d26d68b1cee..585c2b4572b4 100644 --- a/xmloff/source/core/DomExport.cxx +++ b/xmloff/source/core/DomExport.cxx @@ -128,7 +128,7 @@ class DomExport: public DomVisitor void pushNamespace(); void addNamespace( const OUString& sPrefix, const OUString& sURI ); OUString qualifiedName( const OUString& sPrefix, const OUString& sURI, -std::u16string_view sLocalName ); +const OUString& sLocalName ); OUString qualifiedName( const Reference& ); OUString qualifiedName( const Reference& ); void addAttribute( const Reference& ); @@ -181,17 +181,15 @@ void DomExport::addNamespace( const OUString& sPrefix, const OUString& sURI ) OUString DomExport::qualifiedName( const OUString& sPrefix, const OUString& sURI, - std::u16string_view sLocalName ) + const OUString& sLocalName ) { -OUStringBuffer sBuffer; if( !sPrefix.isEmpty() && !sURI.isEmpty() ) { addNamespace( sPrefix, sURI ); -sBuffer.append( sPrefix ); -sBuffer.append( ':' ); +return sPrefix + ":" + sLocalName; } -sBuffer.append( sLocalName ); -return sBuffer.makeStringAndClear(); +else +return sLocalName; } OUString DomExport::qualifiedName( const Reference& xElement ) diff --git a/xmloff/source/core/namespacemap.cxx b/xmloff/source/core/namespacemap.cxx index 84668a612dfe..c64f28087f36 100644 --- a/xmloff/source/core/namespacemap.cxx +++ b/xmloff/source/core/namespacemap.cxx @@ -212,14 +212,10 @@ OUString SvXMLNamespaceMap::GetQNameByKey( sal_uInt16 nKey, { // ...if it's in the xmlns namespace, make the prefix // don't bother caching this, it rarely happens -OUStringBuffer sQName; -sQName.append ( m_sXMLNS ); if (!rLocalName.isEmpty()) // not default namespace -{ -sQName.append ( ':' ); -sQName.append ( rLocalName ); -} -return sQName.makeStringAndClear(); +return m_sXMLNS + ":" + rLocalName; +else +return m_sXMLNS; } case XML_NAMESPACE_XML: { @@ -242,21 +238,14 @@ OUString SvXMLNamespaceMap::GetQNameByKey( sal_uInt16 nKey, { // ...if it's in our map, make the prefix const OUString & prefix( (*aIter).second.sPrefix ); -OUStringBuffer sQName(prefix.getLength() + 1 + rLocalName.getLength()); +OUString sQName; if (!prefix.isEmpty()) // not default namespace -{ -sQName.append( prefix ); -sQName.append( ':' ); -} -sQName.append ( rLocalName ); -if (bCache) -{ -OUString sString(sQName.makeStringAndClear()); -m_aQNameCache.emplace(QNamePair(nKey, rLocalName),
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/shapeexport.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 9070c1b0404fb72d2553f6fa8f702e70c0abb269 Author: Michael Stahl AuthorDate: Tue Mar 14 18:24:30 2023 +0100 Commit: Michael Stahl CommitDate: Thu Mar 16 09:10:39 2023 + xmloff: ODF export: produce alt text and description for MediaShape ... and others where it was inexplicably missing (PluginShape, AppletShape, FrameShape). Change-Id: Idf1c44488370a81bc90fb316ab6056994d782a1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148917 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index f972c389a396..da9fe7f0e438 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -3237,6 +3237,7 @@ void XMLShapeExport::ImpExportFrameShape( SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, XML_FLOATING_FRAME, true, true); } +ImpExportDescription(xShape); } void XMLShapeExport::ImpExportAppletShape( @@ -3292,6 +3293,7 @@ void XMLShapeExport::ImpExportAppletShape( } } +ImpExportDescription(xShape); } void XMLShapeExport::ImpExportPluginShape( @@ -3338,6 +3340,7 @@ void XMLShapeExport::ImpExportPluginShape( } } +ImpExportDescription(xShape); } static void lcl_CopyStream( @@ -3581,6 +3584,8 @@ void XMLShapeExport::ImpExportMediaShape( // The media has a preview, export it. ExportGraphicPreview(xGraphic, mrExport, u"MediaPreview", u".png", "image/png"); } + +ImpExportDescription(xShape); } void XMLShapeExport::ImpExport3DSceneShape( const uno::Reference< drawing::XShape >& xShape, XMLShapeExportFlags nFeatures, awt::Point* pRefPoint)
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/txtparae.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 656850deda2bd478b828a761d2231c65b1fa771e Author: Miklos Vajna AuthorDate: Mon Mar 6 08:18:41 2023 +0100 Commit: Miklos Vajna CommitDate: Fri Mar 10 11:50:17 2023 + xmloff: fix -Wmaybe-uninitialized In case operator >>=() of uno::Any fails, it leaves nTabIndex uninitialized and it seems gcc notices this sometimes: In file included from include/com/sun/star/uno/Any.h:30, from include/com/sun/star/uno/Any.hxx:35, from include/o3tl/any.hxx:21, from xmloff/source/text/txtparae.cxx:22: include/rtl/ustring.hxx: In member function ‘void XMLTextParagraphExport::ExportContentControl(const com::sun::star::uno::Reference&, bool, bool, bool&)’: include/rtl/ustring.hxx:3044:22: warning: ‘nTabIndex’ may be used uninitialized in this function [-Wmaybe-uninitialized] 3044 | return number( static_cast< unsigned long long >( i ), radix ); | ~~^ xmloff/source/text/txtparae.cxx:3999:20: note: ‘nTabIndex’ was declared here 3999 | sal_uInt32 nTabIndex; |^ Change-Id: Ia39e85575bde4011247583265497ddf4d0d4c52b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148598 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index f9928e402295..a06e027c7190 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -4085,7 +4085,7 @@ void XMLTextParagraphExport::ExportContentControl( GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, XML_ID, OUString::number(nId)); } -sal_uInt32 nTabIndex; +sal_uInt32 nTabIndex = 0; if ((xPropertySet->getPropertyValue("TabIndex") >>= nTabIndex) && nTabIndex) { GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, XML_TAB_INDEX,
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/style/styleexp.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 09e3aaa2d22b8fe2887ae973b55f3ad274a960ee Author: Michael Stahl AuthorDate: Mon Jan 23 15:50:57 2023 +0100 Commit: Michael Stahl CommitDate: Mon Jan 23 18:49:06 2023 + xmloff: ODF export: missing extension check in XMLStyleExport (regression from commit 05f863844d9a5613250e8d787e32752b270ec4d3) Change-Id: Iae891ecec26599c9016be17e4db8eaf99783baa6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146012 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx index 10ae6a22dcfa..b311dbdf6c34 100644 --- a/xmloff/source/style/styleexp.cxx +++ b/xmloff/source/style/styleexp.cxx @@ -244,7 +244,8 @@ bool XMLStyleExport::exportStyle( aAny = xPropSet->getPropertyValue("LinkStyle"); OUString sLinkName; aAny >>= sLinkName; -if (!sLinkName.isEmpty()) +if (!sLinkName.isEmpty() +&& (GetExport().getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED)) { GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, XML_LINKED_STYLE_NAME, GetExport().EncodeStyleName(sLinkName));
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/txtprmap.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 54cb5990e694385dd269dc2e946c58d64390986a Author: Caolán McNamara AuthorDate: Thu Dec 29 21:37:02 2022 + Commit: Miklos Vajna CommitDate: Mon Jan 2 08:18:42 2023 + tdf#150707 xmloff/source/style/xmlexppr.cxx:907: no prop type specified warning seen on saving very simple writer document. maybe since: commit 91f649a119d4b7ece26f9737a38663664953a57a Date: Thu Dec 9 08:43:27 2021 +0100 ODP import/export: refer to theme from shape text color Refer to the 12 pre-defined colors by name + don't write the attribute for the case when there is no theme. Change-Id: I4a7d21a7bab1ee77336ed6a5de8862fbab9be177 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144870 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index 8385e678bfbe..527c63bbc1f0 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -139,7 +139,7 @@ XMLPropertyMapEntry const aXMLParaPropMap[] = MT_ED( PROP_CharColor, STYLE, USE_WINDOW_FONT_COLOR, XML_TYPE_ISAUTOCOLOR|MID_FLAG_MERGE_PROPERTY, 0 ), MAP_EXT_I( PROP_CharTransparence, XML_NAMESPACE_DRAW, XML_OPACITY, XML_TYPE_NEG_PERCENT16 | XML_TYPE_PROP_TEXT, 0), MAP_EXT( PROP_CharTransparence, XML_NAMESPACE_LO_EXT, XML_OPACITY, XML_TYPE_NEG_PERCENT16 | XML_TYPE_PROP_TEXT, 0), -MAP_EXT( PROP_CharColorTheme, XML_NAMESPACE_LO_EXT, XML_THEME_COLOR, XML_TYPE_THEME_COLOR, 0), +MAP_EXT( PROP_CharColorTheme, XML_NAMESPACE_LO_EXT, XML_THEME_COLOR, XML_TYPE_THEME_COLOR | XML_TYPE_PROP_TEXT, 0), MAP_EXT( PROP_CharColorLumMod, XML_NAMESPACE_LO_EXT, XML_COLOR_LUM_MOD, XML_TYPE_PERCENT100 | XML_TYPE_PROP_TEXT, 0), MAP_EXT( PROP_CharColorLumOff, XML_NAMESPACE_LO_EXT, XML_COLOR_LUM_OFF, XML_TYPE_PERCENT100 | XML_TYPE_PROP_TEXT, 0), // RES_CHRATR_CONTOUR
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/txtparae.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit a0c6bc75628513f3c501321eea1458d77bacc36c Author: Stephan Bergmann AuthorDate: Mon Dec 19 08:16:37 2022 +0100 Commit: Stephan Bergmann CommitDate: Mon Dec 19 14:12:06 2022 + -Werror=maybe-uninitialized Change-Id: Ib467fa5eec2560943e10adc2c440fdbf8f853a2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/16 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 56e6c3737553..f0f6360b4904 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -4075,8 +4075,7 @@ void XMLTextParagraphExport::ExportContentControl( } sal_uInt32 nTabIndex; -xPropertySet->getPropertyValue("TabIndex") >>= nTabIndex; -if (nTabIndex) +if ((xPropertySet->getPropertyValue("TabIndex") >>= nTabIndex) && nTabIndex) { GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, XML_TAB_INDEX, OUString::number(nTabIndex));
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/script/XMLEventImportHelper.cxx |2 -- xmloff/source/script/XMLScriptContextFactory.cxx|3 +++ xmloff/source/script/XMLStarBasicContextFactory.cxx |3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) New commits: commit 8a33bde5288a4a652de35846aa34354044b872c3 Author: Caolán McNamara AuthorDate: Thu Dec 8 16:25:24 2022 + Commit: Caolán McNamara CommitDate: Thu Dec 8 19:45:00 2022 + tdf#152266 only warn about script:event-listener with non-empty targets Change-Id: I19518c4872b522686b3df1881ccee02d840c3db4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143829 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/xmloff/source/script/XMLEventImportHelper.cxx b/xmloff/source/script/XMLEventImportHelper.cxx index aa409e77765d..aebfd13dc7ee 100644 --- a/xmloff/source/script/XMLEventImportHelper.cxx +++ b/xmloff/source/script/XMLEventImportHelper.cxx @@ -102,8 +102,6 @@ SvXMLImportContext* XMLEventImportHelper::CreateContext( const OUString& rXmlEventName, const OUString& rLanguage) { -rImport.NotifyMacroEventRead(); - SvXMLImportContext* pContext = nullptr; // translate event name from xml to api diff --git a/xmloff/source/script/XMLScriptContextFactory.cxx b/xmloff/source/script/XMLScriptContextFactory.cxx index c5d7cb2d0d05..3ebc45c1c98a 100644 --- a/xmloff/source/script/XMLScriptContextFactory.cxx +++ b/xmloff/source/script/XMLScriptContextFactory.cxx @@ -53,6 +53,9 @@ SvXMLImportContext* XMLScriptContextFactory::CreateContext( // else: ignore } +if (!sURLVal.isEmpty()) +rImport.NotifyMacroEventRead(); + Sequence aValues{ comphelper::makePropertyValue(gsEventType, OUString(gsScript)), comphelper::makePropertyValue(gsURL, sURLVal) }; diff --git a/xmloff/source/script/XMLStarBasicContextFactory.cxx b/xmloff/source/script/XMLStarBasicContextFactory.cxx index e26198978596..bab59a0d7505 100644 --- a/xmloff/source/script/XMLStarBasicContextFactory.cxx +++ b/xmloff/source/script/XMLStarBasicContextFactory.cxx @@ -81,6 +81,9 @@ SvXMLImportContext* XMLStarBasicContextFactory::CreateContext( sMacroNameVal = sMacroNameVal.copy( rDoc.getLength()+1 ); } +if (!sMacroNameVal.isEmpty()) +rImport.NotifyMacroEventRead(); + Sequence aValues { comphelper::makePropertyValue(gsEventType, OUString(gsStarBasic)),
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/style/xmlnumfe.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 0a93f33a2ec5bdbda446d35dfbeca1b7b8a3b8cb Author: László Németh AuthorDate: Mon Nov 7 12:26:41 2022 +0100 Commit: László Németh CommitDate: Mon Nov 7 13:53:48 2022 +0100 xmloff: write transliteration-spellout only in extended ODF Follow-up to commit 7c20c3c2a9fc85c66dad9d09908b257beeedd78d "xmloff: ODF export: adapt all checks of ODFSVER_012 etc.". Reported by Eike Rathke. See also b7d53247eb2fab04f5f6d82d405f1ac0c73542b2 "tdf#115007 i18npool: add NatNum12 formats to locales" and 2a1d2d42af7f365330479f4032ddfdd9eeba7c1d "tdf#115007 add NatNum12 number format list items, fix title case". Change-Id: Idb25a37ffcad0a0fb05276b972561abf929cd81b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142373 Tested-by: László Németh Reviewed-by: László Németh diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index abf03285f818..a2938b1d998d 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -1205,12 +1205,12 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt const bool bWriteSpellout = aAttr.Format.isEmpty(); assert(bWriteSpellout); // mutually exclusive -// Export only for 1.2 with extensions or 1.3 and later. +// Export only for 1.2 and later with extensions SvtSaveOptions::ODFSaneDefaultVersion eVersion = rExport.getSaneDefaultVersion(); // Also ensure that duplicated transliteration-language and // transliteration-country attributes never escape into the wild with // releases. -if (eVersion > SvtSaveOptions::ODFSVER_012 && bWriteSpellout) +if ( (eVersion & SvtSaveOptions::ODFSVER_EXTENDED) && bWriteSpellout ) { /* FIXME-BCP47: ODF defines no transliteration-script or * transliteration-rfc-language-tag */
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/shapeexport.cxx | 42 + 1 file changed, 20 insertions(+), 22 deletions(-) New commits: commit 470201f392a019ef6f2b9e70377e66e47e839494 Author: Armin Le Grand (allotropia) AuthorDate: Thu Oct 27 15:08:50 2022 +0200 Commit: Armin Le Grand CommitDate: Fri Oct 28 10:47:36 2022 +0200 tdf#145240 add flexibility to receiving PolyPolygons over UNO API Make XMLShapeExport aware and use that PolyPolygons can be not only in Bezier format, but also a sequence of Points Change-Id: Ie00e87d35d4f8aa9d481b2800585c5a770bbbc0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141935 Tested-by: Jenkins Reviewed-by: Armin Le Grand diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index f975e4d1d1b2..f12958a9f650 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2321,37 +2321,35 @@ void XMLShapeExport::ImpExportPolygonShape( // prepare name (with most used) enum ::xmloff::token::XMLTokenEnum eName(XML_PATH); -if(bBezier) +uno::Any aAny( xPropSet->getPropertyValue("Geometry") ); +basegfx::B2DPolyPolygon aPolyPolygon; + +// tdf#145240 the Any can contain PolyPolygonBezierCoords or PointSequenceSequence +// (see OWN_ATTR_BASE_GEOMETRY in SvxShapePolyPolygon::getPropertyValueImpl), +// so be more flexible in interpreting it. Try to access bezier first: { -// get PolygonBezier -uno::Any aAny( xPropSet->getPropertyValue("Geometry") ); auto pSourcePolyPolygon = o3tl::tryAccess(aAny); + if(pSourcePolyPolygon && pSourcePolyPolygon->Coordinates.getLength()) { -const basegfx::B2DPolyPolygon aPolyPolygon( -basegfx::utils::UnoPolyPolygonBezierCoordsToB2DPolyPolygon( -*pSourcePolyPolygon)); +aPolyPolygon = basegfx::utils::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(*pSourcePolyPolygon); +} +} -// complex polygon shape, write as svg:d -const OUString aPolygonString( -basegfx::utils::exportToSvgD( -aPolyPolygon, -true, // bUseRelativeCoordinates -false, // bDetectQuadraticBeziers: not used in old, but maybe activated now -true)); // bHandleRelativeNextPointCompatible +// if received no data, try to access point sequence second: +if(0 == aPolyPolygon.count()) +{ +auto pSourcePolyPolygon = o3tl::tryAccess(aAny); -// write point array -mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_D, aPolygonString); +if(pSourcePolyPolygon) +{ +aPolyPolygon = basegfx::utils::UnoPointSequenceSequenceToB2DPolyPolygon(*pSourcePolyPolygon); } } -else -{ -// get non-bezier polygon -uno::Any aAny( xPropSet->getPropertyValue("Geometry") ); -const basegfx::B2DPolyPolygon aPolyPolygon( - basegfx::utils::UnoPointSequenceSequenceToB2DPolyPolygon(*o3tl::doAccess(aAny))); -if(!aPolyPolygon.areControlPointsUsed() && 1 == aPolyPolygon.count()) +if(aPolyPolygon.count()) +{ +if(!bBezier && !aPolyPolygon.areControlPointsUsed() && 1 == aPolyPolygon.count()) { // simple polygon shape, can be written as svg:points sequence const basegfx::B2DPolygon& aPolygon(aPolyPolygon.getB2DPolygon(0));
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/chart/SchXMLChartContext.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 1f09bf7bee753d34953fcefd6e2ee05797bf4b0a Author: Caolán McNamara AuthorDate: Tue Sep 27 14:47:25 2022 +0100 Commit: Caolán McNamara CommitDate: Tue Sep 27 17:47:41 2022 +0200 crashtesting: assert on converting ooo64499-3.sxc to ods a problem since: commit 776ea34deefe7bdce2fb8a06e5c55ef27ec87ea7 Date: Wed Sep 21 11:09:46 2022 +0200 use more string_view in xmloff Change-Id: Ifec0f4c84373aa4501acfde2fd357fd749f836c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140654 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index 2fe91b2026a1..7a8ac46c40a9 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -182,12 +182,12 @@ uno::Sequence< sal_Int32 > lcl_getNumberSequenceFromString( std::u16string_view while( nPos != std::u16string_view::npos ) { nPos = rStr.find( aSpace, nLastPos ); -if( nPos > nLastPos ) -{ -aVec.push_back( o3tl::toInt32(rStr.substr( nLastPos, (nPos - nLastPos) )) ); -} if( nPos != std::u16string_view::npos ) +{ +if( nPos > nLastPos ) +aVec.push_back( o3tl::toInt32(rStr.substr( nLastPos, (nPos - nLastPos) )) ); nLastPos = nPos + 1; +} } // last entry if( nLastPos != 0 &&
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/XMLTextMarkImportContext.cxx |2 - xmloff/source/text/txtimp.cxx | 35 2 files changed, 7 insertions(+), 30 deletions(-) New commits: commit a0a529a131c61588cf865143d47cdc23961fd596 Author: Michael Stahl AuthorDate: Fri Sep 23 16:04:18 2022 +0200 Commit: Caolán McNamara CommitDate: Fri Sep 23 21:34:59 2022 +0200 xmloff: ODF import: fix crash on fdo34997-1.odt Clean up the redundant checks too, these are all called after first checking hasCurrentFieldCtx(). (regression from 463178fef5c22f1a04d10e54491852d56e2038b0) Change-Id: Ieec848944ef576caf319d5da7dc11139a4d26c58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140514 Tested-by: Jenkins Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx index 4e42899e709c..4a71194df23c 100644 --- a/xmloff/source/text/XMLTextMarkImportContext.cxx +++ b/xmloff/source/text/XMLTextMarkImportContext.cxx @@ -436,7 +436,7 @@ void XMLTextMarkImportContext::endFastElement(sal_Int32 nElement) } case TypeFieldmarkEnd: { -if (!m_rHelper.hasCurrentFieldSeparator()) +if (m_rHelper.hasCurrentFieldCtx() && !m_rHelper.hasCurrentFieldSeparator()) { // backward compat for old files without separator InsertFieldmark(GetImport(), m_rHelper, true); } diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 288ccf45dc9b..87fd2b91283a 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -2127,49 +2127,26 @@ XMLTextImportHelper::popFieldCtx() void XMLTextImportHelper::addFieldParam( const OUString& name, const OUString& value ) { assert(!m_xImpl->m_FieldStack.empty()); -if (!m_xImpl->m_FieldStack.empty()) { -Impl::field_stack_item_t & FieldStackItem(m_xImpl->m_FieldStack.top()); -std::get<1>(FieldStackItem).emplace_back( name, value ); -} +Impl::field_stack_item_t & FieldStackItem(m_xImpl->m_FieldStack.top()); +std::get<1>(FieldStackItem).emplace_back( name, value ); } ::std::pair XMLTextImportHelper::getCurrentFieldType() const { assert(!m_xImpl->m_FieldStack.empty()); -if (!m_xImpl->m_FieldStack.empty()) -{ -return std::get<0>(m_xImpl->m_FieldStack.top()); -} -else -{ -return {}; -} +return std::get<0>(m_xImpl->m_FieldStack.top()); } uno::Reference XMLTextImportHelper::getCurrentFieldStart() const { assert(!m_xImpl->m_FieldStack.empty()); -if (!m_xImpl->m_FieldStack.empty()) -{ -return std::get<3>(m_xImpl->m_FieldStack.top()); -} -else -{ -return {}; -} +return std::get<3>(m_xImpl->m_FieldStack.top()); } bool XMLTextImportHelper::hasCurrentFieldSeparator() const { assert(!m_xImpl->m_FieldStack.empty()); -if (!m_xImpl->m_FieldStack.empty()) -{ -return std::get<2>(m_xImpl->m_FieldStack.top()).is(); -} -else -{ -return {}; -} +return std::get<2>(m_xImpl->m_FieldStack.top()).is(); } bool XMLTextImportHelper::hasCurrentFieldCtx() const @@ -2180,7 +2157,7 @@ bool XMLTextImportHelper::hasCurrentFieldCtx() const void XMLTextImportHelper::setCurrentFieldParamsTo(css::uno::Reference< css::text::XFormField> const ) { assert(!m_xImpl->m_FieldStack.empty()); -if (!m_xImpl->m_FieldStack.empty() && xFormField.is()) +if (xFormField.is()) { FieldParamImporter(::get<1>(m_xImpl->m_FieldStack.top()), xFormField->getParameters()).Import();
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/chart/SchXMLDataTableContext.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 47fe4927f01d7461f3a8f152895a75c98eae3e71 Author: Tomaž Vajngerl AuthorDate: Wed Sep 14 23:53:52 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Sep 15 10:16:22 2022 +0200 remove accidental printf Change-Id: I9deb3ec3dad5174dfb49cf0df3004746f3e47ea6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139959 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/xmloff/source/chart/SchXMLDataTableContext.cxx b/xmloff/source/chart/SchXMLDataTableContext.cxx index 4271221ed71f..a9a26d2e1d3d 100644 --- a/xmloff/source/chart/SchXMLDataTableContext.cxx +++ b/xmloff/source/chart/SchXMLDataTableContext.cxx @@ -42,7 +42,6 @@ SchXMLDataTableContext::SchXMLDataTableContext(SchXMLImportHelper& rImpHelper, S void SchXMLDataTableContext::startFastElement( sal_Int32 /*nElement*/, const uno::Reference& xAttrList) { -printf("SchXMLDataTableContext::startFastElement\n"); auto xChartDocument = mrImportHelper.GetChartDocument(); if (!xChartDocument.is()) return;
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/shapeexport.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f4f8f6ffd2f9c49e22a73dd15e9075617263f18e Author: Stephan Bergmann AuthorDate: Wed Sep 14 16:15:04 2022 +0200 Commit: Stephan Bergmann CommitDate: Wed Sep 14 19:35:34 2022 +0200 -Werror=maybe-uninitialized Change-Id: I7f38dee2356e154493b708424362f535f3164edf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139942 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index a9f0291a53b8..14297f25a424 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -4960,7 +4960,7 @@ static void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Referenc { if (xPropSetInfo->hasPropertyByName(u"WritingMode")) { -sal_Int16 nDirection; +sal_Int16 nDirection = -1; xPropSet->getPropertyValue(u"WritingMode") >>= nDirection; if (nDirection == text::WritingMode2::TB_RL90) fTextRotateAngle -= 90;
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/XMLTextFrameContext.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit b32c44f83ded245b0fc350aef350e1c55545e354 Author: Noel Grandin AuthorDate: Sat Sep 10 13:40:59 2022 +0200 Commit: Noel Grandin CommitDate: Sat Sep 10 20:58:13 2022 +0200 WARN->INFO in XMLTextFrameContext_Impl Unknown attributes are not really a problem. Change-Id: Ie21d42c6489eae11c730eec272fc430c2d17f727 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139750 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index e7ae0f092150..cc3603d6e67f 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -1065,7 +1065,7 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( sTblName = aIter.toString(); break; default: -XMLOFF_WARN_UNKNOWN("xmloff", aIter); +SAL_INFO("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " value=" << aIter.toString()); } };
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/ximpshap.cxx |4 1 file changed, 4 insertions(+) New commits: commit 46216a79f440dc972724bb243396b295267530ce Author: Caolán McNamara AuthorDate: Tue Sep 6 11:38:55 2022 +0100 Commit: Caolán McNamara CommitDate: Tue Sep 6 17:52:31 2022 +0200 check impress/calc IFrame "FrameURL" target similar to commit c7450d0b9d02c64ae3da467d329040787039767e Date: Tue Aug 30 17:01:08 2022 +0100 check IFrame "FrameURL" target Change-Id: Ibf28c29acb4476830431d02772f3ecd4b23a6a27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139480 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index af0bfc1a7ef0..94ac8532b6c9 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -90,6 +90,7 @@ #include #include #include +#include #include #include @@ -3151,6 +3152,9 @@ void SdXMLFloatingFrameShapeContext::startFastElement (sal_Int32 /*nElement*/, if( !maHref.isEmpty() ) { +if (INetURLObject(maHref).GetProtocol() == INetProtocol::Macro) +GetImport().NotifyMacroEventRead(); + xProps->setPropertyValue("FrameURL", Any(maHref) ); } }
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/style/impastpl.cxx | 88 +-- xmloff/source/style/impastpl.hxx | 14 ++ 2 files changed, 45 insertions(+), 57 deletions(-) New commits: commit 51103b8396c3a0c0dc34afcf3c11bd93e4342163 Author: Noel Grandin AuthorDate: Tue Aug 30 20:45:02 2022 +0200 Commit: Noel Grandin CommitDate: Wed Aug 31 08:34:52 2022 +0200 flatten data structures in SvXMLAutoStylePoolP_Impl a little set::set is already a node-based data structure, no need for more indirection Change-Id: Ib4083615696302621ce6f91059f99eee0849e4db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139067 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/style/impastpl.cxx b/xmloff/source/style/impastpl.cxx index 40d65ed5dc8c..e103fc1c372a 100644 --- a/xmloff/source/style/impastpl.cxx +++ b/xmloff/source/style/impastpl.cxx @@ -257,14 +257,14 @@ struct ComparePartial const XMLAutoStyleFamily& rFamilyData; bool operator()(const vector< XMLPropertyState >& lhs, -const std::unique_ptr& rhs) const +const XMLAutoStylePoolProperties& rhs) const { -return rFamilyData.mxMapper->LessPartial(lhs, rhs->GetProperties()); +return rFamilyData.mxMapper->LessPartial(lhs, rhs.GetProperties()); } -bool operator()(const std::unique_ptr& lhs, +bool operator()(const XMLAutoStylePoolProperties& lhs, const vector< XMLPropertyState >& rhs ) const { -return rFamilyData.mxMapper->LessPartial(lhs->GetProperties(), rhs); +return rFamilyData.mxMapper->LessPartial(lhs.GetProperties(), rhs); } }; @@ -275,18 +275,17 @@ struct ComparePartial bool XMLAutoStylePoolParent::Add( XMLAutoStyleFamily& rFamilyData, vector< XMLPropertyState >&& rProperties, OUString& rName, bool bDontSeek ) { -XMLAutoStylePoolProperties *pProperties = nullptr; +PropertiesListType::iterator pProperties = m_PropertiesList.end();; auto [itBegin, itEnd] = std::equal_range(m_PropertiesList.begin(), m_PropertiesList.end(), rProperties, ComparePartial{rFamilyData}); if (!bDontSeek) for (auto it = itBegin; it != itEnd; ++it) -if (rFamilyData.mxMapper->Equals((*it)->GetProperties(), rProperties)) -pProperties = it->get(); +if (rFamilyData.mxMapper->Equals(it->GetProperties(), rProperties)) +pProperties = it; bool bAdded = false; -if( bDontSeek || !pProperties ) +if( bDontSeek || pProperties == m_PropertiesList.end() ) { -pProperties = new XMLAutoStylePoolProperties( rFamilyData, std::move(rProperties), msParent ); -m_PropertiesList.insert(itBegin, std::unique_ptr(pProperties)); +pProperties = m_PropertiesList.emplace(itBegin, rFamilyData, std::move(rProperties), msParent); bAdded = true; } @@ -308,11 +307,9 @@ bool XMLAutoStylePoolParent::AddNamed( XMLAutoStyleFamily& rFamilyData, vector< auto it = std::lower_bound(m_PropertiesList.begin(), m_PropertiesList.end(), rProperties, ComparePartial{rFamilyData}); -std::unique_ptr pProperties( -new XMLAutoStylePoolProperties(rFamilyData, std::move(rProperties), msParent)); +it = m_PropertiesList.emplace(it, rFamilyData, std::move(rProperties), msParent); // ignore the generated name -pProperties->SetName( rName ); -m_PropertiesList.insert(it, std::move(pProperties)); +it->SetName( rName ); return true; } @@ -325,8 +322,8 @@ OUString XMLAutoStylePoolParent::Find( const XMLAutoStyleFamily& rFamilyData, co OUString sName; auto [itBegin,itEnd] = std::equal_range(m_PropertiesList.begin(), m_PropertiesList.end(), rProperties, ComparePartial{rFamilyData}); for (auto it = itBegin; it != itEnd; ++it) -if (rFamilyData.mxMapper->Equals((*it)->GetProperties(), rProperties)) -sName = (*it)->GetName(); +if (rFamilyData.mxMapper->Equals(it->GetProperties(), rProperties)) +sName = it->GetName(); return sName; } @@ -374,15 +371,15 @@ void SvXMLAutoStylePoolP_Impl::AddFamily( { // FIXME: do we really intend to replace the previous nFamily // entry in this case ? -SAL_WARN_IF( (*iter)->mxMapper != rMapper, "xmloff", +SAL_WARN_IF( iter->mxMapper != rMapper, "xmloff", "Adding duplicate family " << rStrName << " with mismatching mapper ! " << - typeid((*iter)->mxMapper.get()).name() << " " << + typeid(iter->mxMapper.get()).name() << " " << typeid(*rMapper).name() ); } #endif -m_FamilySet.insert(std::make_unique(nFamily, rStrName, rMapper, aPrefix, bAsFamily)); +m_FamilySet.emplace(nFamily, rStrName, rMapper, aPrefix, bAsFamily); } void SvXMLAutoStylePoolP_Impl::SetFamilyPropSetMapper( @@ -392,7 +389,7
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/shapeexport.cxx | 188 +++-- 1 file changed, 78 insertions(+), 110 deletions(-) New commits: commit e268ac208d22aef687e99a625fc32e2a03a7b873 Author: Miklos Vajna AuthorDate: Mon Aug 29 13:37:52 2022 +0200 Commit: Miklos Vajna CommitDate: Mon Aug 29 14:24:00 2022 +0200 xmloff: extract ExportGraphicPreview() from ... ... XMLShapeExport::ImpExportTableShape(), this way XMLShapeExport::ImpExportMediaShape() can reuse it. Both write an XGraphic fallback, just the name template and the format of the export result differ. Change-Id: Ia1217b7bc3363d3fe3fe64f2add69e5072cc08c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138971 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 6931c5684642..c44349184770 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -3364,6 +3364,82 @@ lcl_StoreMediaAndGetURL(SvXMLExport & rExport, } } +namespace +{ +void ExportGraphicPreview(const uno::Reference& xGraphic, SvXMLExport& rExport, const std::u16string_view& rPrefix, const std::u16string_view& rExtension, const OUString& rMimeType) +{ +const bool bExportEmbedded(rExport.getExportFlags() & SvXMLExportFlags::EMBEDDED); + +if( xGraphic.is() ) try +{ +uno::Reference< uno::XComponentContext > xContext = rExport.getComponentContext(); + +uno::Reference< embed::XStorage > xPictureStorage; +uno::Reference< embed::XStorage > xStorage; +uno::Reference< io::XStream > xPictureStream; + +OUString sPictureName; +if( bExportEmbedded ) +{ +xPictureStream.set( xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.comp.MemoryStream", xContext), uno::UNO_QUERY_THROW ); +} +else +{ +xStorage.set( rExport.GetTargetStorage(), uno::UNO_SET_THROW ); + +xPictureStorage.set( xStorage->openStorageElement( "Pictures" , ::embed::ElementModes::READWRITE ), uno::UNO_SET_THROW ); + +sal_Int32 nIndex = 0; +do +{ +sPictureName = rPrefix + OUString::number( ++nIndex ) + rExtension; +} +while( xPictureStorage->hasByName( sPictureName ) ); + +xPictureStream.set( xPictureStorage->openStreamElement( sPictureName, ::embed::ElementModes::READWRITE ), uno::UNO_SET_THROW ); +} + +uno::Reference< graphic::XGraphicProvider > xProvider( graphic::GraphicProvider::create(xContext) ); +uno::Sequence< beans::PropertyValue > aArgs{ +comphelper::makePropertyValue("MimeType", rMimeType ), +comphelper::makePropertyValue("OutputStream", xPictureStream->getOutputStream()) +}; +xProvider->storeGraphic( xGraphic, aArgs ); + +if( xPictureStorage.is() ) +{ +uno::Reference< embed::XTransactedObject > xTrans( xPictureStorage, uno::UNO_QUERY ); +if( xTrans.is() ) +xTrans->commit(); +} + +if( !bExportEmbedded ) +{ +OUString sURL = "Pictures/" + sPictureName; +rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sURL ); +rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); +rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED ); +rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD ); +} + +SvXMLElementExport aElem( rExport, XML_NAMESPACE_DRAW, XML_IMAGE, false, true ); + +if( bExportEmbedded ) +{ +uno::Reference< io::XSeekableInputStream > xSeekable( xPictureStream, uno::UNO_QUERY_THROW ); +xSeekable->seek(0); + +XMLBase64Export aBase64Exp( rExport ); +aBase64Exp.exportOfficeBinaryDataElement( uno::Reference < io::XInputStream >( xPictureStream, uno::UNO_QUERY_THROW ) ); +} +} +catch( uno::Exception const & ) +{ +DBG_UNHANDLED_EXCEPTION("xmloff.draw"); +} +} +} + void XMLShapeExport::ImpExportMediaShape( const uno::Reference< drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures, css::awt::Point* pRefPoint) @@ -3459,48 +3535,7 @@ void XMLShapeExport::ImpExportMediaShape( if (!aGraphic.IsNone()) { // The media has a preview, export it. -uno::Reference xPictureStorage; -uno::Reference xStorage; -uno::Reference xPictureStream; -OUString sPictureName; -xStorage.set(GetExport().GetTargetStorage(), uno::UNO_SET_THROW); -xPictureStorage.set( -xStorage->openStorageElement("Pictures", embed::ElementModes::READWRITE), -uno::UNO_SET_THROW); -sal_Int32 nIndex = 0; -while (true) -{ -
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/shapeimport.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 292fd4d83bba706a10926465b390fa5bc0d4e1ce Author: Caolán McNamara AuthorDate: Thu Aug 18 09:54:02 2022 +0100 Commit: Caolán McNamara CommitDate: Thu Aug 18 14:28:50 2022 +0200 cid#1509254 Uninitialized scalar variable Change-Id: I2d1f0944a069230a435890734eb18e8ee3e275e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138470 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index f0e150910ae9..259348e44176 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -615,6 +615,7 @@ void ShapeGroupContext::popGroupAndPostProcess() // second add the already existing shapes in the unsorted list ZOrderHint aNewHint; +aNewHint.pShape = nullptr; do { nCount--;
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/forms/elementexport.cxx | 46 +- 1 file changed, 23 insertions(+), 23 deletions(-) New commits: commit e010a57ab2489464719fb73ad0aea6e4e4c60383 Author: ehsan AuthorDate: Fri Jul 1 21:24:56 2022 +0430 Commit: Hossein CommitDate: Wed Aug 3 13:08:43 2022 +0200 tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro Change-Id: I9f3819c155bed0796f1b12e5e46e51d42f098117 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136775 Tested-by: Jenkins Reviewed-by: Hossein diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index 5f283fa8b036..dd005e551ff6 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -509,11 +509,11 @@ namespace xmloff { PROPERTY_LABEL, PROPERTY_TITLE }; -OSL_ENSURE( SAL_N_ELEMENTS(aStringPropertyNames) == -SAL_N_ELEMENTS(nStringPropertyAttributeIds), +OSL_ENSURE( std::size(aStringPropertyNames) == +std::size(nStringPropertyAttributeIds), "OControlExport::exportCommonControlAttributes: somebody tampered with the maps (1)!"); -for (i=0; i 0 -static const sal_Int32 nIdCount = SAL_N_ELEMENTS(nBooleanPropertyAttributeIds); -static const sal_Int32 nNameCount = SAL_N_ELEMENTS(pBooleanPropertyNames); -static const sal_Int32 nFlagsCount = SAL_N_ELEMENTS(nBooleanPropertyAttrFlags); +static const sal_Int32 nIdCount = std::size(nBooleanPropertyAttributeIds); +static const sal_Int32 nNameCount = std::size(pBooleanPropertyNames); +static const sal_Int32 nFlagsCount = std::size(nBooleanPropertyAttrFlags); OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nFlagsCount), "OControlExport::exportCommonControlAttributes: somebody tampered with the maps (2)!"); #endif -for (i=0; i 0 -static const sal_Int32 nIdCount = SAL_N_ELEMENTS(nIntegerPropertyAttributeIds); -static const sal_Int32 nNameCount = SAL_N_ELEMENTS(pIntegerPropertyNames); -static const sal_Int32 nDefaultCount = SAL_N_ELEMENTS(nIntegerPropertyAttrDefaults); +static const sal_Int32 nIdCount = std::size(nIntegerPropertyAttributeIds); +static const sal_Int32 nNameCount = std::size(pIntegerPropertyNames); +static const sal_Int32 nDefaultCount = std::size(nIntegerPropertyAttrDefaults); OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nDefaultCount), "OControlExport::exportCommonControlAttributes: somebody tampered with the maps (3)!"); #endif -for (i=0; i 0 -static const sal_Int32 nNameCount = SAL_N_ELEMENTS(pBooleanPropertyNames); +static const sal_Int32 nNameCount = std::size(pBooleanPropertyNames); OSL_ENSURE((nIdCount == nNameCount), "OControlExport::exportSpecialAttributes: somebody tampered with the maps (1)!"); #endif @@ -982,12 +982,12 @@ namespace xmloff 10 }; -static const sal_Int32 nIdCount = SAL_N_ELEMENTS( nIntegerPropertyAttributeIds ); +static const sal_Int32 nIdCount = std::size( nIntegerPropertyAttributeIds ); #if OSL_DEBUG_LEVEL > 0 -static const sal_Int32 nNameCount = SAL_N_ELEMENTS( pIntegerPropertyNames ); +static const sal_Int32 nNameCount = std::size( pIntegerPropertyNames ); OSL_ENSURE( ( nIdCount == nNameCount ), "OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" ); -static const sal_Int32 nDefaultCount = SAL_N_ELEMENTS( nIntegerPropertyAttrDefaults ); +static const sal_Int32 nDefaultCount = std::size( nIntegerPropertyAttrDefaults ); OSL_ENSURE( ( nIdCount == nDefaultCount ), "OControlExport::exportSpecialAttributes: somebody tampered with the maps (3)!" ); #endif @@ -1129,9 +1129,9 @@ namespace xmloff u"" PROPERTY_GROUP_NAME }; -static const sal_Int32 nIdCount = SAL_N_ELEMENTS( nStringPropertyAttributeIds ); +static const sal_Int32 nIdCount = std::size( nStringPropertyAttributeIds ); #if OSL_DEBUG_LEVEL > 0 -static const sal_Int32 nNameCount = SAL_N_ELEMENTS( pStringPropertyNames ); +static const sal_Int32 nNameCount = std::size( pStringPropertyNames ); OSL_ENSURE( ( nIdCount == nNameCount ), "OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" ); #endif @@ -2050,9 +2050,9 @@ namespace xmloff { PROPERTY_NAME, /*PROPERTY_TARGETURL,*/ PROPERTY_COMMAND, PROPERTY_FILTER,
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/style/xmlimppr.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 1c50d7e229942aacdc9ece7f01f233510500c87e Author: Andrea Gelmini AuthorDate: Wed Jul 13 13:46:43 2022 +0200 Commit: Julien Nabet CommitDate: Thu Jul 21 16:14:19 2022 +0200 Removed duplicated include Change-Id: I0ebf29930fd6162c34f3d03ad74aa188839c7e31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137023 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx index f35a11983554..446c03872215 100644 --- a/xmloff/source/style/xmlimppr.cxx +++ b/xmloff/source/style/xmlimppr.cxx @@ -44,7 +44,6 @@ #include #include -#include #include using namespace ::com::sun::star::uno;
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/txtparae.cxx | 64 +--- 1 file changed, 22 insertions(+), 42 deletions(-) New commits: commit 454e182898cdf9c8a9ce1b575591910bbff3a762 Author: Mike Kaganski AuthorDate: Tue Jul 12 11:22:25 2022 +0300 Commit: Mike Kaganski CommitDate: Wed Jul 13 09:54:03 2022 +0200 Simplify XMLTextParagraphExport::addHyperlinkAttributes Change-Id: I283fc348d1ecaee92095f50c6f7d92fff8b09dce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136994 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 63232f8b2822..5b2cb233dd38 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -3369,18 +3369,13 @@ bool XMLTextParagraphExport::addHyperlinkAttributes( const Reference< XPropertyState > & rPropState, const Reference< XPropertySetInfo > & rPropSetInfo ) { -bool bExport = false; -OUString sHRef, sName, sTargetFrame, sUStyleName, sVStyleName; -bool bServerMap = false; +OUString sHRef; if( rPropSetInfo->hasPropertyByName( gsHyperLinkURL ) && ( !rPropState.is() || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( gsHyperLinkURL ) ) ) { rPropSet->getPropertyValue( gsHyperLinkURL ) >>= sHRef; - -if( !sHRef.isEmpty() ) -bExport = true; } if ( sHRef.isEmpty() ) @@ -3390,81 +3385,66 @@ bool XMLTextParagraphExport::addHyperlinkAttributes( return false; } +GetExport().AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE); +GetExport().AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, + GetExport().GetRelativeReference(sHRef)); + if ( rPropSetInfo->hasPropertyByName( gsHyperLinkName ) && ( !rPropState.is() || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( gsHyperLinkName ) ) ) { +OUString sName; rPropSet->getPropertyValue( gsHyperLinkName ) >>= sName; if( !sName.isEmpty() ) -bExport = true; +GetExport().AddAttribute(XML_NAMESPACE_OFFICE, XML_NAME, sName); } if ( rPropSetInfo->hasPropertyByName( gsHyperLinkTarget ) && ( !rPropState.is() || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( gsHyperLinkTarget ) ) ) { +OUString sTargetFrame; rPropSet->getPropertyValue( gsHyperLinkTarget ) >>= sTargetFrame; if( !sTargetFrame.isEmpty() ) -bExport = true; +{ +GetExport().AddAttribute(XML_NAMESPACE_OFFICE, XML_TARGET_FRAME_NAME, sTargetFrame); +enum XMLTokenEnum eTok = sTargetFrame == "_blank" ? XML_NEW : XML_REPLACE; +GetExport().AddAttribute(XML_NAMESPACE_XLINK, XML_SHOW, eTok); +} } if ( rPropSetInfo->hasPropertyByName( gsServerMap ) && ( !rPropState.is() || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( gsServerMap ) ) ) { -bServerMap = *o3tl::doAccess(rPropSet->getPropertyValue( gsServerMap )); +bool bServerMap = *o3tl::doAccess(rPropSet->getPropertyValue( gsServerMap )); if ( bServerMap ) -bExport = true; +GetExport().AddAttribute(XML_NAMESPACE_OFFICE, XML_SERVER_MAP, XML_TRUE); } if ( rPropSetInfo->hasPropertyByName( gsUnvisitedCharStyleName ) && ( !rPropState.is() || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( gsUnvisitedCharStyleName ) ) ) { +OUString sUStyleName; rPropSet->getPropertyValue( gsUnvisitedCharStyleName ) >>= sUStyleName; if( !sUStyleName.isEmpty() ) -bExport = true; +GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_STYLE_NAME, + GetExport().EncodeStyleName(sUStyleName)); } if ( rPropSetInfo->hasPropertyByName( gsVisitedCharStyleName ) && ( !rPropState.is() || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( gsVisitedCharStyleName ) ) ) { +OUString sVStyleName; rPropSet->getPropertyValue( gsVisitedCharStyleName ) >>= sVStyleName; if( !sVStyleName.isEmpty() ) -bExport = true; -} - -if ( bExport ) -{ -GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); -GetExport().AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference( sHRef ) ); - -if( !sName.isEmpty() ) -GetExport().AddAttribute( XML_NAMESPACE_OFFICE, XML_NAME, sName ); - -if( !sTargetFrame.isEmpty() ) -{ -GetExport().AddAttribute( XML_NAMESPACE_OFFICE, - XML_TARGET_FRAME_NAME, sTargetFrame ); -enum XMLTokenEnum eTok = sTargetFrame == "_blank" ? XML_NEW :
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/shapeimport.cxx |9 + 1 file changed, 5 insertions(+), 4 deletions(-) New commits: commit db63000ea7805ddd762521a7cf39de203dbe6c3f Author: Noel Grandin AuthorDate: Tue Jul 5 10:24:38 2022 +0200 Commit: Noel Grandin CommitDate: Tue Jul 5 11:51:32 2022 +0200 tdf#137544 reduce ref-counting traffic we can store a direct pointer here, shaves 5% off load time Change-Id: I418916df946f53ead28bb5cf76614a874283e7d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136821 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index 1a21953f39ff..538120d2bfaa 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -515,8 +515,9 @@ struct ZOrderHint { sal_Int32 nIs; sal_Int32 nShould; -/// The hint is for this shape. -uno::Reference xShape; +/// The hint is for this shape. We don't use uno::Reference here to speed up +/// some operations, and because this shape is always held by mxShapes +drawing::XShape* pShape; bool operator<(const ZOrderHint& rComp) const { return nShould < rComp.nShould; } }; @@ -731,7 +732,7 @@ void XMLShapeImportHelper::shapeWithZIndexAdded( css::uno::Reference< css::drawi ZOrderHint aNewHint; aNewHint.nIs = mpImpl->mpGroupContext->mnCurrentZ++; aNewHint.nShould = nZIndex; -aNewHint.xShape = xShape; +aNewHint.pShape = xShape.get(); if( nZIndex == -1 ) { @@ -749,7 +750,7 @@ void XMLShapeImportHelper::shapeRemoved(const uno::Reference& x { auto it = std::find_if(mpImpl->mpGroupContext->maZOrderList.begin(), mpImpl->mpGroupContext->maZOrderList.end(), [](const ZOrderHint& rHint) { -return rHint.xShape == xShape; +return rHint.pShape == xShape.get(); }); if (it == mpImpl->mpGroupContext->maZOrderList.end()) // Part of the unsorted list, nothing to do.
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/core/xmlimp.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit d30810b5a116816fe8a6d3341aa98e43adc56de2 Author: Noel Grandin AuthorDate: Mon Jul 4 14:08:53 2022 +0200 Commit: Noel Grandin CommitDate: Mon Jul 4 15:37:36 2022 +0200 dont instantiate TextImport unless we need it speeds up loading XColorList and related UI elements Change-Id: I737137669afea8a70dfefa78cf9f8a325d16fbcb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136806 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 3d9cb9f1edb1..873f557f8982 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -598,7 +598,8 @@ void SAL_CALL SvXMLImport::endDocument() // #i9518# All the stuff that accesses the document has to be done here, not in the dtor, // because the SvXMLImport dtor might not be called until after the document has been closed. -GetTextImport()->MapCrossRefHeadingFieldsHorribly(); +if (mxTextImport) +mxTextImport->MapCrossRefHeadingFieldsHorribly(); if (mpImpl->mpRDFaHelper) {
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/style/xmlnumfe.cxx | 31 +++ 1 file changed, 31 insertions(+) New commits: commit 33a8c4bd0e8533ab42894280e7e04c13a47aefa9 Author: Eike Rathke AuthorDate: Wed Jun 8 17:49:15 2022 +0200 Commit: Eike Rathke CommitDate: Wed Jun 8 20:49:53 2022 +0200 Related: tdf#149484 Write proper with Change-Id: I46b7987dde25840ae0b6e5871b14e3806c6e4ac8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135508 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index 52b286dd50a9..82ed552dcbca 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -1254,6 +1254,37 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt WriteBooleanElement_Impl(); bAnyContent = true; } +else if (eType == XML_BOOLEAN_STYLE) +{ +// may contain only and +// elements. +sal_uInt16 nPos = 0; +bool bEnd = false; +while (!bEnd) +{ +const short nElemType = rFormat.GetNumForType( nPart, nPos ); +switch (nElemType) +{ +case 0: +bEnd = true;// end of format reached +if (bHasText && sTextContent.isEmpty()) +bHasText = false; // don't write trailing empty text +break; +case NF_SYMBOLTYPE_STRING: +{ +const OUString* pElemStr = rFormat.GetNumForString( nPart, nPos ); +if (pElemStr) +AddToTextElement_Impl( *pElemStr ); +} +break; +case NF_KEY_BOOLEAN: +WriteBooleanElement_Impl(); +bAnyContent = true; +break; +} +++nPos; +} +} else { // first loop to collect attributes
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/style/xmlnumfi.cxx | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) New commits: commit 025231224b8b076e280235cd2b943addd2fb0755 Author: Eike Rathke AuthorDate: Wed Jun 8 17:47:19 2022 +0200 Commit: Eike Rathke CommitDate: Wed Jun 8 20:15:44 2022 +0200 Resolves: tdf#149484 Read and handle in Change-Id: I1be5f2be908eb88aa4ef7436ea7c09f35b076acf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135507 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index e5e9a25828fa..46ee44b3080f 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -497,8 +497,11 @@ static bool lcl_ValidChar( sal_Unicode cChar, const SvXMLNumFormatContext& rPare } // see ImpSvNumberformatScan::Next_Symbol + +// All format types except BOOLEAN may contain minus sign or delimiter. if ( cChar == '-' ) -return true; // all format types may content minus sign or delimiter +return nFormatType != SvXMLStylesTokens::BOOLEAN_STYLE; + if ( ( cChar == ' ' || cChar == '/' || cChar == '.' || @@ -528,11 +531,13 @@ static void lcl_EnquoteIfNecessary( OUStringBuffer& rContent, const SvXMLNumForm { bool bQuote = true; sal_Int32 nLength = rContent.getLength(); +const SvXMLStylesTokens nFormatType = rParent.GetType(); -if ((nLength == 1 && lcl_ValidChar( rContent[0], rParent)) || -(nLength == 2 && - ((rContent[0] == ' ' && rContent[1] == '-') || - (rContent[1] == ' ' && lcl_ValidChar( rContent[0], rParent) +if (nFormatType != SvXMLStylesTokens::BOOLEAN_STYLE && +((nLength == 1 && lcl_ValidChar( rContent[0], rParent)) || + (nLength == 2 && + ((rContent[0] == ' ' && rContent[1] == '-') || + (rContent[1] == ' ' && lcl_ValidChar( rContent[0], rParent)) { // Don't quote single separator characters like space or percent, // or separator characters followed by space (used in date formats). @@ -541,7 +546,7 @@ static void lcl_EnquoteIfNecessary( OUStringBuffer& rContent, const SvXMLNumForm // the difference of quotes. bQuote = false; } -else if ( rParent.GetType() == SvXMLStylesTokens::PERCENTAGE_STYLE && nLength > 1 ) +else if ( nFormatType == SvXMLStylesTokens::PERCENTAGE_STYLE && nLength > 1 ) { // the percent character in percentage styles must be left out of quoting // (one occurrence is enough even if there are several percent characters in the string) @@ -907,7 +912,7 @@ void SvXMLNumFmtElementContext::endFastElement(sal_Int32 ) } break; case SvXMLStyleTokens::Boolean: -// ignored - only default boolean format is supported +rParent.AddNfKeyword( NF_KEY_BOOLEAN ); break; case SvXMLStyleTokens::Day: @@ -1535,9 +1540,8 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* pFormatter) nIndex = pFormatter->GetFormatIndex( NF_NUMBER_SYSTEM, nFormatLang ); } -// boolean is always the builtin boolean format -// (no other boolean formats are implemented) -if ( nType == SvXMLStylesTokens::BOOLEAN_STYLE ) +if ( nType == SvXMLStylesTokens::BOOLEAN_STYLE && !bHasExtraText && +aMyConditions.empty() && sFormat.toChar() != '[' ) nIndex = pFormatter->GetFormatIndex( NF_BOOLEAN, nFormatLang ); // check for default date formats
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/txtflde.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 875abc7774e5fb72bc764e0ae8004a85cc9dd14f Author: Stephan Bergmann AuthorDate: Thu Jun 2 18:50:13 2022 +0200 Commit: Stephan Bergmann CommitDate: Thu Jun 2 20:32:20 2022 +0200 Use o3tl::make_unsigned, length is known to be non-negative Change-Id: I2fac355230fd0c80016ca2259b8c6150e7160567 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135323 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index fb6cd419b923..242b641369c8 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -62,6 +62,7 @@ #include #include #include +#include #include #include #include @@ -2853,7 +2854,7 @@ void XMLTextFieldExport::ExplodeFieldMasterName( size_t nSeparator = sMasterName.find('.', nLength); // '.' found? -if (static_cast(nSeparator) == nLength || nSeparator == std::u16string_view::npos) { +if (nSeparator == o3tl::make_unsigned(nLength) || nSeparator == std::u16string_view::npos) { SAL_WARN("xmloff.text", "no field var name!"); } else
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/style/xmltabi.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit b1a4d2a49a47cd8b457b8c704134c0f1beaa9210 Author: Noel Grandin AuthorDate: Thu Jun 2 13:33:06 2022 +0200 Commit: Noel Grandin CommitDate: Thu Jun 2 15:37:59 2022 +0200 tdf#148846 TOC: Character fill for tabulation is wrong regression from commit 8e4453c2117b6c3bb15be6b949a0a8a43df66647 use more FastAttributeIter::toView Change-Id: I510716d2e4c5535faefb3afb658827cca9b6c4fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135303 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/style/xmltabi.cxx b/xmloff/source/style/xmltabi.cxx index 0c470a4891c7..601c3f5fd191 100644 --- a/xmloff/source/style/xmltabi.cxx +++ b/xmloff/source/style/xmltabi.cxx @@ -93,7 +93,7 @@ SvxXMLTabStopContext_Impl::SvxXMLTabStopContext_Impl( break; case XML_ELEMENT(STYLE, XML_CHAR): if( !aIter.isEmpty() ) -aTabStop.DecimalChar = aIter.toView()[0]; +aTabStop.DecimalChar = aIter.toString()[0]; break; case XML_ELEMENT(STYLE, XML_LEADER_STYLE): if( IsXMLToken( aIter, XML_NONE ) ) @@ -105,7 +105,7 @@ SvxXMLTabStopContext_Impl::SvxXMLTabStopContext_Impl( break; case XML_ELEMENT(STYLE, XML_LEADER_TEXT): if( !aIter.isEmpty() ) -cTextFillChar = aIter.toView()[0]; +cTextFillChar = aIter.toString()[0]; break; default: XMLOFF_WARN_UNKNOWN("xmloff", aIter);
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/core/DocumentSettingsContext.cxx |6 -- xmloff/source/core/XMLBase64ImportContext.cxx |8 +--- xmloff/source/draw/animationexport.cxx | 12 xmloff/source/draw/xexptran.cxx|5 ++--- xmloff/source/draw/ximppage.cxx|4 ++-- xmloff/source/meta/xmlmetai.cxx|2 +- xmloff/source/style/xmlnumfi.cxx | 13 - xmloff/source/text/XMLChangeInfoContext.cxx|3 ++- xmloff/source/text/XMLTextFrameContext.cxx |6 -- xmloff/source/text/txtfldi.cxx |4 ++-- 10 files changed, 38 insertions(+), 25 deletions(-) New commits: commit 733a6b4f8eac9d9b93d7ea9c605bebab9f5345dd Author: Noel Grandin AuthorDate: Thu Jun 2 11:43:33 2022 +0200 Commit: Noel Grandin CommitDate: Thu Jun 2 13:06:27 2022 +0200 elide some makeStringAndClear() class when we are passing the result to a string_view, it is pointless. Change-Id: I1e11d2610d70ed49c0b00d0c908829e8f1252bab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135298 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx index bf3a8f7f6472..b21010b07c81 100644 --- a/xmloff/source/core/DocumentSettingsContext.cxx +++ b/xmloff/source/core/DocumentSettingsContext.cxx @@ -19,6 +19,7 @@ #include +#include #include #include @@ -408,9 +409,10 @@ void XMLConfigItemContext::endFastElement(sal_Int32 ) uno::Sequence aDecoded; if (IsXMLToken(msType, XML_BASE64BINARY)) { -OUString sChars = maCharBuffer.makeStringAndClear().trim(); -if( !sChars.isEmpty() ) +std::u16string_view sChars = o3tl::trim(maCharBuffer); +if( !sChars.empty() ) ::comphelper::Base64::decodeSomeChars( aDecoded, sChars ); +maCharBuffer.setLength(0); } else sValue = maCharBuffer.makeStringAndClear(); diff --git a/xmloff/source/core/XMLBase64ImportContext.cxx b/xmloff/source/core/XMLBase64ImportContext.cxx index 301865a26c10..81d2498bbabd 100644 --- a/xmloff/source/core/XMLBase64ImportContext.cxx +++ b/xmloff/source/core/XMLBase64ImportContext.cxx @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -43,13 +44,14 @@ XMLBase64ImportContext::~XMLBase64ImportContext() void XMLBase64ImportContext::endFastElement(sal_Int32 ) { -OUString sChars = maCharBuffer.makeStringAndClear().trim(); -if( !sChars.isEmpty() ) +std::u16string_view sChars = o3tl::trim(maCharBuffer); +if( !sChars.empty() ) { -Sequence< sal_Int8 > aBuffer( (sChars.getLength() / 4) * 3 ); +Sequence< sal_Int8 > aBuffer( (sChars.size() / 4) * 3 ); ::comphelper::Base64::decodeSomeChars( aBuffer, sChars ); xOut->writeBytes( aBuffer ); } +maCharBuffer.setLength(0); xOut->closeOutput(); } diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx index 62781694e28f..2a48e16c34f5 100644 --- a/xmloff/source/draw/animationexport.cxx +++ b/xmloff/source/draw/animationexport.cxx @@ -1485,7 +1485,8 @@ void AnimationsExporterImpl::convertValue( XMLTokenEnum eAttributeName, OUString if( !sTmp.isEmpty() ) sTmp.append( ';' ); convertValue( eAttributeName, sTmp2, *pAny ); -sTmp.append( sTmp2.makeStringAndClear() ); +sTmp.append( sTmp2 ); +sTmp2.setLength(0); } } else @@ -1567,7 +1568,8 @@ void AnimationsExporterImpl::convertTiming( OUStringBuffer& sTmp, const Any& rVa if( !sTmp.isEmpty() ) sTmp.append( ';' ); convertTiming( sTmp2, *pAny ); -sTmp.append( sTmp2.makeStringAndClear() ); +sTmp.append( sTmp2 ); +sTmp2.setLength(0); } } else if( auto x = o3tl::tryAccess(rValue) ) @@ -1593,7 +1595,8 @@ void AnimationsExporterImpl::convertTiming( OUStringBuffer& sTmp, const Any& rVa SvXMLUnitConverter::convertEnum( sTmp2, pEvent->Trigger, aAnimations_EnumMap_EventTrigger ); -sTmp.append( sTmp2.makeStringAndClear() ); +sTmp.append( sTmp2 ); +sTmp2.setLength(0); } if( pEvent->Offset.hasValue() ) @@ -1603,7 +1606,8 @@ void AnimationsExporterImpl::convertTiming( OUStringBuffer& sTmp, const Any& rVa if( !sTmp.isEmpty() ) sTmp.append( '+' ); -sTmp.append( sTmp2.makeStringAndClear() ); +sTmp.append( sTmp2 ); +sTmp2.setLength(0); } } else diff --git a/xmloff/source/draw/xexptran.cxx b/xmloff/source/draw/xexptran.cxx index c8e7f51bb403..776401fb2840 100644 --- a/xmloff/source/draw/xexptran.cxx +++ b/xmloff/source/draw/xexptran.cxx @@ -129,11 +129,10 @@ static double
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/XMLSectionFootnoteConfigImport.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 9896f330cdb3df67b74b16a2c2177a8505fd2485 Author: Michael Stahl AuthorDate: Fri May 27 21:34:57 2022 +0200 Commit: Michael Stahl CommitDate: Sat May 28 16:47:09 2022 +0200 tdf#145178 xmloff: ODF import: fix another bad attribute ...in XMLSectionFootnoteConfigImport. (regression from commit 9814c1f2edf56ecc0f31001db9234ef335488879) Change-Id: I79ab3b74853bd3ec9058fea72c341768e916bbd3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135048 Tested-by: Michael Stahl Reviewed-by: Michael Stahl diff --git a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx index ef408c0c13c8..0f4f51e1b4e3 100644 --- a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx +++ b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx @@ -113,7 +113,7 @@ void XMLSectionFootnoteConfigImport::startFastElement( bNumOwn = true; break; } -case XML_ELEMENT(TEXT, XML_NUM_LETTER_SYNC): +case XML_ELEMENT(STYLE, XML_NUM_LETTER_SYNC): { sNumLetterSync = aIter.toString(); bNumOwn = true;
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/XMLSectionFootnoteConfigImport.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit bbec710bd25fc5da27636cde73fe4ab23c76904f Author: Louis Possoz AuthorDate: Sat Apr 30 06:39:38 2022 +0100 Commit: Michael Stahl CommitDate: Fri May 27 21:11:27 2022 +0200 tdf#145178 Formats in section Foot/Endnotes not read from saved files Imported, 'num-suffix' & 'num-format' properties generate debug warnings: warn:xmloff:10220:10220:xmloff/source/text/ XMLSectionFootnoteConfigImport.cxx:123: unknown attribute urn:oasis :names:tc:opendocument:xmlns:style:1.0 style:num-suffix value=]] warn:xmloff:10220:10220:xmloff/source/text/ XMLSectionFootnoteConfigImport.cxx:123: unknown attribute urn:oasis :names:tc:opendocument:xmlns:style:1.0 style:num-format value=One The faulty code is within XMLSectionFootnoteConfigImport::startFastElement() The namespace for these two properties must be set to 'STYLE' (it is wrongly set to 'TEXT') Change-Id: I923f12e19ed15779c67b2159d88d80a2ccb04e17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133605 Reviewed-by: Michael Stahl Tested-by: Michael Stahl diff --git a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx index fcdbf2221b5a..ef408c0c13c8 100644 --- a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx +++ b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx @@ -101,13 +101,13 @@ void XMLSectionFootnoteConfigImport::startFastElement( bNumOwn = true; break; } -case XML_ELEMENT(TEXT, XML_NUM_SUFFIX): +case XML_ELEMENT(STYLE, XML_NUM_SUFFIX): { sNumSuffix = aIter.toString(); bNumOwn = true; break; } -case XML_ELEMENT(TEXT, XML_NUM_FORMAT): +case XML_ELEMENT(STYLE, XML_NUM_FORMAT): { sNumFormat = aIter.toString(); bNumOwn = true;
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/core/xmlexp.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 094b003268423a62cce9619a78caa82c59c7bbb8 Author: Noel Grandin AuthorDate: Fri May 13 11:10:12 2022 +0200 Commit: Noel Grandin CommitDate: Sat May 14 13:46:35 2022 +0200 elide some OUString construction in GetViewSettingsAndViews Change-Id: I4d0e6444e939731e9b109f961d36d9a2b8f00d9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134305 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index f8e72d6fb3f3..5235226ac81f 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1725,7 +1725,8 @@ void SvXMLExport::GetViewSettingsAndViews(uno::Sequence& r xViewDataSupplier->setViewData( xIndexAccess ); // make sure we get a newly created sequence { // tdf#130559: don't export preview view data if active -css::uno::ContextLayer layer(comphelper::NewFlagContext("NoPreviewData")); +static constexpr OUStringLiteral sNoPreviewData = u"NoPreviewData"; +css::uno::ContextLayer layer(comphelper::NewFlagContext(sNoPreviewData)); xIndexAccess = xViewDataSupplier->getViewData(); } bool bAdd = false;
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/core/xmlexp.cxx | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) New commits: commit 39acaf84f9b23442e1333db7d213100c6997ffe6 Author: Noel Grandin AuthorDate: Thu May 12 20:24:04 2022 +0200 Commit: Noel Grandin CommitDate: Sat May 14 08:40:00 2022 +0200 elide temporary OUString in SvXMLExport::initialize Change-Id: Ibf1b99042ccae1fcf5fb21ab7e60bb30a9ad74f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134275 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 7c2291156852..f8e72d6fb3f3 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -699,27 +699,26 @@ void SAL_CALL SvXMLExport::initialize( const uno::Sequence< uno::Any >& aArgumen uno::Reference< beans::XPropertySetInfo > xPropertySetInfo = mxExportInfo->getPropertySetInfo(); -OUString sPropName( -"BaseURI" ); -if( xPropertySetInfo->hasPropertyByName(sPropName) ) +static constexpr OUStringLiteral sBaseURI = u"BaseURI"; +if( xPropertySetInfo->hasPropertyByName(sBaseURI) ) { -uno::Any aAny = mxExportInfo->getPropertyValue(sPropName); +uno::Any aAny = mxExportInfo->getPropertyValue(sBaseURI); aAny >>= msOrigFileName; mpImpl->msPackageURI = msOrigFileName; mpImpl->SetSchemeOf( msOrigFileName ); } OUString sRelPath; -sPropName = "StreamRelPath"; -if( xPropertySetInfo->hasPropertyByName(sPropName) ) +static constexpr OUStringLiteral sStreamRelPath = u"StreamRelPath"; +if( xPropertySetInfo->hasPropertyByName(sStreamRelPath) ) { -uno::Any aAny = mxExportInfo->getPropertyValue(sPropName); +uno::Any aAny = mxExportInfo->getPropertyValue(sStreamRelPath); aAny >>= sRelPath; } OUString sName; -sPropName = "StreamName"; -if( xPropertySetInfo->hasPropertyByName(sPropName) ) +static constexpr OUStringLiteral sStreamName = u"StreamName"; +if( xPropertySetInfo->hasPropertyByName(sStreamName) ) { -uno::Any aAny = mxExportInfo->getPropertyValue(sPropName); +uno::Any aAny = mxExportInfo->getPropertyValue(sStreamName); aAny >>= sName; } if( !msOrigFileName.isEmpty() && !sName.isEmpty() )
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/core/namespacemap.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 09e0cfd9b3e391435c39d3bc933d26a87e2b082e Author: Noel Grandin AuthorDate: Wed May 11 19:14:59 2022 +0200 Commit: Noel Grandin CommitDate: Fri May 13 08:41:45 2022 +0200 reserve space in map in SvXMLNamespaceMap Change-Id: I0c46a9869d17cde75263277d2b17f0c980f14c78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134223 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/core/namespacemap.cxx b/xmloff/source/core/namespacemap.cxx index e6e2a68a84c9..9fdce6e3cc16 100644 --- a/xmloff/source/core/namespacemap.cxx +++ b/xmloff/source/core/namespacemap.cxx @@ -52,6 +52,9 @@ const OUString sEmpty; SvXMLNamespaceMap::SvXMLNamespaceMap() : sXMLNS( GetXMLToken ( XML_XMLNS ) ) { +// approx worst-case size +aNameHash.reserve(20); +aNameMap.reserve(20); } SvXMLNamespaceMap::SvXMLNamespaceMap( const SvXMLNamespaceMap& rMap )
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/shapeexport.cxx | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) New commits: commit fd4410aa5fd079e4277297f1fb70ad8c728e7a17 Author: Julien Nabet AuthorDate: Thu Apr 21 18:06:57 2022 +0200 Commit: Julien Nabet CommitDate: Mon Apr 25 18:30:26 2022 +0200 tdf#145240: Can't save drawing if I'm adding a short freeform line with no fill Here are the steps of the dup tdf#148693: 1. Open a new sheet in LibreOffice Draw 2. Select the tool Shape/Insert/Curves and Polygons 3. Draw a short line (I mean very short) 4. Click "File" > "Save" and select a random place to save => 1 0x7fcd3c774fcb in o3tl::doAccess(com::sun::star::uno::Any const&) (any= uno::Any("[][]com.sun.star.awt.Point": uno::Sequence of length 1 = {uno::Sequence of length 2 = {{X = 0, Y = 0}, {X = 252, Y = 0}}})) at include/o3tl/any.hxx:284 2 0x7fcd3c74f759 in XMLShapeExport::ImpExportPolygonShape(com::sun::star::uno::Reference const&, XmlShapeType, XMLShapeExportFlags, com::sun::star::awt::Point*) (this=0x8770560, xShape=uno::Reference to (SvxShapePolyPolygon *) 0x7bcb3a8, eShapeType=XmlShapeTypeDrawOpenBezierShape, nFeatures=15, pRefPoint=0x0) at xmloff/source/draw/shapeexport.cxx:2342 3 0x7fcd3c74d952 in XMLShapeExport::exportShape(com::sun::star::uno::Reference const&, XMLShapeExportFlags, com::sun::star::awt::Point*, SvXMLAttributeList*) (this=0x8770560, xShape=uno::Reference to (SvxShapePolyPolygon *) 0x7bcb3a8, nFeatures=15, pRefPoint=0x0, pAttrList=0x0) at xmloff/source/draw/shapeexport.cxx:811 4 0x7fcd3c75cca1 in XMLShapeExport::exportShapes(com::sun::star::uno::Reference const&, XMLShapeExportFlags, com::sun::star::awt::Point*) (this=0x8770560, xShapes=uno::Reference to (SdDrawPage *) 0x2d6b258, nFeatures=15, pRefPoint=0x0) at xmloff/source/draw/shapeexport.cxx:1006 Change-Id: Ie6d626999bf606f951f4f79a7c314559a9a886f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133273 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 55de243f07aa..9b069a07eb2c 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2338,11 +2338,13 @@ void XMLShapeExport::ImpExportPolygonShape( { // get PolygonBezier uno::Any aAny( xPropSet->getPropertyValue("Geometry") ); -const basegfx::B2DPolyPolygon aPolyPolygon( - basegfx::utils::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(*o3tl::doAccess(aAny))); - -if(aPolyPolygon.count()) +auto pSourcePolyPolygon = o3tl::tryAccess(aAny); +if(pSourcePolyPolygon && pSourcePolyPolygon->Coordinates.getLength()) { +const basegfx::B2DPolyPolygon aPolyPolygon( +basegfx::utils::UnoPolyPolygonBezierCoordsToB2DPolyPolygon( +*pSourcePolyPolygon)); + // complex polygon shape, write as svg:d const OUString aPolygonString( basegfx::utils::exportToSvgD(
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/XMLTextShapeImportHelper.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit b812150696c574aea0a173d11f178e8d458b1a3e Author: Michael Stahl AuthorDate: Mon Apr 4 20:29:07 2022 +0200 Commit: Michael Stahl CommitDate: Mon Apr 4 20:30:18 2022 +0200 oops, forgot to fix the comment Change-Id: Ib9281395087c8b21c2693a233d77236f9353e9c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132529 Tested-by: Michael Stahl Reviewed-by: Michael Stahl diff --git a/xmloff/source/text/XMLTextShapeImportHelper.cxx b/xmloff/source/text/XMLTextShapeImportHelper.cxx index 1c567b689632..f4a62f4ad9b7 100644 --- a/xmloff/source/text/XMLTextShapeImportHelper.cxx +++ b/xmloff/source/text/XMLTextShapeImportHelper.cxx @@ -119,8 +119,7 @@ void XMLTextShapeImportHelper::addShape( // anchor type xPropSet->setPropertyValue( gsAnchorType, Any(eAnchorType) ); -// page number (must be set after the frame is inserted, because it -// will be overwritten then inserting the frame. +// page number must be set before the frame is inserted switch( eAnchorType ) { case TextContentAnchorType_AT_PAGE:
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/style/GradientStyle.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit fc42d1159f390a99d886ea0f82d268613ac22e2f Author: Caolán McNamara AuthorDate: Tue Mar 15 13:52:30 2022 + Commit: Caolán McNamara CommitDate: Tue Mar 15 16:39:31 2022 +0100 ofz: Use-of-uninitialized-value Change-Id: I742132da8fab7168495c7756aaffb1742a1bd973 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131613 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx index 7626db9db8ce..f3fbfb01ec24 100644 --- a/xmloff/source/style/GradientStyle.cxx +++ b/xmloff/source/style/GradientStyle.cxx @@ -78,7 +78,7 @@ void XMLGradientStyleImport::importXML( for (auto : sax_fastparser::castToFastAttributeList( xAttrList )) { -sal_Int32 nTmpValue; +sal_Int32 nTmpValue(0); switch( aIter.getToken() ) {
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/core/xmlimp.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 9aae749e99a92e6622fe18539e186e5cb07fa721 Author: Julien Nabet AuthorDate: Mon Mar 14 20:25:42 2022 +0100 Commit: Julien Nabet CommitDate: Mon Mar 14 21:48:09 2022 +0100 Return early if empty ref (xmloff/xmlimp) + fix a comment, the function uses "bool" not old "sal_Bool" Change-Id: I777dc93450a56eb826d15691d56c23cb051a4afb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131561 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 9c68c2be6da1..a710e87b3bb7 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -1627,7 +1627,7 @@ OUString SvXMLImport::GetAbsoluteReference(const OUString& rValue) const bool SvXMLImport::IsODFVersionConsistent( const OUString& aODFVersion ) { -// the check returns sal_False only if the storage version could be retrieved +// the check returns false only if the storage version could be retrieved bool bResult = true; if ( !aODFVersion.isEmpty() && aODFVersion.compareTo( ODFVER_012_TEXT ) >= 0 ) @@ -1637,6 +1637,8 @@ bool SvXMLImport::IsODFVersionConsistent( const OUString& aODFVersion ) try { // don't use getDocumentStorage(), it's temporary and latest version uno::Reference const xStor(GetSourceStorage()); +if (!xStor.is()) +return bResult; uno::Reference< beans::XPropertySet > xStorProps( xStor, uno::UNO_QUERY_THROW ); // the check should be done only for OASIS format
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/style/GradientStyle.cxx |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit e4bc01d9f57d47d943ff1910e42abda3d9033f46 Author: Caolán McNamara AuthorDate: Sun Mar 13 10:38:28 2022 + Commit: Caolán McNamara CommitDate: Sun Mar 13 13:04:06 2022 +0100 ofz: Use-of-uninitialized-value Change-Id: I6239ebb640bf248d226979ed17de92930898f9ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131464 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx index 17c058727679..7626db9db8ce 100644 --- a/xmloff/source/style/GradientStyle.cxx +++ b/xmloff/source/style/GradientStyle.cxx @@ -65,12 +65,16 @@ void XMLGradientStyleImport::importXML( OUString aDisplayName; awt::Gradient aGradient; +aGradient.Style = css::awt::GradientStyle_LINEAR; +aGradient.StartColor = 0; +aGradient.EndColor = 0; +aGradient.Angle = 0; +aGradient.Border = 0; aGradient.XOffset = 0; aGradient.YOffset = 0; aGradient.StartIntensity = 100; aGradient.EndIntensity = 100; -aGradient.Angle = 0; -aGradient.Border = 0; +aGradient.StepCount = 0; for (auto : sax_fastparser::castToFastAttributeList( xAttrList )) {
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/core/namespacemap.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 20b301efef0fce7c92b9fac9e62d38cbfe10529f Author: Caolán McNamara AuthorDate: Fri Feb 25 21:41:05 2022 + Commit: Caolán McNamara CommitDate: Sat Feb 26 13:30:01 2022 +0100 cid#1500663 std::move a sal_uInt16 and then return the original is unorthodox Change-Id: I7d3dcc6f6e625baab702ea16cd72ec85d213f8eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130546 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/xmloff/source/core/namespacemap.cxx b/xmloff/source/core/namespacemap.cxx index 2a0ca441d05a..4d5ec0d503da 100644 --- a/xmloff/source/core/namespacemap.cxx +++ b/xmloff/source/core/namespacemap.cxx @@ -350,7 +350,7 @@ sal_uInt16 SvXMLNamespaceMap::GetKeyByQName(const OUString& rQName, rtl::Reference xEntry(new NameSpaceEntry); xEntry->sPrefix = std::move(sEntryPrefix); xEntry->sName = std::move(sEntryName); -xEntry->nKey = std::move(nKey); +xEntry->nKey = nKey; aNameCache.emplace(rQName, std::move(xEntry)); } }
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/transform/PropertyActionsOOo.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit e262770bf55e9ef6023cddefbfa5607bc744a2c4 Author: Andrea Gelmini AuthorDate: Tue Feb 1 14:46:50 2022 +0100 Commit: Julien Nabet CommitDate: Wed Feb 2 18:35:48 2022 +0100 Fix variable name It's just a comment, but so it is the same as in PropertyActionsOASIS.cxx Change-Id: I43b2b3c51f5e2e23dc273e1cf65ad7c5608b9366 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129311 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/xmloff/source/transform/PropertyActionsOOo.cxx b/xmloff/source/transform/PropertyActionsOOo.cxx index dbee8983f250..cc6fc0e6b6f9 100644 --- a/xmloff/source/transform/PropertyActionsOOo.cxx +++ b/xmloff/source/transform/PropertyActionsOOo.cxx @@ -276,7 +276,7 @@ XMLTransformerActionInit const aGraphicPropertyOOoAttrActionTable[] = NO_PARAMS }, /* generated entry */ { XML_NAMESPACE_STYLE, XML_WRAP, XML_ATACTION_COPY, NO_PARAMS }, /* generated entry */ -// { XML_NAMESPACE_STYLE, XML_WRAP_DYNAMIC_TRESHOLD, XML_ATACTION_COPY, +// { XML_NAMESPACE_STYLE, XML_WRAP_DYNAMIC_THRESHOLD, XML_ATACTION_COPY, // NO_PARAMS }, /* new attribute */ { XML_NAMESPACE_STYLE, XML_NUMBER_WRAPPED_PARAGRAPHS, XML_ATACTION_COPY, NO_PARAMS }, /* generated entry */
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/txtparai.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit dba8853271b1ee52c294c2401a5c8d98cc52cdc3 Author: Andrea Gelmini AuthorDate: Tue Jan 4 18:58:50 2022 +0100 Commit: Julien Nabet CommitDate: Wed Jan 5 19:11:20 2022 +0100 Fix typos Change-Id: Ie05c44dd3b85f1fd6c592a8cf5482d5954d7a354 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127971 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index 504c32b90f57..20f2b5c6388e 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -1182,7 +1182,7 @@ void XMLTOCMarkImportContext_Impl::ProcessAttribute( { case XML_ELEMENT(TEXT, XML_OUTLINE_LEVEL): { -// ouline level: set Level property +// outline level: set Level property sal_Int32 nTmp; if (::sax::Converter::convertNumber( nTmp, aIter.toView() ) && nTmp >= 1 @@ -1239,7 +1239,7 @@ void XMLUserIndexMarkImportContext_Impl::ProcessAttribute( break; case XML_ELEMENT(TEXT, XML_OUTLINE_LEVEL): { -// ouline level: set Level property +// outline level: set Level property sal_Int32 nTmp; if (::sax::Converter::convertNumber( nTmp, aIter.toView(), 0,
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/shapeimport.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 45ca7938dbc146ffa39e1e759e20d8e0b60a3c85 Author: Noel Grandin AuthorDate: Tue Dec 21 08:42:21 2021 +0200 Commit: Noel Grandin CommitDate: Tue Dec 21 09:38:12 2021 +0100 SAL_WARN->SAL_INFO this method is often speculatively called, so the warnings here are not that useful Change-Id: Idc9460b365dac955d1ced4c1bc2c9d2f49fbe540 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127209 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index 76ac0075c564..bfbcf180feab 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -419,7 +419,7 @@ SvXMLShapeContext* XMLShapeImportHelper::CreateFrameChildContext( } // add other shapes here... default: -XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement); +SAL_INFO("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement)); break; } @@ -429,7 +429,7 @@ SvXMLShapeContext* XMLShapeImportHelper::CreateFrameChildContext( for(auto& aIter : *xCombinedAttrList) { if (!pContext->processAttribute( aIter )) -XMLOFF_WARN_UNKNOWN("xmloff", aIter); +SAL_INFO("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " value=" << aIter.toString()); } }
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/chart/SchXMLTableContext.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit e5594e656d7d7958015cfe0bdbcd42ecd5a9c9c3 Author: Noel Grandin AuthorDate: Tue Dec 21 09:00:31 2021 +0200 Commit: Noel Grandin CommitDate: Tue Dec 21 09:18:16 2021 +0100 also handle SVG_COMPAT namespace here Noticed an "unknown element" message while doing some unrelated debugging Change-Id: I1c6d4c9cddb340d892ba63d6d209bf8f72e2203d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127210 Tested-by: Noel Grandin Reviewed-by: Noel Grandin diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index 51c56b545a8d..ac8a9f3e3f51 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -1028,7 +1028,8 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SchXMLRangeSomewhereCo sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) { -if( nElement == XML_ELEMENT(SVG, XML_DESC) ) +if( nElement == XML_ELEMENT(SVG, XML_DESC) +|| nElement == XML_ELEMENT(SVG_COMPAT, XML_DESC) ) { return new XMLStringBufferImportContext( GetImport(), maRangeStringBuffer ); }
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/text/txtparai.cxx | 12 +- xmloff/source/text/txtparaimphint.hxx | 40 ++ 2 files changed, 28 insertions(+), 24 deletions(-) New commits: commit 47503fce3ebc0874534175c0d9ea40d3a5bbffde Author: Pesi Taototo AuthorDate: Sun Dec 5 22:34:33 2021 -0800 Commit: Hossein CommitDate: Tue Dec 7 16:25:47 2021 +0100 tdf#145614 Convert #define to 'enum class' Change-Id: I991cd44b13465e63c5adc1aed3cfbc038847c0f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126396 Tested-by: Hossein Reviewed-by: Hossein diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index ac05986ffe6a..5cee4085e693 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -1851,7 +1851,7 @@ void XMLParaContext::endFastElement(sal_Int32 ) xAttrCursor->gotoRange( pHint->GetEnd(), true ); switch( pHint->GetType() ) { -case XML_HINT_STYLE: +case XMLHintType::XML_HINT_STYLE: { const OUString& rStyleName = static_cast(pHint)->GetStyleName(); @@ -1861,7 +1861,7 @@ void XMLParaContext::endFastElement(sal_Int32 ) false ); } break; -case XML_HINT_REFERENCE: +case XMLHintType::XML_HINT_REFERENCE: { const OUString& rRefName = static_cast(pHint)->GetRefName(); @@ -1880,7 +1880,7 @@ void XMLParaContext::endFastElement(sal_Int32 ) } } break; -case XML_HINT_HYPERLINK: +case XMLHintType::XML_HINT_HYPERLINK: { const XMLHyperlinkHint_Impl *pHHint = static_cast(pHint); @@ -1894,7 +1894,7 @@ void XMLParaContext::endFastElement(sal_Int32 ) pHHint->GetEventsContext() ); } break; -case XML_HINT_INDEX_MARK: +case XMLHintType::XML_HINT_INDEX_MARK: { Reference xMark( static_cast(pHint)->GetMark()); @@ -1910,7 +1910,7 @@ void XMLParaContext::endFastElement(sal_Int32 ) } } break; -case XML_HINT_TEXT_FRAME: +case XMLHintType::XML_HINT_TEXT_FRAME: { const XMLTextFrameHint_Impl *pFHint = static_cast(pHint); @@ -1955,7 +1955,7 @@ void XMLParaContext::endFastElement(sal_Int32 ) /* Core impl. of the unification of drawing objects and Writer fly frames (#i26791#) */ -case XML_HINT_DRAW: +case XMLHintType::XML_HINT_DRAW: { const XMLDrawHint_Impl *pDHint = static_cast(pHint); diff --git a/xmloff/source/text/txtparaimphint.hxx b/xmloff/source/text/txtparaimphint.hxx index 63cc49cfa67e..f60b87be5984 100644 --- a/xmloff/source/text/txtparaimphint.hxx +++ b/xmloff/source/text/txtparaimphint.hxx @@ -23,24 +23,28 @@ #include "XMLTextFrameHyperlinkContext.hxx" #include -#define XML_HINT_STYLE 1 -#define XML_HINT_REFERENCE 2 -#define XML_HINT_HYPERLINK 3 -#define XML_HINT_INDEX_MARK 5 -#define XML_HINT_TEXT_FRAME 6 -// Core impl. of the unification of drawing objects and Writer fly frames (#i26791#) -#define XML_HINT_DRAW 7 +enum class XMLHintType +{ +XML_HINT_STYLE = 1, +XML_HINT_REFERENCE = 2, +XML_HINT_HYPERLINK = 3, +// There is no 4 defined here +XML_HINT_INDEX_MARK = 5, +XML_HINT_TEXT_FRAME = 6, +// Core impl. of the unification of drawing objects and Writer fly frames (#i26791#) +XML_HINT_DRAW = 7 +}; class XMLHint_Impl { css::uno::Reference < css::text::XTextRange > xStart; css::uno::Reference < css::text::XTextRange > xEnd; -sal_uInt8 nType; +XMLHintType nType; public: -XMLHint_Impl( sal_uInt8 nTyp, +XMLHint_Impl( XMLHintType nTyp, const css::uno::Reference < css::text::XTextRange > & rS, const css::uno::Reference < css::text::XTextRange > & rE ) : xStart( rS ), @@ -57,8 +61,8 @@ public: // We don't use virtual methods to differ between the sub classes, // because this seems to be too expensive if compared to inline methods. -sal_uInt8 GetType() const { return nType; } -bool IsReference() const { return XML_HINT_REFERENCE==nType; } +XMLHintType GetType() const { return nType; } +bool IsReference() const { return XMLHintType::XML_HINT_REFERENCE==nType; } }; class XMLStyleHint_Impl : public XMLHint_Impl @@ -69,7 +73,7 @@ public: XMLStyleHint_Impl( const OUString& rStyleName,
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/chart/PropertyMap.hxx | 299 -- xmloff/source/chart/PropertyMaps.cxx | 300 ++- 2 files changed, 294 insertions(+), 305 deletions(-) New commits: commit 8c45639a19b277eaaeb1be3798574f91aac5b022 Author: Noel Grandin AuthorDate: Mon Nov 15 09:05:46 2021 +0200 Commit: Noel Grandin CommitDate: Mon Nov 15 10:08:14 2021 +0100 move xmloff chart tables into cxx file instead of playing games with #define Change-Id: I3f15745b5e107b1e83b97a905cc05fc57f8369bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125213 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx index 60d414bad5c8..f9a3dc4e3b8e 100644 --- a/xmloff/source/chart/PropertyMap.hxx +++ b/xmloff/source/chart/PropertyMap.hxx @@ -85,304 +85,5 @@ #define XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_SERIES ( XML_SCH_CTF_START + 27 ) #define XML_SCH_CONTEXT_SPECIAL_MOVING_AVERAGE_TYPE ( XML_SCH_CTF_START + 28 ) -#define MAP_FULL( ApiName, NameSpace, XMLTokenName, XMLType, ContextId, EarliestODFVersionForExport ) { ApiName, XML_NAMESPACE_##NameSpace, xmloff::token::XMLTokenName, XMLType|XML_TYPE_PROP_CHART, ContextId, EarliestODFVersionForExport, false } -#define MAP_ENTRY( a, ns, nm, t ){ a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_010, false } -#define MAP_ENTRY_ODF12( a, ns, nm, t ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_012, false } -#define MAP_ENTRY_ODF13( a, ns, nm, t ) { a, ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_013, false } -#define MAP_ENTRY_ODF_EXT( a, ns, nm, t ){ a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED, false } -#define MAP_ENTRY_ODF_EXT_IMPORT( a, ns, nm, t ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED, true } -#define MAP_CONTEXT( a, ns, nm, t, c ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, c, SvtSaveOptions::ODFSVER_010, false } -#define MAP_SPECIAL( a, ns, nm, t, c ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFSVER_010, false } -#define MAP_SPECIAL_ODF12( a, ns, nm, t, c ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFSVER_012, false } -#define MAP_SPECIAL_ODF13( a, ns, nm, t, c ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFSVER_013, false } -#define MAP_ENTRY_END { nullptr,0,xmloff::token::XML_TOKEN_INVALID,0,0,SvtSaveOptions::ODFSVER_010, false } - -// PropertyMap for Chart properties drawing- and -// textproperties are added later using the chaining -// mechanism - -// only create maps once! -// this define is set in PropertyMaps.cxx - -#ifdef XML_SCH_CREATE_GLOBAL_MAPS - -const XMLPropertyMapEntry aXMLChartPropMap[] = -{ -// chart subtypes -MAP_ENTRY( "UpDown", CHART, XML_JAPANESE_CANDLE_STICK, XML_TYPE_BOOL ), // formerly XML_STOCK_UPDOWN_BARS -MAP_CONTEXT( "Volume", CHART, XML_STOCK_WITH_VOLUME, XML_TYPE_BOOL, XML_SCH_CONTEXT_STOCK_WITH_VOLUME ), -MAP_ENTRY( "Dim3D", CHART, XML_THREE_DIMENSIONAL, XML_TYPE_BOOL ), -MAP_ENTRY( "Deep", CHART, XML_DEEP, XML_TYPE_BOOL ), -MAP_ENTRY( "Lines", CHART, XML_LINES, XML_TYPE_BOOL ), -MAP_ENTRY( "Percent", CHART, XML_PERCENTAGE, XML_TYPE_BOOL ), -MAP_ENTRY( "SolidType", CHART, XML_SOLID_TYPE, XML_SCH_TYPE_SOLID_TYPE ), -// ODF 1.3 OFFICE-3662 added values -MAP_ENTRY( "SplineType", CHART, XML_INTERPOLATION, XML_SCH_TYPE_INTERPOLATION ), -MAP_ENTRY( "Stacked", CHART, XML_STACKED, XML_TYPE_BOOL ), -// type: "none", "automatic", "named-symbol" or "image" -MAP_ENTRY( "SymbolType", CHART, XML_SYMBOL_TYPE, XML_SCH_TYPE_SYMBOL_TYPE | MID_FLAG_MULTI_PROPERTY ), -// if type=="named-symbol" => name of symbol (square, diamond, ...) -MAP_ENTRY( "SymbolType", CHART, XML_SYMBOL_NAME, XML_SCH_TYPE_NAMED_SYMBOL | MID_FLAG_MULTI_PROPERTY ), -// if type=="image" => an xlink:href element with a linked (package) URI -MAP_SPECIAL( "SymbolBitmap", CHART, XML_SYMBOL_IMAGE, XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE ), -MAP_SPECIAL( "SymbolSize", CHART, XML_SYMBOL_WIDTH, XML_TYPE_MEASURE | MID_FLAG_MERGE_PROPERTY, XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH ), -MAP_SPECIAL( "SymbolSize", CHART, XML_SYMBOL_HEIGHT, XML_TYPE_MEASURE | MID_FLAG_MERGE_PROPERTY, XML_SCH_CONTEXT_SPECIAL_SYMBOL_HEIGHT ), -MAP_ENTRY( "Vertical", CHART, XML_VERTICAL, XML_TYPE_BOOL ), -// #i32368# property should no longer be used as XML-property (in OASIS -// format), but
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/style/PageMasterImportPropMapper.cxx | 134 +++-- 1 file changed, 71 insertions(+), 63 deletions(-) New commits: commit b0e574a8be2a080f5039e968f4f32ce4b8fa2b26 Author: Tomaž Vajngerl AuthorDate: Fri Oct 29 17:23:02 2021 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Nov 2 19:35:49 2021 +0100 xmloff: Prevent gutter margin xml property to be deallocated Previously we stored a pointer to the gutter margin XMLPropertyState so we could read it later. The problem with this is that in between when we storing and reading the property state, we add elements to the rProperties vector, where the XML properties are allocated. Adding new elements to the vector can cause that the internal array is reallocated to a bigger size and elements copied to the new array, so our pointer shows to a invalid (deallocated) memory address. This issue is fixed by moving the code up to before we add new elements to rProperties vector and a big warning is written to not use XMLPropertyState* pointers after the code adds to the rProperties vector. Change-Id: I24b0285d49e678fcb3b333bf4054f5cef4207003 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124572 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/xmloff/source/style/PageMasterImportPropMapper.cxx b/xmloff/source/style/PageMasterImportPropMapper.cxx index b9850eaec618..8ee711804333 100644 --- a/xmloff/source/style/PageMasterImportPropMapper.cxx +++ b/xmloff/source/style/PageMasterImportPropMapper.cxx @@ -390,6 +390,74 @@ void PageMasterImportPropertyMapper::finished(std::vector< XMLPropertyState >& r pAllFooterMarginProperty->mnIndex = -1; } +if (pMarginGutter) +{ +sal_Int32 nGutterMargin{}; +pMarginGutter->maValue >>= nGutterMargin; + +bool bGutterAtTop{}; +uno::Reference xSI(GetImport().GetModel(), uno::UNO_QUERY); +if (xSI.is() && xSI->supportsService("com.sun.star.text.TextDocument")) +{ +uno::Reference xFac(GetImport().GetModel(), uno::UNO_QUERY); +if (xFac.is()) +{ +uno::Reference xProps( +xFac->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY); +if (xProps.is()) +{ +xProps->getPropertyValue("GutterAtTop") >>= bGutterAtTop; +} +} +} +if (bGutterAtTop) +{ +if (nGutterMargin && pMargins[XML_LINE_TOP]) +{ +// Decrease top margin to not include gutter. +sal_Int32 nTopMargin{}; +pMargins[XML_LINE_TOP]->maValue >>= nTopMargin; +nTopMargin -= nGutterMargin; +pMargins[XML_LINE_TOP]->maValue <<= nTopMargin; +} +} +else +{ +bool bRtlGutter{}; +if (nGutterMargin && pRtlGutter) +{ +pRtlGutter->maValue >>= bRtlGutter; +} +if (bRtlGutter) +{ +if (nGutterMargin && pMargins[XML_LINE_RIGHT]) +{ +// Decrease right margin to not include gutter. +sal_Int32 nRightMargin{}; +pMargins[XML_LINE_RIGHT]->maValue >>= nRightMargin; +nRightMargin -= nGutterMargin; +pMargins[XML_LINE_RIGHT]->maValue <<= nRightMargin; +} +} +else +{ +if (nGutterMargin && pMargins[XML_LINE_LEFT]) +{ +// Decrease left margin to not include gutter. +sal_Int32 nLeftMargin{}; +pMargins[XML_LINE_LEFT]->maValue >>= nLeftMargin; +nLeftMargin -= nGutterMargin; +pMargins[XML_LINE_LEFT]->maValue <<= nLeftMargin; +} +} +} +} + +// CAUTION! +// The following code adds into the rProperties vector, so all the +// XMLPropertyState* pointers that are pointing to the rProperties +// elements could potentially be deallocated, so don't use them after +// this! for (sal_uInt16 i = 0; i < 4; i++) { if (pNewMargins[i]) @@ -435,6 +503,9 @@ void PageMasterImportPropertyMapper::finished(std::vector< XMLPropertyState >& r delete pFooterNewBorders[i]; } } +// CAUTION - do not use XMLPropertyState* pointers (like pMargins, +// pMarginGutter) after this. + if(xHeaderDynamic) { rProperties.push_back(*xHeaderDynamic); @@ -446,68 +517,5 @@ void PageMasterImportPropertyMapper::finished(std::vector< XMLPropertyState >& r xFooterDynamic.reset(); } -if (!pMarginGutter) -return; - -sal_Int32 nGutterMargin{}; -pMarginGutter->maValue >>= nGutterMargin;
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/chart/MultiPropertySetHandler.hxx |3 xmloff/source/chart/SchXMLChartContext.cxx | 47 --- xmloff/source/chart/SchXMLExport.cxx| 22 --- xmloff/source/chart/SchXMLImport.cxx|5 - xmloff/source/chart/SchXMLPlotAreaContext.cxx |2 xmloff/source/chart/SchXMLPropertyMappingContext.cxx|2 xmloff/source/chart/SchXMLSeries2Context.cxx|8 +- xmloff/source/chart/SchXMLTableContext.cxx | 28 + xmloff/source/chart/SchXMLTextListContext.cxx |3 xmloff/source/core/DocumentSettingsContext.cxx |5 - xmloff/source/core/xmlexp.cxx | 16 + xmloff/source/draw/sdxmlexp.cxx |6 - xmloff/source/draw/shapeexport.cxx | 22 +++ xmloff/source/draw/shapeimport.cxx |5 - xmloff/source/draw/ximpshap.cxx | 49 xmloff/source/forms/eventexport.cxx | 14 ++-- xmloff/source/forms/formcellbinding.cxx |4 - xmloff/source/forms/gridcolumnproptranslator.cxx| 10 +-- xmloff/source/meta/MetaExportComponent.cxx |6 - xmloff/source/meta/xmlversion.cxx |2 xmloff/source/script/xmlscripti.cxx |5 - xmloff/source/text/XMLAutoTextEventExport.cxx |3 xmloff/source/text/XMLIndexBibliographyEntryContext.cxx |5 - xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx |9 +- xmloff/source/text/XMLIndexSimpleEntryContext.cxx |9 +- xmloff/source/text/XMLIndexSpanEntryContext.cxx |5 - xmloff/source/text/XMLIndexTOCStylesContext.cxx |3 xmloff/source/text/XMLIndexTemplateContext.cxx |6 - xmloff/source/text/txtfldi.cxx |3 xmloff/source/text/txtimp.cxx |5 - xmloff/source/transform/OOo2Oasis.cxx |5 - xmloff/source/xforms/xformsexport.cxx | 11 +-- 32 files changed, 171 insertions(+), 157 deletions(-) New commits: commit 8cb57be792e6991c38cf5d4434569dc118dd0ed4 Author: Mike Kaganski AuthorDate: Fri Oct 29 10:28:28 2021 +0300 Commit: Mike Kaganski CommitDate: Mon Nov 1 07:11:36 2021 +0100 Prepare for removal of non-const operator[] from Sequence in xmloff Change-Id: I7ea7964f76f0a5db678510ac3533003726dc49fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124416 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/xmloff/source/chart/MultiPropertySetHandler.hxx b/xmloff/source/chart/MultiPropertySetHandler.hxx index 178fb3e1adf6..d742faf50463 100644 --- a/xmloff/source/chart/MultiPropertySetHandler.hxx +++ b/xmloff/source/chart/MultiPropertySetHandler.hxx @@ -185,9 +185,10 @@ MultiPropertySetHandler::MultiPropertySetHandler (css::uno::Reference< boolMultiPropertySetHandler::GetProperties() { css::uno::Sequence< OUString> aNameList (aPropertyList.size()); +auto aNameListRange = asNonConstRange(aNameList); int i = 0; for (const auto& rProperty : aPropertyList) -aNameList[i++] = rProperty.second->msName; +aNameListRange[i++] = rProperty.second->msName; if ( ! MultiGet(aNameList)) if ( ! SingleGet(aNameList)) return false; diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index d8a91ff49659..51a7e1f05d93 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -98,7 +98,7 @@ void lcl_MoveDataToCandleStickSeries( // @todo: realloc only once outside this function uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aData( xSource->getDataSequences()); aData.realloc( aData.getLength() + 1); -aData[ aData.getLength() - 1 ] = aLabeledSeq[0]; +aData.getArray()[ aData.getLength() - 1 ] = aLabeledSeq[0]; uno::Reference< chart2::data::XDataSink > xSink( xDestination, uno::UNO_QUERY_THROW ); xSink->setData( aData ); } @@ -206,9 +206,9 @@ uno::Sequence< sal_Int32 > lcl_getNumberSequenceFromString( const OUString& rStr else if( bAddOneToEachOldIndex ) { aSeq.realloc( nVecSize+1 ); -aSeq[0]=0; +auto pSeqArr = aSeq.getArray(); +pSeqArr[0]=0; -sal_Int32* pSeqArr = aSeq.getArray(); for( nPos = 0; nPos < nVecSize; ++nPos ) { pSeqArr[ nPos+1 ] = aVec[ nPos ]+1; @@ -641,24 +641,25 @@ static void lcl_ApplyDataFromRectangularRangeToDiagram( bHasCateories = true; } -uno::Sequence< beans::PropertyValue > aArgs( 3 ); -aArgs[0] = beans::PropertyValue( -"CellRangeRepresentation", --1, uno::makeAny(
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/shapeexport.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit cf158b801a8d23538e339e3e1b9b571e8f1575d7 Author: Andrea Gelmini AuthorDate: Fri Oct 29 14:28:00 2021 +0200 Commit: Julien Nabet CommitDate: Fri Oct 29 16:34:50 2021 +0200 Fix typo Change-Id: I06cb364b31274d36a712f43db258a2421995388a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124434 Reviewed-by: Adolfo Jayme Barrientos Tested-by: Julien Nabet diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index dbd52fadd1d1..ae5dbf041d1e 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -4588,7 +4588,7 @@ static void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Referenc // tdf#141301: no specific skew values provided if (!bSkewValuesProvided) { -// so we need to export default values explicitely +// so we need to export default values explicitly rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_SKEW, "50 -135"); } }
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/style/chrlohdl.cxx | 58 +-- 1 file changed, 56 insertions(+), 2 deletions(-) New commits: commit cb56ec6aa8f03fbc70c808bd4f519ce9d3c21f7d Author: Eike Rathke AuthorDate: Fri Oct 22 01:56:46 2021 +0200 Commit: Eike Rathke CommitDate: Fri Oct 22 04:02:12 2021 +0200 Resolves: tdf#92015 Handle malused *:rfc-language-tag ODF violation ... and don't let it overwrite existing fo:* tags with less information. Change-Id: I63c223f6bccd682e4173449ddc76c36e8fac6c35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124042 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/xmloff/source/style/chrlohdl.cxx b/xmloff/source/style/chrlohdl.cxx index 4b6b1aebbf1d..05dd6d770e5a 100644 --- a/xmloff/source/style/chrlohdl.cxx +++ b/xmloff/source/style/chrlohdl.cxx @@ -339,8 +339,62 @@ bool XMLCharRfcLanguageTagHdl::importXML( const OUString& rStrImpValue, uno::Any if( !IsXMLToken( rStrImpValue, XML_NONE ) ) { -aLocale.Variant = rStrImpValue; -aLocale.Language = I18NLANGTAG_QLT; +// Stored may be a *:rfc-language-tag in violation of ODF v1.3 +// 19.516 style:rfc-language-tag "It shall only be used if its value +// cannot be expressed as a valid combination of the fo:language +// 19.871, fo:script 19.242 and fo:country 19.234 attributes". +// That could override a more detailed fo:* and we also don't want an +// unjustified I18NLANGTAG_QLT extended locale tag, but fetch the +// values in case fo:* doesn't follow. +// Rule out the obvious. +if (rStrImpValue.getLength() < 7) +{ +SAL_WARN("xmloff.style","rfc-language-tag too short: {" << rStrImpValue << "} Set: " +<< aLocale.Language <<","<< aLocale.Country <<","<< aLocale.Variant); +// Ignore empty and keep Ssss or any earlier qlt already set. +if (!rStrImpValue.isEmpty() && aLocale.Language != I18NLANGTAG_QLT) +{ +// Shorter than ll-Ssss, so try ll-CC or lll-CC or ll or lll +sal_Int32 h = rStrImpValue.indexOf('-'); +OUString aLang; +if (2 <= h && h <= 3) +aLang = rStrImpValue.copy(0, h); +else if (h < 0 && 2 <= rStrImpValue.getLength() && rStrImpValue.getLength() <= 3) +aLang = rStrImpValue; +OUString aCoun; +if (!aLang.isEmpty() && aLang.getLength() + 3 == rStrImpValue.getLength()) +aCoun = rStrImpValue.copy( aLang.getLength() + 1); +// Ignore identical value or less information. +if ((!aLang.isEmpty() && aLang != aLocale.Language) || +(!aCoun.isEmpty() && aCoun != aLocale.Country)) +{ +// Do not override existing values. +if (aLocale.Language.isEmpty()) +aLocale.Language = aLang; +if (aLocale.Country.isEmpty()) +aLocale.Country = aCoun; +if (aLang != aLocale.Language || aCoun != aLocale.Country) +{ +// No match, so we still need the qlt anyway. Whatever.. +aLocale.Variant = rStrImpValue; +aLocale.Language = I18NLANGTAG_QLT; +} +} +else if (aLang.isEmpty() && aCoun.isEmpty()) +{ +// Both empty, some other tag. +aLocale.Variant = rStrImpValue; +aLocale.Language = I18NLANGTAG_QLT; +} +} +SAL_WARN("xmloff.style","rfc-language-tag too short: now set: " +<< aLocale.Language <<","<< aLocale.Country <<","<< aLocale.Variant); +} +else +{ +aLocale.Variant = rStrImpValue; +aLocale.Language = I18NLANGTAG_QLT; +} } rValue <<= aLocale;
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/script/XMLStarBasicContextFactory.cxx |4 1 file changed, 4 deletions(-) New commits: commit b7e7fee238dc250e7ab6e8e8fef4a6b15430c90c Author: Julien Nabet AuthorDate: Tue Oct 19 07:21:12 2021 +0200 Commit: Noel Grandin CommitDate: Tue Oct 19 09:27:11 2021 +0200 Leftover from 4477baeba5aec71098f374cf0b4bd4591e048809 ... Simplify Sequences in xmloff (+ merge 2 SetError) Thank you Mike for having spotted it! :-) Change-Id: I532520aff6999a30a8b41dc95ff5eeb1086a21c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123791 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/script/XMLStarBasicContextFactory.cxx b/xmloff/source/script/XMLStarBasicContextFactory.cxx index 73d6482daa9f..eec6ded9f207 100644 --- a/xmloff/source/script/XMLStarBasicContextFactory.cxx +++ b/xmloff/source/script/XMLStarBasicContextFactory.cxx @@ -87,10 +87,6 @@ SvXMLImportContext* XMLStarBasicContextFactory::CreateContext( comphelper::makePropertyValue(gsMacroName, sMacroNameVal) }; -// macro name -aValues[2].Name = gsMacroName; -aValues[2].Value <<= sMacroNameVal; - // add values for event now rEvents->AddEventValues(rApiEventName, aValues);
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/core/xmlexp.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 5041b1491a183366ca44380bd0f5dfb7c0acc5fb Author: Mike Kaganski AuthorDate: Sun Oct 10 22:07:34 2021 +0200 Commit: Mike Kaganski CommitDate: Mon Oct 11 06:14:38 2021 +0200 Drop unused 'using namespace' here Change-Id: Iffd9e68cbefae664374ca8ad75441f899b849f34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123168 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 0fd65e17d8f2..5e0e46dabeb0 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -98,7 +98,6 @@ #include #include -using namespace ::osl; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame;
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/ximpstyl.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 5bcced4776bb73846ef4f98795e217e4fb923e40 Author: Pierre Marty AuthorDate: Mon Sep 20 14:56:33 2021 +0200 Commit: Noel Grandin CommitDate: Thu Sep 23 09:56:12 2021 +0200 tdf#141978: corrects the value assigned to AutoLayout while loading .odp file SdXMLPresentationPageLayoutContext::endFastElement(sal_Int32) now assigns the value AUTOLAYOUT_TITLE_6CONTENT instead of AUTOLAYOUT_4CLIPART at file loading Change-Id: Ic441d64fc62e1dd08873305a4cafd9823babe46f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122360 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index 77f5877a2442..4f3805e39ddd 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -618,7 +618,7 @@ void SdXMLPresentationPageLayoutContext::endFastElement(sal_Int32 ) } case 7: { -mnTypeId = AUTOLAYOUT_4CLIPART; // FIXME: not AUTOLAYOUT_TITLE_6CONTENT? +mnTypeId = AUTOLAYOUT_TITLE_6CONTENT; // tdf#141978: Apply 6content layout break; } default:
[Libreoffice-commits] core.git: xmloff/source
xmloff/source/draw/shapeexport.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit a0d28d03ff40a77a2c88704a7b2bedb68e68563f Author: Michael Stahl AuthorDate: Thu Sep 9 18:52:49 2021 +0200 Commit: Michael Stahl CommitDate: Fri Sep 10 12:44:58 2021 +0200 xmloff: ODF export: avoid mysterious crash while sorting shapes Apparently the draw page contains a null XShape. That sounds like a bug but OTOH this sorting feature from commit 9bc6160e0acbc78be998129ea55ed7e4529959faa isn't that important so let's sweep the problem under the rug. 0 swlo.dll sw::GetZOrderLayer::operator()(com::sun::star::uno::Reference const &) C:\cygwin64\home\buildslave\source\libo-core\sw\source\filter\xml\zorder.hxx:37 1 mergedlo.dll xmloff::FixZOrder(com::sun::star::uno::Reference const &,std::function const &) C:\cygwin64\home\buildslave\source\libo-core\xmloff\source\draw\shapeexport.cxx:1003 2 swlo.dll SwXMLWriter::Write_(com::sun::star::uno::Reference const &,rtl::OUString const &) C:\cygwin64\home\buildslave\source\libo-core\sw\source\filter\xml\wrtxml.cxx:190 https://crashreport.libreoffice.org/stats/crash_details/045adea4-c577-4164-9e69-bde5f892bd17 Change-Id: I1e67dc1c354cb14717cf9667314d6752e1b4c295 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121860 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 455ca3b4e024..8c7ba1727a84 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -1024,6 +1024,11 @@ void FixZOrder(uno::Reference const& xShapes, for (sal_Int32 i = 0; i < nCount; ++i) { uno::Reference const xShape(xShapes->getByIndex(i), uno::UNO_QUERY); +if (!xShape.is()) +{ +SAL_WARN("xmloff", "FixZOrder: null shape, cannot sort"); +return; +} unsigned int const nLayer(rGetLayer(xShape)); if (layers.size() <= nLayer) {