Rebased ref, commits from common ancestor: commit 28d46bc9f69961cc4b953c34ee6b49bb632f056c Author: Tibor Nagy <tibor.nagy.ext...@allotropia.de> AuthorDate: Mon May 6 10:43:34 2024 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 22:26:29 2024 +0100
The previous behavior of using the TerminationVetoException has changed "Since LibreOffice 5.3: Throwing this exception will only prevent termination. Exiting LibreOffice will close all the windows but the process will keep running." Currently, the behavior is different, because not only is LibreOffice prevented from terminating, but the last document cannot be closed either. The expected behavior is all windows should be closed, but the process should be kept running when using a TerminationVetoException. Change-Id: I8764aefccc4c9feec3ee0e45a54bf0aebcf16c5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167194 Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> Tested-by: Jenkins (cherry picked from commit 64a50c65ee15c03f58ccf25308a70dfd24e791fe) diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index 237d35afc6a5..721c8fa1bf96 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -201,6 +201,8 @@ sal_Bool SAL_CALL Desktop::terminate() aGuard.clear(); // Allow using of any UI ... because Desktop.terminate() was designed as UI functionality in the past. + // try to close all open frames + bool bFramesClosed = impl_closeFrames(!bRestartableMainLoop); // Ask normal terminate listener. They could veto terminating the process. Desktop::TTerminateListenerList lCalledTerminationListener; @@ -210,8 +212,7 @@ sal_Bool SAL_CALL Desktop::terminate() return false; } - // try to close all open frames - if (!impl_closeFrames(!bRestartableMainLoop)) + if (!bFramesClosed) { impl_sendCancelTerminationEvent(lCalledTerminationListener); return false; commit f01fd8903886c759d679c25f464a8a5f147bf245 Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Wed Dec 13 13:11:03 2023 +0100 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 22:26:29 2024 +0100 Work around strange error seen at least with VS 2022 Preview 17.9.0 Preview 2.0 > vcl/source/pdf/XmpMetadata.cxx(39): error C2440: '<function-style-cast>': cannot convert from 'initializer list' to 'rtl::OStringLiteral<55>' > vcl/source/pdf/XmpMetadata.cxx(39): note: Invalid aggregate initialization > vcl/source/pdf/XmpMetadata.cxx(39): note: too many initializers (Smells like a bug in that compiler's u8"..." handling, where it maybe gets tripped by the 3-byte UTF-8 encoding of \uFEFF?) Change-Id: I1c6a856a67c8328ed5fcc2f2fa6bb26f16319f55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160681 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> (cherry picked from commit 297a6673175308168669870882c016b496652a76) diff --git a/vcl/source/pdf/XmpMetadata.cxx b/vcl/source/pdf/XmpMetadata.cxx index 53bf3902ab2b..ddd638551bd5 100644 --- a/vcl/source/pdf/XmpMetadata.cxx +++ b/vcl/source/pdf/XmpMetadata.cxx @@ -8,6 +8,10 @@ * */ +#include <sal/config.h> + +#include <string_view> + #include <pdf/XmpMetadata.hxx> #include <tools/XmlWriter.hxx> @@ -35,8 +39,8 @@ void XmpMetadata::write() mpMemoryStream = std::make_unique<SvMemoryStream>(4096 /*Initial*/, 64 /*Resize*/); // Header - mpMemoryStream->WriteOString( - OStringLiteral(u8"<?xpacket begin=\"\uFEFF\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?> ")); + mpMemoryStream->WriteOString(std::string_view(reinterpret_cast<char const*>( + u8"<?xpacket begin=\"\uFEFF\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?> "))); { tools::XmlWriter aXmlWriter(mpMemoryStream.get()); commit f4f2d0c22de5a91b7a00c2cd7290fab0c73bcc27 Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Tue Dec 3 14:18:21 2024 +0100 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 22:26:29 2024 +0100 configmgr: Better handling of finalized vs. non-finalized in the same layer When there are multiple competing configuration settings for the same configuration layer (e.g., in xcu files of two different extensions from the same extension layer), then the setting that is read last always won, even if any of the settings read earlier is marked as finalized. (The reason for originally doing it that way was that it kept the code logic somewhat simple.) However, esp. for a scenario of multiple extensions in one extension layer (bundled, shared, or user), it can be unexpected by a user that a non-finalized setting (that comes from the extension that happens to be read last) can win over a finalized one. Therefore, change the logic accordingly. Now, if any of the competing settings are finalized, the first finalized one that is read wins. Change-Id: I22aeade543a5b26d95d49cfcb561f974cd7a5081 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177737 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> (cherry picked from commit 7f927322d9b030ceb3b04ae09ea5641e98916f62) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177840 Tested-by: Stephan Bergmann <stephan.bergm...@allotropia.de> diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx index b54e7aa95f01..c85122354bfb 100644 --- a/configmgr/source/xcuparser.cxx +++ b/configmgr/source/xcuparser.cxx @@ -219,6 +219,10 @@ XcuParser::Operation XcuParser::parseOperation(xmlreader::Span const & text) { "invalid op " + text.convertFromUtf8()); } +bool XcuParser::isAlreadyFinalized(int finalizedLayer) const { + return finalizedLayer != Data::NO_LAYER && finalizedLayer <= valueParser_.getLayer(); +} + void XcuParser::handleComponentData(xmlreader::XmlReader & reader) { OStringBuffer buf(256); buf.append('.'); @@ -301,14 +305,13 @@ void XcuParser::handleComponentData(xmlreader::XmlReader & reader) { throw css::uno::RuntimeException( "invalid operation on root node in " + reader.getUrl()); } - int finalizedLayer = std::min( - finalized ? valueParser_.getLayer() : Data::NO_LAYER, - node->getFinalized()); - node->setFinalized(finalizedLayer); - if (finalizedLayer < valueParser_.getLayer()) { + if (isAlreadyFinalized(node->getFinalized())) { state_.push(State::Ignore(true)); return; } + if (finalized) { + node->setFinalized(valueParser_.getLayer()); + } state_.push(State::Modify(node)); } @@ -367,7 +370,7 @@ void XcuParser::handleItem(xmlreader::XmlReader & reader) { default: break; } - if (finalizedLayer < valueParser_.getLayer()) { + if (isAlreadyFinalized(finalizedLayer)) { state_.push(State::Ignore(true)); return; } @@ -660,14 +663,13 @@ void XcuParser::handlePlainGroupProp( state_.push(State::Ignore(true)); return; } - int finalizedLayer = std::min( - finalized ? valueParser_.getLayer() : Data::NO_LAYER, - property->getFinalized()); - property->setFinalized(finalizedLayer); - if (finalizedLayer < valueParser_.getLayer()) { + if (isAlreadyFinalized(property->getFinalized())) { state_.push(State::Ignore(true)); return; } + if (finalized) { + property->setFinalized(valueParser_.getLayer()); + } if (type != TYPE_ERROR && property->getStaticType() != TYPE_ANY && type != property->getStaticType()) { @@ -703,14 +705,13 @@ void XcuParser::handleLocalizedGroupProp( state_.push(State::Ignore(true)); return; } - int finalizedLayer = std::min( - finalized ? valueParser_.getLayer() : Data::NO_LAYER, - property->getFinalized()); - property->setFinalized(finalizedLayer); - if (finalizedLayer < valueParser_.getLayer()) { + if (isAlreadyFinalized(property->getFinalized())) { state_.push(State::Ignore(true)); return; } + if (finalized) { + property->setFinalized(valueParser_.getLayer()); + } if (type != TYPE_ERROR && property->getStaticType() != TYPE_ANY && type != property->getStaticType()) { @@ -798,14 +799,13 @@ void XcuParser::handleGroupNode( throw css::uno::RuntimeException( "invalid operation on group node in " + reader.getUrl()); } - int finalizedLayer = std::min( - finalized ? valueParser_.getLayer() : Data::NO_LAYER, - child->getFinalized()); - child->setFinalized(finalizedLayer); - if (finalizedLayer < valueParser_.getLayer()) { + if (isAlreadyFinalized(child->getFinalized())) { state_.push(State::Ignore(true)); return; } + if (finalized) { + child->setFinalized(valueParser_.getLayer()); + } state_.push(State::Modify(child)); } @@ -877,12 +877,15 @@ void XcuParser::handleSetNode(xmlreader::XmlReader & reader, SetNode * set) { "set member node " + name + " references undefined template " + templateName + " in " + reader.getUrl()); } + bool alreadyFinalized = false; int finalizedLayer = finalized ? valueParser_.getLayer() : Data::NO_LAYER; int mandatoryLayer = mandatory ? valueParser_.getLayer() : Data::NO_LAYER; NodeMap & members = set->getMembers(); NodeMap::iterator i(members.find(name)); if (i != members.end()) { - finalizedLayer = std::min(finalizedLayer, i->second->getFinalized()); + auto const fin = i->second->getFinalized(); + alreadyFinalized = isAlreadyFinalized(fin); + finalizedLayer = std::min(finalizedLayer, fin); i->second->setFinalized(finalizedLayer); mandatoryLayer = std::min(mandatoryLayer, i->second->getMandatory()); i->second->setMandatory(mandatoryLayer); @@ -891,7 +894,7 @@ void XcuParser::handleSetNode(xmlreader::XmlReader & reader, SetNode * set) { return; } } - if (finalizedLayer < valueParser_.getLayer()) { + if (alreadyFinalized) { state_.push(State::Ignore(true)); return; } diff --git a/configmgr/source/xcuparser.hxx b/configmgr/source/xcuparser.hxx index e50b7b5a0fc8..680b294bd6b3 100644 --- a/configmgr/source/xcuparser.hxx +++ b/configmgr/source/xcuparser.hxx @@ -73,6 +73,8 @@ private: static Operation parseOperation(xmlreader::Span const & text); + bool isAlreadyFinalized(int finalizedLayer) const; + void handleComponentData(xmlreader::XmlReader & reader); void handleItem(xmlreader::XmlReader & reader); commit 9d9418227974922e4468e8f937be739035bf03b5 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Mon Nov 25 13:45:39 2024 +0100 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 22:26:29 2024 +0100 sw: fix property set implementation of SwXTextRange RANGE_IS_SECTION Use cursor that includes section nodes, the core implementation should not need start/end to be a text node. Fix one case in SwDoc::ResetAttrs() where a text node is expected. (regression from commit 7ab349296dac79dad3fec09f60348efcbb9ea17e) Change-Id: I56960b5d233ced02703a7c522ebe6afa3347cd25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177259 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit 4fef75d4c8798dd5ebff1c6bd66993665602507d) diff --git a/sw/qa/extras/unowriter/data/section-table.fodt b/sw/qa/extras/unowriter/data/section-table.fodt new file mode 100644 index 000000000000..4f46ac086c91 --- /dev/null +++ b/sw/qa/extras/unowriter/data/section-table.fodt @@ -0,0 +1,162 @@ +<?xml version='1.0' encoding='UTF-8'?> +<office:document xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:c alcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns: meta:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" office:version="1.4" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:meta><meta:initial-creator>GCC</meta:initial-creator><meta:creation-date>2024-11-25T12:23:18.360978950</meta:creation-date><dc:date>2024-11-25T12:24:38.999591414</dc:date><dc:creator>GCC</dc:creator><meta:editing-duration>PT1M22S</meta:editing-duration><meta:editing-cycles>1</meta:editing-cycles><meta:document-statistic meta:table-count="1" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="2" meta:word-count="5" meta:character-count="31" meta:non-whitespace-character-count="28"/><meta:generator>LibreOfficeDev/25.2.0.0.alpha0$Linux_X86_64 LibreOffice_project/10f916791e49306b51a6a299739b130fc2129de1</meta:generator></office:meta> + <office:font-face-decls> + <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/> + <style:font-face style:name="Lucida Sans1" svg:font-family="'Lucida Sans'" style:font-family-generic="system" style:font-pitch="variable"/> + <style:font-face style:name="Noto Serif CJK SC" svg:font-family="'Noto Serif CJK SC'" style:font-family-generic="system" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + <style:default-style style:family="graphic"> + <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/> + <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" loext:tab-stop-distance="0cm" style:writing-mode="lr-tb" style:font-independent-line-spacing="false"> + <style:tab-stops/> + </style:paragraph-properties> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Noto Serif CJK SC" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lucida Sans1" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/> + </style:default-style> + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" fo:hyphenation-keep="auto" loext:hyphenation-keep-type="column" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Noto Serif CJK SC" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lucida Sans1" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false" loext:hyphenation-no-last-word="false" loext:hyphenation-word-char-count="5" loext:hyphenation-zone="no-limit"/> + </style:default-style> + <style:default-style style:family="table"> + <style:table-properties table:border-model="collapsing"/> + </style:default-style> + <style:default-style style:family="table-row"> + <style:table-row-properties fo:keep-together="auto"/> + </style:default-style> + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + <style:style style:name="Table_20_Contents" style:display-name="Table Contents" style:family="paragraph" style:parent-style-name="Standard" style:class="extra"> + <style:paragraph-properties fo:orphans="0" fo:widows="0" text:number-lines="false" text:line-number="0"/> + </style:style> + <text:outline-style style:name="Outline"> + <text:outline-level-style text:level="1" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="2" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="3" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="4" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="5" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="6" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="7" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="8" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="9" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="10" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + </text:outline-style> + <text:notes-configuration text:note-class="footnote" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/> + <text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/> + <text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/> + </office:styles> + <office:automatic-styles> + <style:style style:name="Table1" style:family="table"> + <style:table-properties style:width="17cm" table:align="margins"/> + </style:style> + <style:style style:name="Table1.A" style:family="table-column"> + <style:table-column-properties style:column-width="8.5cm" style:rel-column-width="32767*"/> + </style:style> + <style:style style:name="Table1.A1" style:family="table-cell"> + <style:table-cell-properties fo:padding="0.097cm" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="0.5pt solid #000000" fo:border-bottom="0.5pt solid #000000"/> + </style:style> + <style:style style:name="Table1.B1" style:family="table-cell"> + <style:table-cell-properties fo:padding="0.097cm" fo:border="0.5pt solid #000000"/> + </style:style> + <style:style style:name="Table1.A2" style:family="table-cell"> + <style:table-cell-properties fo:padding="0.097cm" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/> + </style:style> + <style:style style:name="Table1.B2" style:family="table-cell"> + <style:table-cell-properties fo:padding="0.097cm" fo:border-left="0.5pt solid #000000" fo:border-right="0.5pt solid #000000" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/> + </style:style> + <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Table_20_Contents"> + <style:text-properties/> + </style:style> + <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard"> + <style:text-properties/> + </style:style> + <style:style style:name="Sect1" style:family="section"> + <style:section-properties fo:background-color="#158466" style:editable="false"> + <style:columns fo:column-count="1" fo:column-gap="0cm"/> + <style:background-image/> + </style:section-properties> + </style:style> + <style:page-layout style:name="pm1"> + <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm" loext:margin-gutter="0cm"> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style/> + <style:footer-style/> + </style:page-layout> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Standard" style:page-layout-name="pm1"/> + </office:master-styles> + <office:body> + <office:text> + <text:sequence-decls> + <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/> + <text:sequence-decl text:display-outline-level="0" text:name="Table"/> + <text:sequence-decl text:display-outline-level="0" text:name="Text"/> + <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/> + <text:sequence-decl text:display-outline-level="0" text:name="Figure"/> + </text:sequence-decls> + <text:section text:style-name="Sect1" text:name="Section1"> + <table:table table:name="Table1" table:style-name="Table1"> + <table:table-column table:style-name="Table1.A" table:number-columns-repeated="2"/> + <table:table-row> + <table:table-cell table:style-name="Table1.A1" office:value-type="string"> + <text:p text:style-name="P1">Table in section</text:p> + </table:table-cell> + <table:table-cell table:style-name="Table1.B1" office:value-type="string"> + <text:p text:style-name="Table_20_Contents"/> + </table:table-cell> + </table:table-row> + <table:table-row> + <table:table-cell table:style-name="Table1.A2" office:value-type="string"> + <text:p text:style-name="Table_20_Contents"/> + </table:table-cell> + <table:table-cell table:style-name="Table1.B2" office:value-type="string"> + <text:p text:style-name="Table_20_Contents"/> + </table:table-cell> + </table:table-row> + </table:table> + </text:section> + <text:p text:style-name="P2">Outside section</text:p> + </office:text> + </office:body> +</office:document> \ No newline at end of file diff --git a/sw/qa/extras/unowriter/unowriter.cxx b/sw/qa/extras/unowriter/unowriter.cxx index a2c03bbaaf02..8823cb1defa5 100644 --- a/sw/qa/extras/unowriter/unowriter.cxx +++ b/sw/qa/extras/unowriter/unowriter.cxx @@ -556,6 +556,37 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSectionAnchorCopyTable) xCursor->getString()); } +CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSectionAnchorProperties) +{ + createSwDoc("section-table.fodt"); + + uno::Reference<text::XTextSectionsSupplier> const xTextSectionsSupplier(mxComponent, + uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> const xSections( + xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSections->getCount()); + + uno::Reference<text::XTextContent> const xSection(xSections->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> const xAnchor(xSection->getAnchor()); + uno::Reference<beans::XPropertySet> const xAnchorProp(xAnchor, uno::UNO_QUERY); + + // the problem was that the property set didn't work + auto xSecFromProp = getProperty<uno::Reference<text::XTextContent>>(xAnchorProp, "TextSection"); + CPPUNIT_ASSERT_EQUAL(xSection, xSecFromProp); + + xAnchorProp->setPropertyValue("CharHeight", uno::Any(float(64))); + CPPUNIT_ASSERT_EQUAL(float(64), getProperty<float>(xAnchorProp, "CharHeight")); + uno::Reference<beans::XPropertyState> const xAnchorState(xAnchor, uno::UNO_QUERY); + // TODO: why does this return DEFAULT_VALUE instead of DIRECT_VALUE? + CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DEFAULT_VALUE, + xAnchorState->getPropertyState("CharHeight")); + CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DEFAULT_VALUE, + xAnchorState->getPropertyStates({ "CharHeight" })[0]); + CPPUNIT_ASSERT_EQUAL(float(12), xAnchorState->getPropertyDefault("CharHeight").get<float>()); + xAnchorState->setPropertyToDefault("CharHeight"); + CPPUNIT_ASSERT_EQUAL(float(12), getProperty<float>(xAnchorProp, "CharHeight")); +} + CPPUNIT_TEST_FIXTURE(SwUnoWriter, testTextRangeInTable) { createSwDoc("bookmarkintable.fodt"); diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 755ee2541fde..4f89de65e4f4 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -365,7 +365,8 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, ++aTmpStt; } - if( pEnd->GetContentIndex() == pEnd->GetNode().GetContentNode()->Len() ) + if (!pEnd->GetNode().IsContentNode() + || pEnd->GetContentIndex() == pEnd->GetNode().GetContentNode()->Len()) { // set up a later, and all CharFormatAttr -> TextFormatAttr ++aTmpEnd; diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 5cb73bf7b8f0..db08e63592e6 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1439,12 +1439,13 @@ SwXTextRange::setPropertyValue( { SolarMutexGuard aGuard; - if (!m_pImpl->GetBookmark()) + if (!m_pImpl->GetBookmark() + && (m_pImpl->m_eRangePosition != RANGE_IS_SECTION || !m_pImpl->m_pTableOrSectionFormat)) { throw uno::RuntimeException("range has no mark (table?)"); } SwPaM aPaM(GetDoc().GetNodes()); - GetPositions(aPaM); + GetPositions(aPaM, ::sw::TextRangeMode::AllowNonTextNode); SwUnoCursorHelper::SetPropertyValue(aPaM, m_pImpl->m_rPropSet, rPropertyName, rValue); } @@ -1454,12 +1455,13 @@ SwXTextRange::getPropertyValue(const OUString& rPropertyName) { SolarMutexGuard aGuard; - if (!m_pImpl->GetBookmark()) + if (!m_pImpl->GetBookmark() + && (m_pImpl->m_eRangePosition != RANGE_IS_SECTION || !m_pImpl->m_pTableOrSectionFormat)) { throw uno::RuntimeException("range has no mark (table?)"); } SwPaM aPaM(GetDoc().GetNodes()); - GetPositions(aPaM); + GetPositions(aPaM, ::sw::TextRangeMode::AllowNonTextNode); return SwUnoCursorHelper::GetPropertyValue(aPaM, m_pImpl->m_rPropSet, rPropertyName); } @@ -1501,12 +1503,13 @@ SwXTextRange::getPropertyState(const OUString& rPropertyName) { SolarMutexGuard aGuard; - if (!m_pImpl->GetBookmark()) + if (!m_pImpl->GetBookmark() + && (m_pImpl->m_eRangePosition != RANGE_IS_SECTION || !m_pImpl->m_pTableOrSectionFormat)) { throw uno::RuntimeException("range has no mark (table?)"); } SwPaM aPaM(GetDoc().GetNodes()); - GetPositions(aPaM); + GetPositions(aPaM, ::sw::TextRangeMode::AllowNonTextNode); return SwUnoCursorHelper::GetPropertyState(aPaM, m_pImpl->m_rPropSet, rPropertyName); } @@ -1516,12 +1519,13 @@ SwXTextRange::getPropertyStates(const uno::Sequence< OUString >& rPropertyName) { SolarMutexGuard g; - if (!m_pImpl->GetBookmark()) + if (!m_pImpl->GetBookmark() + && (m_pImpl->m_eRangePosition != RANGE_IS_SECTION || !m_pImpl->m_pTableOrSectionFormat)) { throw uno::RuntimeException("range has no mark (table?)"); } SwPaM aPaM(GetDoc().GetNodes()); - GetPositions(aPaM); + GetPositions(aPaM, ::sw::TextRangeMode::AllowNonTextNode); return SwUnoCursorHelper::GetPropertyStates(aPaM, m_pImpl->m_rPropSet, rPropertyName); } @@ -1530,12 +1534,13 @@ void SAL_CALL SwXTextRange::setPropertyToDefault(const OUString& rPropertyName) { SolarMutexGuard aGuard; - if (!m_pImpl->GetBookmark()) + if (!m_pImpl->GetBookmark() + && (m_pImpl->m_eRangePosition != RANGE_IS_SECTION || !m_pImpl->m_pTableOrSectionFormat)) { throw uno::RuntimeException("range has no mark (table?)"); } SwPaM aPaM(GetDoc().GetNodes()); - GetPositions(aPaM); + GetPositions(aPaM, ::sw::TextRangeMode::AllowNonTextNode); SwUnoCursorHelper::SetPropertyToDefault(aPaM, m_pImpl->m_rPropSet, rPropertyName); } @@ -1545,12 +1550,13 @@ SwXTextRange::getPropertyDefault(const OUString& rPropertyName) { SolarMutexGuard aGuard; - if (!m_pImpl->GetBookmark()) + if (!m_pImpl->GetBookmark() + && (m_pImpl->m_eRangePosition != RANGE_IS_SECTION || !m_pImpl->m_pTableOrSectionFormat)) { throw uno::RuntimeException("range has no mark (table?)"); } SwPaM aPaM(GetDoc().GetNodes()); - GetPositions(aPaM); + GetPositions(aPaM, ::sw::TextRangeMode::AllowNonTextNode); return SwUnoCursorHelper::GetPropertyDefault(aPaM, m_pImpl->m_rPropSet, rPropertyName); } commit c40ea077a7d4fb270c6c5b6146668ab5265d4a6c Author: Oliver Specht <oliver.spe...@cib.de> AuthorDate: Thu Jul 25 14:17:06 2024 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 22:26:29 2024 +0100 Use NDEBUG to show/hide m_bDeleted "#ifndef NDEBUG" is now always used to hide/show member m_bDeleted Change-Id: I10f5111cd36e13b8101d2a69ed9268bee622344a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171012 Tested-by: Jenkins Reviewed-by: Oliver Specht <oliver.spe...@cib.de> (cherry picked from commit 44d129870795da2e370ad5f2f8abc95c5c6873aa) diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index acc5d64ea50a..5a85d2d7780e 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -110,7 +110,7 @@ SfxPoolItemHolder::~SfxPoolItemHolder() #endif if (nullptr != m_pItem) implCleanupItemEntry(*m_pPool, m_pItem); -#ifdef DBG_UTIL +#ifndef NDEBUG m_bDeleted = true; #endif } commit 518401231acaf7b9802efbdeb6794c8958e58108 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Dec 23 13:52:09 2023 +0000 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 22:26:29 2024 +0100 cid#1559884 Uninitialized scalar variable etc, since: commit e9e3576ada06d53de12efed041fb309fe5388e01 Date: Thu Dec 21 22:49:27 2023 +0100 svl: fix build with --enable-debug Change-Id: I1c3c82f0f1674cb46fa6a36d5f9f5cc4435ebef1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161241 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit b803b3a7a1eda1b9862112f399c0a8b988c1f930) diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index fd9cbb1dddee..acc5d64ea50a 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -61,7 +61,7 @@ static bool g_bItemClassicMode(getenv("ITEM_CLASSIC_MODE")); SfxPoolItemHolder::SfxPoolItemHolder() : m_pPool(nullptr) , m_pItem(nullptr) -#ifdef DBG_UTIL +#ifndef NDEBUG , m_bDeleted(false) #endif { commit 23c7a646a117b940aacbf5e17c4a20b15c85269b Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Wed Mar 13 16:24:50 2024 +0100 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 22:26:28 2024 +0100 sw: convert OSL_ENSURE to assert To avoid spurious -Warray-bounds from GCC 13.2.1 Change-Id: I26aba84a6ceda79ffc111c925c8be96df8b186dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164782 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit 7389be1996159b557f2e4022459ed8408302d72a) diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx index 048878292fc0..0eb8d74e89c6 100644 --- a/sw/source/core/text/atrstck.cxx +++ b/sw/source/core/text/atrstck.cxx @@ -472,8 +472,7 @@ void SwAttrHandler::Pop( const SwTextAttr& rAttr ) void SwAttrHandler::ActivateTop( SwFont& rFnt, const sal_uInt16 nAttr ) { - OSL_ENSURE( nAttr < RES_TXTATR_WITHEND_END, - "I cannot activate this attribute, nWhich >= RES_TXTATR_WITHEND_END" ); + assert(nAttr < RES_TXTATR_WITHEND_END); const sal_uInt16 nStackPos = StackPos[ nAttr ]; const SwTextAttr* pTopAt = GetTop(nStackPos); diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 3004fb684e9c..78df4a8dc6d8 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -73,7 +73,7 @@ using namespace ::com::sun::star::beans; std::span<const SfxItemPropertyMapEntry> SwUnoPropertyMapProvider::GetPropertyMapEntries(sal_uInt16 nPropertyId) { - OSL_ENSURE(nPropertyId < PROPERTY_MAP_END, "Id ?" ); + assert(nPropertyId < PROPERTY_MAP_END); if( m_aMapEntriesArr[ nPropertyId ].empty() ) { switch(nPropertyId) commit 3e7734dc1c5e1b5b58311670f1a55dc18ffb840f Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Fri Aug 23 11:57:45 2024 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 22:26:28 2024 +0100 Silence some bogus -Werror=array-bounds etc. also with GCC 14 and -std=c++20 Change-Id: If7a3e0d7536642ae672ba6096183bb8413b36a31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172310 Reviewed-by: Julien Nabet <serval2...@yahoo.fr> Tested-by: Julien Nabet <serval2...@yahoo.fr> (cherry picked from commit 6e51d65c3d8031967727092ee2f48b8577db9b85) diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 93ec0fa23e48..1a92fc3224ed 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -992,13 +992,13 @@ void SwDoc::CalculatePagePairsForProspectPrinting( // just one page is special ... if ( 1 == aVec.size() ) { -#if defined __GNUC__ && !defined __clang__ && __GNUC__ <= 13 && __cplusplus == 202002L +#if defined __GNUC__ && !defined __clang__ && __GNUC__ <= 14 && __cplusplus == 202002L #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" #pragma GCC diagnostic ignored "-Wstringop-overflow" #endif aVec.insert( aVec.begin() + 1, nullptr ); // insert a second empty page -#if defined __GNUC__ && !defined __clang__ && __GNUC__ <= 13 && __cplusplus == 202002L +#if defined __GNUC__ && !defined __clang__ && __GNUC__ <= 14 && __cplusplus == 202002L #pragma GCC diagnostic pop #endif } commit a7f5617562ed1eb3a7223930fb6366da42361a7e Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Wed May 1 15:50:50 2024 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 22:26:28 2024 +0100 Silence some bogus -Werror=array-bounds etc. also with GCC 13 and -std=c++20 See 1c3c27bc2e42f70e588ef5dbc769a8a346042e04 Silence some bogus -Werror=array-bounds etc. with GCC 12 and -std=c++20 Change-Id: I65675d1f18415ae82afb98c7d388dac3cdc18ab0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166966 Reviewed-by: Julien Nabet <serval2...@yahoo.fr> Tested-by: Jenkins (cherry picked from commit a835b40e05462e9be58cb501aa6b938f3dc998b8) diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 4bcb2a35e856..93ec0fa23e48 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -992,13 +992,13 @@ void SwDoc::CalculatePagePairsForProspectPrinting( // just one page is special ... if ( 1 == aVec.size() ) { -#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 12 && __cplusplus == 202002L +#if defined __GNUC__ && !defined __clang__ && __GNUC__ <= 13 && __cplusplus == 202002L #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" #pragma GCC diagnostic ignored "-Wstringop-overflow" #endif aVec.insert( aVec.begin() + 1, nullptr ); // insert a second empty page -#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 12 && __cplusplus == 202002L +#if defined __GNUC__ && !defined __clang__ && __GNUC__ <= 13 && __cplusplus == 202002L #pragma GCC diagnostic pop #endif } commit 6348e98173f0f4a361e893cb272f44c902bd86ee Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Fri Aug 23 10:56:27 2024 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 22:26:28 2024 +0100 -Werror=maybe-uninitialized in sfx2 /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx: In member function ‘void SfxSplitWindow::InsertWindow(SfxDockingWindow*, const Size&)’: /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx:462:23: error: ‘nL’ may be used uninitialized [-Werror=maybe-uninitialized] 462 | nLine = static_cast<short>(nL); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx:433:16: note: ‘nL’ was declared here 433 | sal_uInt16 nL; | ^~ /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx: In member function ‘void SfxSplitWindow::MoveWindow(SfxDockingWindow*, const Size&, sal_uInt16, sal_uInt16, bool)’: /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx:552:21: error: ‘nL’ may be used uninitialized [-Werror=maybe-uninitialized] 552 | if ( nLine > nL && GetItemCount( GetItemId( nL ) ) == 1 ) | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx:548:16: note: ‘nL’ was declared here 548 | sal_uInt16 nL, nP; | ^~ Change-Id: I816ec49fe2c63e4f448ae83251d3a24b08383903 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172306 Reviewed-by: Julien Nabet <serval2...@yahoo.fr> Tested-by: Jenkins (cherry picked from commit 73884e28faeb457c01b80051a701c073112ad564) diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx index 210a9dbeaaff..61903bb13d6c 100644 --- a/sfx2/source/dialog/splitwin.cxx +++ b/sfx2/source/dialog/splitwin.cxx @@ -429,7 +429,6 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize */ { short nLine = -1; // so that the first window cab set nline to 0 - sal_uInt16 nL; sal_uInt16 nPos = 0; bool bNewLine = true; bool bSaveConfig = false; @@ -456,6 +455,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize if ( bNewLine && !pFoundDock ) { // Not known until now in which real line it is located + sal_uInt16 nL = 0; GetWindowPos( rDock.pWin, nL, nPos ); nLine = static_cast<short>(nL); } @@ -543,7 +543,8 @@ void SfxSplitWindow::MoveWindow( SfxDockingWindow* pDockWin, const Size& rSize, */ { - sal_uInt16 nL, nP; + sal_uInt16 nL = 0; + sal_uInt16 nP = 0; GetWindowPos( pDockWin, nL, nP ); if ( nLine > nL && GetItemCount( GetItemId( nL ) ) == 1 ) commit 7ad5fa555e09636e4f6947935202744ccba6af98 Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Fri Apr 5 16:43:08 2024 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 22:26:28 2024 +0100 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/vector:66, > from include/unotools/options.hxx:26, > from include/unotools/lingucfg.hxx:27, > from linguistic/source/lngsvcmgr.cxx:35: > In destructor ‘constexpr std::__cxx1998::vector< <template-parameter-1-1>, <template-parameter-1-2> >::~vector() [with _Tp = SvcInfo; _Alloc = std::allocator<SvcInfo>]’, > inlined from ‘constexpr std::__debug::vector<_Tp, _Allocator>::~vector() [with _Tp = SvcInfo; _Allocator = std::allocator<SvcInfo>]’ at ~/gcc/inst/include/c++/14.0.1/debug/vector:245:7, > inlined from ‘constexpr void std::_Optional_payload_base<_Tp>::_M_destroy() [with _Tp = std::__debug::vector<SvcInfo>]’ 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::vector<SvcInfo>]’ at ~/gcc/inst/include/c++/14.0.1/optional:314:14, > inlined from ‘constexpr std::_Optional_payload<_Tp, false, _Copy, _Move>::~_Optional_payload() [with _Tp = std::__debug::vector<SvcInfo>; bool _Copy = false; bool _Move = false]’ at ~/gcc/inst/include/c++/14.0.1/optional:437:65, > inlined from ‘constexpr std::_Optional_base<std::__debug::vector<SvcInfo>, false, false>::~_Optional_base()’ at ~/gcc/inst/include/c++/14.0.1/optional:508:12, > inlined from ‘constexpr std::optional<std::__debug::vector<SvcInfo> >::~optional()’ at ~/gcc/inst/include/c++/14.0.1/optional:703:11, > inlined from ‘LngSvcMgr::~LngSvcMgr()’ at linguistic/source/lngsvcmgr.cxx:519:1: > ~/gcc/inst/include/c++/14.0.1/bits/stl_vector.h:735:22: error: ‘((std::__cxx1998::vector<SvcInfo, std::allocator<SvcInfo> >*)((char*)this + 16))[22].std::__cxx1998::vector<SvcInfo, std::allocator<SvcInfo> >::std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> >.std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> >::_M_impl.std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> >::_Vector_impl::std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> >::_Vector_impl_data.std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> >::_Vector_impl_data::_M_finish’ may be used uninitialized [-Werror=maybe-uninitialized] > 735 | std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, > | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 736 | _M_get_Tp_allocator()); > | ~~~~~~~~~~~~~~~~~~~~~~ > ~/gcc/inst/include/c++/14.0.1/bits/stl_vector.h:735:22: error: ‘((std::__cxx1998::vector<SvcInfo, std::allocator<SvcInfo> >*)((char*)this + 16))[22].std::__cxx1998::vector<SvcInfo, std::allocator<SvcInfo> >::std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> >.std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> >::_M_impl.std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> >::_Vector_impl::std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> >::_Vector_impl_data.std::__cxx1998::_Vector_base<SvcInfo, std::allocator<SvcInfo> >::_Vector_impl_data::_M_start’ may be used uninitialized [-Werror=maybe-uninitialized] Change-Id: I02815c39ee6026b4637a4bb6ad2804af7a446a57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165821 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> (cherry picked from commit 745ba22017fde53b50f38a1db5c3eaa388003871) diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 850d4d813bfd..f6bd3b705344 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -496,6 +496,10 @@ void LngSvcMgr::disposing(const lang::EventObject&) stopListening(); } +#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 14 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif LngSvcMgr::~LngSvcMgr() { stopListening(); @@ -509,6 +513,9 @@ LngSvcMgr::~LngSvcMgr() pAvailHyphSvcs.reset(); pAvailThesSvcs.reset(); } +#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 14 +#pragma GCC diagnostic pop +#endif namespace { commit 8f6c1722284b38483cca3bbdeabc5e35edfc1c5e Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Thu May 2 09:16:26 2024 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 22:26:28 2024 +0100 Extend silence strange -Wclobbered with GCC <= 14 See 2bcd9fe0fa10339294e6ab820498fa18334e02f3 Silence strange -Wclobbered with recent GCC 14 Change-Id: Id51659cb8cd49b65c55b22ed0ac515a8ab609602 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166994 Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> Tested-by: Julien Nabet <serval2...@yahoo.fr> (cherry picked from commit e783a1c09093f3dbaf778661b77a2d5872a2029d) diff --git a/vcl/source/filter/png/PngImageReader.cxx b/vcl/source/filter/png/PngImageReader.cxx index 72626d174fe6..fdf5903d2480 100644 --- a/vcl/source/filter/png/PngImageReader.cxx +++ b/vcl/source/filter/png/PngImageReader.cxx @@ -322,7 +322,7 @@ bool fcTLbeforeIDAT(SvStream& rStream) return false; } -#if defined __GNUC__ && __GNUC__ == 14 && !defined __clang__ +#if defined __GNUC__ && __GNUC__ <= 14 && !defined __clang__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wclobbered" #endif @@ -821,7 +821,7 @@ BinaryDataContainer getMsGifChunk(SvStream& rStream) return {}; } } -#if defined __GNUC__ && __GNUC__ == 14 && !defined __clang__ +#if defined __GNUC__ && __GNUC__ <= 14 && !defined __clang__ #pragma GCC diagnostic pop #endif commit 344adf0e44ea876e5e3222a05f57898cc0682eac Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Fri Apr 5 16:55:28 2024 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 22:26:27 2024 +0100 Silence strange -Wclobbered with recent GCC 14 ...seen at least with some (--enable-dbgutil --enable-otpimized etc.) configuration and a recent GCC 14 trunk, > vcl/source/filter/png/PngImageReader.cxx: In function ‘bool {anonymous}::reader(SvStream&, Graphic&, GraphicFilterImportFlags, BitmapScopedWriteAccess*, BitmapScopedWriteAccess*)’: > vcl/source/filter/png/PngImageReader.cxx:361:16: error: variable ‘bSupportsBitmap32’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered] > 361 | const bool bSupportsBitmap32 = bFuzzing || ImplGetSVData()->mpDefInst->supportsBitmap32(); > | ^~~~~~~~~~~~~~~~~ Change-Id: Icc1932347a213877ecc9f561f98de779f8041c09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165823 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> (cherry picked from commit 2bcd9fe0fa10339294e6ab820498fa18334e02f3) diff --git a/vcl/source/filter/png/PngImageReader.cxx b/vcl/source/filter/png/PngImageReader.cxx index d6a5a219c5e2..72626d174fe6 100644 --- a/vcl/source/filter/png/PngImageReader.cxx +++ b/vcl/source/filter/png/PngImageReader.cxx @@ -322,6 +322,10 @@ bool fcTLbeforeIDAT(SvStream& rStream) return false; } +#if defined __GNUC__ && __GNUC__ == 14 && !defined __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclobbered" +#endif bool reader(SvStream& rStream, Graphic& rGraphic, GraphicFilterImportFlags nImportFlags = GraphicFilterImportFlags::NONE, BitmapScopedWriteAccess* pAccess = nullptr, @@ -817,6 +821,9 @@ BinaryDataContainer getMsGifChunk(SvStream& rStream) return {}; } } +#if defined __GNUC__ && __GNUC__ == 14 && !defined __clang__ +#pragma GCC diagnostic pop +#endif } // anonymous namespace commit ee2b344aec5fe68a2d8feba19bc274903a2e03e4 Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Fri Jan 19 08:42:13 2024 +0100 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 22:26:27 2024 +0100 PlotAreaConverter::mbSingleSeriesTitle is apparently read uninitialized ...in code newly introduced in 135ce256ce9e879663d828ec6e699de521fad867 "tdf#146487 Don't show generic diagram title when there is an empty title given", which caused CppunitTest_chart2_export2 to fail with > /oox/inc/drawingml/chart/plotareaconverter.hxx:78:62: runtime error: load of value 222, which is not a valid value for type 'bool' > #0 0x7f95cd9ed87c in oox::drawingml::chart::PlotAreaConverter::isSingleSeriesTitle() const /oox/inc/drawingml/chart/plotareaconverter.hxx:78:62 > #1 0x7f95cd9e506f in oox::drawingml::chart::ChartSpaceConverter::convertFromModel(com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, com::sun::star::awt::Point const&) /oox/source/drawingml/chart/chartspaceconverter.cxx:189:53 > #2 0x7f95cd9b6c34 in oox::drawingml::chart::ChartConverter::convertFromModel(oox::core::XmlFilterBase&, oox::drawingml::chart::ChartSpaceModel&, com::sun::star::uno::Reference<com::sun::star::chart2::XChartDocument> const&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, com::sun::star::awt::Point const&, com::sun::star::awt::Size const&) /oox/source/drawingml/chart/chartconverter.cxx:93:20 > #3 0x7f95ce548f59 in oox::drawingml::Shape::finalizeXShape(oox::core::XmlFilterBase&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&) /oox/source/drawingml/shape.cxx:2245:50 > #4 0x7f95438150b2 in oox::xls::Shape::finalizeXShape(oox::core::XmlFilterBase&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&) /sc/source/filter/oox/drawingfragment.cxx:113:30 > #5 0x7f95ce5267bb in oox::drawingml::Shape::createAndInsert(oox::core::XmlFilterBase&, rtl::OUString const&, oox::drawingml::Theme const*, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, bool, bool, basegfx::B2DHomMatrix&, oox::drawingml::FillProperties const&, std::shared_ptr<oox::drawingml::Shape>) /oox/source/drawingml/shape.cxx:1964:9 > #6 0x7f95ce4edb54 in oox::drawingml::Shape::addShape(oox::core::XmlFilterBase&, oox::drawingml::Theme const*, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, basegfx::B2DHomMatrix const&, oox::drawingml::FillProperties const&, std::__debug::map<rtl::OUString, std::shared_ptr<oox::drawingml::Shape>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, std::shared_ptr<oox::drawingml::Shape> > > >*, std::shared_ptr<oox::drawingml::Shape>) /oox/source/drawingml/shape.cxx:366:41 > #7 0x7f954381ef79 in oox::xls::DrawingFragment::onEndElement() /sc/source/filter/oox/drawingfragment.cxx:335:30 > #8 0x7f95cdcaee54 in oox::core::ContextHandler2Helper::implEndElement(int) /oox/source/core/contexthandler2.cxx:125:9 > #9 0x7f95cdd5c116 in oox::core::FragmentHandler2::endFastElement(int) /oox/source/core/fragmenthandler2.cxx:91:5 > #10 0x7f95caf68fca in (anonymous namespace)::Entity::endElement() /sax/source/fastparser/fastparser.cxx:514:27 > #11 0x7f95caf68998 in sax_fastparser::FastSaxParserImpl::callbackEndElement() /sax/source/fastparser/fastparser.cxx:1331:17 > #12 0x7f95caf58444 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) /sax/source/fastparser/fastparser.cxx:338:18 > #13 0x7f960adebeda in xmlParseEndTag2 /workdir/UnpackedTarball/libxml2/parser.c:10090:2 > #14 0x7f960ad929b5 in xmlParseTryOrFinish /workdir/UnpackedTarball/libxml2/parser.c:11868:14 > #15 0x7f960ad86334 in xmlParseChunk /workdir/UnpackedTarball/libxml2/parser.c:12151:5 > #16 0x7f95caf53231 in sax_fastparser::FastSaxParserImpl::parse() /sax/source/fastparser/fastparser.cxx:1085:21 > #17 0x7f95caf4cd18 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:890:9 > #18 0x7f95caf6e950 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:1470:13 > #19 0x7f95cdce50d1 in oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) /oox/source/core/fastparser.cxx:121:15 > #20 0x7f95cdce5868 in oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) /oox/source/core/fastparser.cxx:129:5 > #21 0x7f95cddbb234 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) /oox/source/core/xmlfilterbase.cxx:414:21 > #22 0x7f95cddb9b8d in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&) /oox/source/core/xmlfilterbase.cxx:344:12 > #23 0x7f95441ceaa8 in oox::xls::WorkbookHelper::importOoxFragment(rtl::Reference<oox::core::FragmentHandler> const&) /sc/source/filter/oox/workbookhelper.cxx:1046:27 > #24 0x7f95442797f1 in oox::xls::WorksheetGlobals::finalizeDrawings() /sc/source/filter/oox/worksheethelper.cxx:1373:9 > #25 0x7f95442789e0 in oox::xls::WorksheetGlobals::finalizeDrawingImport() /sc/source/filter/oox/worksheethelper.cxx:996:5 > #26 0x7f954428744d in oox::xls::WorksheetHelper::finalizeDrawingImport() /sc/source/filter/oox/worksheethelper.cxx:1637:17 > #27 0x7f95441771de in oox::xls::WorkbookFragment::finalizeImport() /sc/source/filter/oox/workbookfragment.cxx:511:18 > #28 0x7f95cdd5b3ae in oox::core::FragmentHandler2::endDocument() /oox/source/core/fragmenthandler2.cxx:53:5 > #29 0x7f95caf4cfc2 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:896:36 > #30 0x7f95caf6e950 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:1470:13 > #31 0x7f95cdce50d1 in oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) /oox/source/core/fastparser.cxx:121:15 > #32 0x7f95cdce5868 in oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) /oox/source/core/fastparser.cxx:129:5 > #33 0x7f95cddbb234 in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) /oox/source/core/xmlfilterbase.cxx:414:21 > #34 0x7f95cddb9b8d in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&) /oox/source/core/xmlfilterbase.cxx:344:12 > #35 0x7f95435c4daa in oox::xls::ExcelFilter::importDocument() /sc/source/filter/oox/excelfilter.cxx:113:25 > #36 0x7f95cdcf953b in oox::core::FilterBase::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /oox/source/core/filterbase.cxx:488:49 > #37 0x7f95435c7733 in oox::xls::ExcelFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sc/source/filter/oox/excelfilter.cxx:176:25 > #38 0x7f95857c5b40 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) /sfx2/source/doc/objstor.cxx:2393:34 > #39 0x7f9585781c6a in SfxObjectShell::DoLoad(SfxMedium*) /sfx2/source/doc/objstor.cxx:761:23 > #40 0x7f95859a9652 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1980:36 > #41 0x7f95862145e9 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) /sfx2/source/view/frmload.cxx:720:28 > #42 0x7f95536a9900 in framework::LoadEnv::impl_loadContent() /framework/source/loadenv/loadenv.cxx:1176:37 > #43 0x7f95536a091b in framework::LoadEnv::start() /framework/source/loadenv/loadenv.cxx:412:20 > #44 0x7f9553698f59 in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, rtl::OUString const&, int, LoadEnvFeatures) /framework/source/loadenv/loadenv.cxx:308:5 > #45 0x7f95536946e7 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/loadenv/loadenv.cxx:168:14 > #46 0x7f955376867d in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/desktop.cxx:591:16 > #47 0x7f95537688a6 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/desktop.cxx > #48 0x7f9569f7cafa in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /unotest/source/cpp/macros_test.cxx:71:62 > #49 0x7f9580718c56 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /test/source/unoapi_test.cxx:126:19 > #50 0x7f9580717ef8 in UnoApiTest::load(rtl::OUString const&, char const*) /test/source/unoapi_test.cxx:108:5 > #51 0x7f9580719254 in UnoApiTest::loadFromFile(std::basic_string_view<char16_t, std::char_traits<char16_t> >, char const*) /test/source/unoapi_test.cxx:132:5 > #52 0x7f95d8bf1018 in testTdf123647::TestBody() /chart2/qa/extras/chart2export2.cxx:1242:5 (<https://ci.libreoffice.org//job/lo_ubsan/3048/>) Change-Id: I870d811e78b8c55b84627ae609f98f623465dd9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162294 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> (cherry picked from commit 3fb9859c6aa4a32f2333d86fa438e9f1d6ef7f55) diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx index 32e4de7d1ee4..cd2ec9e5bdc9 100644 --- a/oox/source/drawingml/chart/plotareaconverter.cxx +++ b/oox/source/drawingml/chart/plotareaconverter.cxx @@ -304,7 +304,8 @@ PlotAreaConverter::PlotAreaConverter( const ConverterRoot& rParent, PlotAreaMode ConverterBase< PlotAreaModel >( rParent, rModel ), mb3dChart( false ), mbWall3dChart( false ), - mbPieChart( false ) + mbPieChart( false ), + mbSingleSeriesTitle( false ) { } commit 2dc1fe940e4f9adeddb23418b653b1d36e5d74f6 Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Tue Apr 9 10:37:09 2024 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 22:26:27 2024 +0100 Avoid -O2 in AC_PROG_CC/CXX, work around occasional Clang 12.0.1 SEGVs At least with one ASan/UBSan setup of mine using LODE's Clang 12.0.1, ./autogen.sh would occasionally detect -std=gnu11 as the required CC "option to enable C11 features" (which would in turn cause building external/firebird to fail oddly; an issue worth investigations of its own), because Clang would occasionally crash with a SEGV on the corresponding configure test program's first invocation (without -std=gnu11) when invoked with -O2 (and happen to succeed on second invocation with -std=gnu11, so configure thinks that's needed), see below for a relevant config.log excerpt. When CC/CXX are already set (as is the case in this scenario), we could arguably skip the AC_PROG_CC/CXX checks entirely (and thus avoid configure potentially adding -std=gnu11 to CC), but at least AC_PROG_CC also internally sets the GCC shell var, which we use in configure.ac. So better be conservative and just avoid -O2 during AC_PROG_CC/CXX (whatever the autoconf motivation to include it in the first place). > configure:8165: checking for /home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang -fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero -fsanitize=local-bounds -fsanitize-blacklist=/home/sberg/lo0/core/sanitize-ubsan-excludelist option to enable C11 features > configure:8180: /home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang -fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero -fsanitize=local-bounds -fsanitize-blacklist=/home/sberg/lo0/core/sanitize-ubsan-excludelist -c -g -O2 conftest.c >&5 > PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script. > Stack dump: > 0. Program arguments: /home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang -fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero -fsanitize=local-bounds -fsanitize-blacklist=/home/sberg/lo0/core/sanitize-ubsan-excludelist -c -g -O2 conftest.c > 1. <eof> parser at end of file > 2. Code generation > #0 0x000055f3a890caf2 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x1c3eaf2) > #1 0x000055f3a890a734 llvm::sys::RunSignalHandlers() (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x1c3c734) > #2 0x000055f3a887b998 CrashRecoverySignalHandler(int) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x1bad998) > #3 0x00007f750d24e520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520) > #4 0x000055f3a93f9cd4 llvm::DIE::getUnitDie() const (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x272bcd4) > #5 0x000055f3a9404574 llvm::DwarfDebug::finishEntityDefinitions() (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x2736574) > #6 0x000055f3a941df99 llvm::DwarfDebug::finalizeModuleInfo() (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x274ff99) > #7 0x000055f3a9421128 llvm::DwarfDebug::endModule() (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x2753128) > #8 0x000055f3a93f1219 llvm::AsmPrinter::doFinalization(llvm::Module&) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x2723219) > #9 0x000055f3a82478f5 llvm::FPPassManager::doFinalization(llvm::Module&) (.localalias) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x15798f5) > #10 0x000055f3a8253900 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x1585900) > #11 0x000055f3a8bb57d3 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (.constprop.0) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x1ee77d3) > #12 0x000055f3a8bb76ea clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x1ee96ea) > #13 0x000055f3a9825876 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x2b57876) > #14 0x000055f3aa35c549 clang::ParseAST(clang::Sema&, bool, bool) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x368e549) > #15 0x000055f3a91ef2d9 clang::FrontendAction::Execute() (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x25212d9) > #16 0x000055f3a91903a3 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x24c23a3) > #17 0x000055f3a92a2fd8 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x25d4fd8) > #18 0x000055f3a7798815 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0xaca815) > #19 0x000055f3a77961a7 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0xac81a7) > #20 0x000055f3a9039689 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const::'lambda'()>(long) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x236b689) > #21 0x000055f3a887baa7 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x1badaa7) > #22 0x000055f3a903a802 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const (.part.0) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x236c802) > #23 0x000055f3a900fbec clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x2341bec) > #24 0x000055f3a9010679 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x2342679) > #25 0x000055f3a901e8f1 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0x23508f1) > #26 0x000055f3a7717e6f main (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0xa49e6f) > #27 0x00007f750d235d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90) > #28 0x00007f750d235e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40) > #29 0x000055f3a7795b55 _start (/home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang+0xac7b55) > clang-12: error: clang frontend command failed with exit code 139 (use -v to see invocation) > clang version 12.0.1 (https://github.com/llvm/llvm-project.git fed41342a82f5a3a9201819a82bf7a48313e296b) > Target: x86_64-unknown-linux-gnu > Thread model: posix > InstalledDir: /home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin > clang-12: note: diagnostic msg: > ******************** > > PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: > Preprocessed source(s) and associated run script(s) are located at: > clang-12: note: diagnostic msg: /tmp/conftest-968380.c > clang-12: note: diagnostic msg: /tmp/conftest-968380.sh > clang-12: note: diagnostic msg: > > ******************** > configure:8180: $? = 139 > configure: failed program was: > | /* confdefs.h */ > | #define PACKAGE_NAME "LibreOffice" > | #define PACKAGE_TARNAME "libreoffice" > | #define PACKAGE_VERSION "24.8.0.0.alpha0+" > | #define PACKAGE_STRING "LibreOffice 24.8.0.0.alpha0+" > | #define PACKAGE_BUGREPORT "" > | #define PACKAGE_URL "http://documentfoundation.org/" > | #define LIBO_VERSION_MAJOR 24 > | #define LIBO_VERSION_MINOR 8 > | #define LIBO_VERSION_MICRO 0 > | #define LIBO_VERSION_PATCH 0 > | #define LIBO_THIS_YEAR 2024 > | #define SRCDIR "/home/sberg/lo0/core" > | #define SRC_ROOT "/home/sberg/lo0/core" > | #define BUILDDIR "/home/sberg/lo0/core" > | #define USE_HEADLESS_CODE 1 > | #define ENABLE_HEADLESS 1 > | /* end confdefs.h. */ > | > | /* Does the compiler advertise C89 conformance? > | Do not test the value of __STDC__, because some compilers set it to 0 > | while being otherwise adequately conformant. */ > | #if !defined __STDC__ > | # error "Compiler does not advertise C89 conformance" > | #endif > | > | #include <stddef.h> > | #include <stdarg.h> > | struct stat; > | /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ > | struct buf { int x; }; > | struct buf * (*rcsopen) (struct buf *, struct stat *, int); > | static char *e (p, i) > | char **p; > | int i; > | { > | return p[i]; > | } > | static char *f (char * (*g) (char **, int), char **p, ...) > | { > | char *s; > | va_list v; > | va_start (v,p); > | s = g (p, va_arg (v,int)); > | va_end (v); > | return s; > | } > | > | /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has > | function prototypes and stuff, but not \xHH hex character constants. > | These do not provoke an error unfortunately, instead are silently treated > | as an "x". The following induces an error, until -std is added to get > | proper ANSI mode. Curiously \x00 != x always comes out true, for an > | array size at least. It is necessary to write \x00 == 0 to get something > | that is true only with -std. */ > | int osf4_cc_array ['\x00' == 0 ? 1 : -1]; > | > | /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters > | inside strings and character constants. */ > | #define FOO(x) 'x' > | int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; > | > | int test (int i, double x); > | struct s1 {int (*f) (int a);}; > | struct s2 {int (*f) (double a);}; > | int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), > | int, int); > | > | // Does the compiler advertise C99 conformance? > | #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L > | # error "Compiler does not advertise C99 conformance" > | #endif > | > | #include <stdbool.h> > | extern int puts (const char *); > | extern int printf (const char *, ...); > | extern int dprintf (int, const char *, ...); > | extern void *malloc (size_t); > | > | // Check varargs macros. These examples are taken from C99 6.10.3.5. > | // dprintf is used instead of fprintf to avoid needing to declare > | // FILE and stderr. > | #define debug(...) dprintf (2, __VA_ARGS__) > | #define showlist(...) puts (#__VA_ARGS__) > | #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) > | static void > | test_varargs_macros (void) > | { > | int x = 1234; > | int y = 5678; > | debug ("Flag"); > | debug ("X = %d ", x); > | showlist (The first, second, and third items.); > | report (x>y, "x is %d but y is %d", x, y); > | } > | > | // Check long long types. > | #define BIG64 18446744073709551615ull > | #define BIG32 4294967295ul > | #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) > | #if !BIG_OK > | #error "your preprocessor is broken" > | #endif > | #if BIG_OK > | #else > | #error "your preprocessor is broken" > | #endif > | static long long int bignum = -9223372036854775807LL; > | static unsigned long long int ubignum = BIG64; > | > | struct incomplete_array > | { > | int datasize; > | double data[]; > | }; > | > | struct named_init { > | int number; > | const wchar_t *name; > | double average; > | }; > | > | typedef const char *ccp; > | > | static inline int > | test_restrict (ccp restrict text) > | { > | // See if C++-style comments work. > | // Iterate through items via the restricted pointer. > | // Also check for declarations in for loops. > | for (unsigned int i = 0; *(text+i) != ' > | continue; > | return 0; > | } > | > | // Check varargs and va_copy. > | static bool > | test_varargs (const char *format, ...) > | { > | va_list args; > | va_start (args, format); > | va_list args_copy; > | va_copy (args_copy, args); > | > | const char *str = ""; > | int number = 0; > | float fnumber = 0; > | > | while (*format) > | { > | switch (*format++) > | { > | case 's': // string > | str = va_arg (args_copy, const char *); > | break; > | case 'd': // int > | number = va_arg (args_copy, int); > | break; > | case 'f': // float > | fnumber = va_arg (args_copy, double); > | break; > | default: > | break; > | } > | } > | va_end (args_copy); > | va_end (args); > | > | return *str && number && fnumber; > | } > | > | > | // Does the compiler advertise C11 conformance? > | #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L > | # error "Compiler does not advertise C11 conformance" > | #endif > | > | // Check _Alignas. > | char _Alignas (double) aligned_as_double; > | char _Alignas (0) no_special_alignment; > | extern char aligned_as_int; > | char _Alignas (0) _Alignas (int) aligned_as_int; > | > | // Check _Alignof. > | enum > | { > | int_alignment = _Alignof (int), > | int_array_alignment = _Alignof (int[100]), > | char_alignment = _Alignof (char) > | }; > | _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); > | > | // Check _Noreturn. > | int _Noreturn does_not_return (void) { for (;;) continue; } > | > | // Check _Static_assert. > | struct test_static_assert > | { > | int x; > | _Static_assert (sizeof (int) <= sizeof (long int), > | "_Static_assert does not work in struct"); > | long int y; > | }; > | > | // Check UTF-8 literals. > | #define u8 syntax error! > | char const utf8_literal[] = u8"happens to be ASCII" "another string"; > | > | // Check duplicate typedefs. > | typedef long *long_ptr; > | typedef long int *long_ptr; > | typedef long_ptr long_ptr; > | > | // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. > | struct anonymous > | { > | union { > | struct { int i; int j; }; > | struct { int k; long int l; } w; > | }; > | int m; > | } v1; > | > | > | int > | main (int argc, char **argv) > | { > | int ok = 0; > | > | ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); > | > | > | // Check bool. > | _Bool success = false; > | success |= (argc != 0); > | > | // Check restrict. > | if (test_restrict ("String literal") == 0) > | success = true; > | char *restrict newvar = "Another string"; > | > | // Check varargs. > | success &= test_varargs ("s, d' f .", "string", 65, 34.234); > | test_varargs_macros (); > | > | // Check flexible array members. > | struct incomplete_array *ia = > | malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); > | ia->datasize = 10; > | for (int i = 0; i < ia->datasize; ++i) > | ia->data[i] = i * 1.234; > | > | // Check named initializers. > | struct named_init ni = { > | .number = 34, > | .name = L"Test wide string", > | .average = 543.34343, > | }; > | > | ni.number = 58; > | > | int dynamic_array[ni.number]; > | dynamic_array[0] = argv[0][0]; > | dynamic_array[ni.number - 1] = 543; > | > | // work around unused variable warnings > | ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' > | || dynamic_array[ni.number - 1] != 543); > | > | > | _Static_assert ((offsetof (struct anonymous, i) > | == offsetof (struct anonymous, w.k)), > | "Anonymous union alignment botch"); > | v1.i = 2; > | v1.w.k = 5; > | ok |= v1.i != 5; > | > | return ok; > | } > | > configure:8180: /home/builder/lode/opt_private/clang-llvmorg-12.0.1/bin/clang -fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero -fsanitize=local-bounds -fsanitize-blacklist=/home/sberg/lo0/core/sanitize-ubsan-excludelist -std=gnu11 -c -g -O2 conftest.c >&5 > configure:8180: $? = 0 > configure:8201: result: -std=gnu11 Change-Id: I9122d0d853d0010155d57cb1d1d56f7c453d5208 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165904 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> (cherry picked from commit 42f6e89d5e6458966de452af2978f206115394af) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173098 Tested-by: allotropia jenkins <jenk...@allotropia.de> diff --git a/configure.ac b/configure.ac index 2a1c1cac8f83..1d1a80ca09b0 100644 --- a/configure.ac +++ b/configure.ac @@ -1330,8 +1330,10 @@ dnl The following checks for gcc, cc and then cl (if it weren't guarded for win3 dnl Needs to precede the AC_C_BIGENDIAN and AC_SEARCH_LIBS calls below, which apparently call dnl AC_PROG_CC internally. if test "$_os" != "WINNT"; then - # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that + # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that (and avoid -O2 during AC_PROG_CC, + # Clang 12.0.1 occasionally SEGVs on some of the test invocations during AC_PROG_CC with -O2): save_CFLAGS=$CFLAGS + CFLAGS=-g AC_PROG_CC CFLAGS=$save_CFLAGS if test -z "$CC_BASE"; then @@ -7049,8 +7051,10 @@ dnl Testing for C++ compiler and version... dnl =================================================================== if test "$_os" != "WINNT"; then - # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that + # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that (and avoid -O2 during AC_PROG_CXX, + # see AC_PROG_CC above): save_CXXFLAGS=$CXXFLAGS + CXXFLAGS=-g AC_PROG_CXX CXXFLAGS=$save_CXXFLAGS if test -z "$CXX_BASE"; then commit 1548602f06e55bf54b59497f62456e005f5df73f Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> AuthorDate: Thu Jan 12 16:47:40 2017 +0100 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon Dec 9 22:26:27 2024 +0100 Disable CrashReportUI since we don't offer upload - only want the dumps Change-Id: I6d084757d83204cb960905d7eb78571b13f8f875 (cherry picked from commit 261862f000dce95013843d4a183ad09fe1639041) (cherry picked from commit 17113410c22c1dadce05b517507a6fc0891d95ee) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 0d66a48daac7..14edacb72ecd 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -899,7 +899,8 @@ namespace { #if HAVE_FEATURE_BREAKPAD void handleCrashReport() { - static constexpr OUStringLiteral SERVICENAME_CRASHREPORT = u"com.sun.star.comp.svx.CrashReportUI"; + // Don't show the dialog since we don't offer upload - only want the dumps + /*static constexpr OUStringLiteral SERVICENAME_CRASHREPORT = u"com.sun.star.comp.svx.CrashReportUI"; css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); @@ -913,7 +914,7 @@ void handleCrashReport() css::util::URL aURL; css::uno::Any aRet = xRecoveryUI->dispatchWithReturnValue(aURL, css::uno::Sequence< css::beans::PropertyValue >()); bool bRet = false; - aRet >>= bRet; + aRet >>= bRet;*/ } #endif