comphelper/source/misc/backupfilehelper.cxx | 6 +-- sc/qa/unit/data/ods/tdf108244.ods |binary sc/qa/unit/subsequent_export_test4.cxx | 10 +++++ sc/source/filter/xml/xmlexprt.cxx | 7 +++ ucb/source/ucp/webdav-curl/DAVProperties.cxx | 53 ++++++++++++--------------- ucb/source/ucp/webdav-curl/DAVProperties.hxx | 3 + 6 files changed, 46 insertions(+), 33 deletions(-)
New commits: commit 07f1d12f67dfcd447a75dde2b96d7c1e76432e18 Author: Markus Mohrhard <[email protected]> AuthorDate: Wed Aug 13 04:05:22 2025 +0800 Commit: Xisco Fauli <[email protected]> CommitDate: Wed Aug 13 20:11:51 2025 +0200 tdf#108244: generate note caption always at the beginning of the export Change-Id: I160f57cf43227e7a432536134da242a4b3053d4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189453 Reviewed-by: Markus Mohrhard <[email protected]> Tested-by: Jenkins (cherry picked from commit beeb2acc1c6ce3cf9b076b8e164fdbe79a0a7b51) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189474 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sc/qa/unit/data/ods/tdf108244.ods b/sc/qa/unit/data/ods/tdf108244.ods new file mode 100644 index 000000000000..7e6e3a06eb56 Binary files /dev/null and b/sc/qa/unit/data/ods/tdf108244.ods differ diff --git a/sc/qa/unit/subsequent_export_test4.cxx b/sc/qa/unit/subsequent_export_test4.cxx index a72fdda464c6..7699a881c2dd 100644 --- a/sc/qa/unit/subsequent_export_test4.cxx +++ b/sc/qa/unit/subsequent_export_test4.cxx @@ -2358,6 +2358,16 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf166939_1) assertXPath(pXmlDoc, "//table:table/table:table-row[2]", "style-name", u"r_2"); } +CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf108244) +{ + createScDoc("ods/tdf108244.ods"); + save(u"OpenDocument Spreadsheet Flat XML"_ustr); + xmlDocUniquePtr pXmlDoc = parseExportedFile(); + CPPUNIT_ASSERT(pXmlDoc); + + CPPUNIT_ASSERT_EQUAL(u"1"_ustr, getXPathContent(pXmlDoc, "count(//office:annotation)")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index fcfe6283c286..1ddf8ff1af90 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -5419,11 +5419,12 @@ void ScXMLExport::IncrementProgressBar(bool bFlush, sal_Int32 nInc) ErrCode ScXMLExport::exportDoc( enum XMLTokenEnum eClass ) { + ScDocument* pDoc = GetDocument(); if( getExportFlags() & (SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::STYLES| SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) ) { uno::Reference< frame::XModel > xModel = GetModel(); - if (ScDocument* pDoc = GetDocument()) + if (pDoc) { // if source doc was Excel then auto pFoundShell = comphelper::getFromUnoTunnel<SfxObjectShell>(xModel); @@ -5463,6 +5464,10 @@ ErrCode ScXMLExport::exportDoc( enum XMLTokenEnum eClass ) } } } + if (pDoc) + { + pDoc->CreateAllNoteCaptions(); + } return SvXMLExport::exportDoc( eClass ); } commit aa13ea790a6aa8462d9698d828638d637a4bfacc Author: Caolán McNamara <[email protected]> AuthorDate: Wed Jul 30 11:16:11 2025 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Wed Aug 13 20:11:44 2025 +0200 cid#1660121 Resource leak and cid#1660097 Resource leak Change-Id: Ife9963022f93f1288439928156a10a10dc25da9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188592 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit 96939c730332d4f65d02bd633bb0c8bf1bbad5d4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189491 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/ucb/source/ucp/webdav-curl/DAVProperties.cxx b/ucb/source/ucp/webdav-curl/DAVProperties.cxx index bd0be1a862c4..85f5bb44fc66 100644 --- a/ucb/source/ucp/webdav-curl/DAVProperties.cxx +++ b/ucb/source/ucp/webdav-curl/DAVProperties.cxx @@ -31,31 +31,31 @@ void DAVProperties::createSerfPropName( ::std::u16string_view const rFullName, { if (o3tl::starts_with(rFullName, u"DAV:")) { - rName.nspace = "DAV:"; + rName.nspace = "DAV:"_ostr; rName.name - = strdup( OUStringToOString( - rFullName.substr(RTL_CONSTASCII_LENGTH("DAV:")), - RTL_TEXTENCODING_UTF8 ).getStr() ); + = OUStringToOString( + rFullName.substr(RTL_CONSTASCII_LENGTH("DAV:")), + RTL_TEXTENCODING_UTF8 ); } else if (o3tl::starts_with(rFullName, u"http://apache.org/dav/props/")) { - rName.nspace = "http://apache.org/dav/props/"; - rName.name - = strdup( OUStringToOString( - rFullName.substr( - RTL_CONSTASCII_LENGTH( - "http://apache.org/dav/props/" ) ), - RTL_TEXTENCODING_UTF8 ).getStr() ); + rName.nspace = "http://apache.org/dav/props/"_ostr; + rName.name = + OUStringToOString( + rFullName.substr( + RTL_CONSTASCII_LENGTH( + "http://apache.org/dav/props/" ) ), + RTL_TEXTENCODING_UTF8 ); } else if (o3tl::starts_with(rFullName, u"http://ucb.openoffice.org/dav/props/")) { - rName.nspace = "http://ucb.openoffice.org/dav/props/"; - rName.name - = strdup( OUStringToOString( - rFullName.substr( - RTL_CONSTASCII_LENGTH( - "http://ucb.openoffice.org/dav/props/" ) ), - RTL_TEXTENCODING_UTF8 ).getStr() ); + rName.nspace = "http://ucb.openoffice.org/dav/props/"_ostr; + rName.name = + OUStringToOString( + rFullName.substr( + RTL_CONSTASCII_LENGTH( + "http://ucb.openoffice.org/dav/props/" ) ), + RTL_TEXTENCODING_UTF8 ); } else if (o3tl::starts_with(rFullName, u"<prop:")) { @@ -68,11 +68,11 @@ void DAVProperties::createSerfPropName( ::std::u16string_view const rFullName, sal_Int32 nStart = RTL_CONSTASCII_LENGTH( "<prop:" ); sal_Int32 nLen = aFullName.indexOf( ' ' ) - nStart; - rName.name = strdup( aFullName.copy( nStart, nLen ).getStr() ); + rName.name = aFullName.copy( nStart, nLen ); nStart = aFullName.indexOf( '=', nStart + nLen ) + 2; // after =" nLen = aFullName.getLength() - RTL_CONSTASCII_LENGTH( "\">" ) - nStart; - rName.nspace = strdup( aFullName.copy( nStart, nLen ).getStr() ); + rName.nspace = aFullName.copy( nStart, nLen ); } else { @@ -80,10 +80,10 @@ void DAVProperties::createSerfPropName( ::std::u16string_view const rFullName, // to the "<prop:" form above assert(rFullName.find(':') == ::std::u16string_view::npos); // Add our namespace to our own properties. - rName.nspace = "http://ucb.openoffice.org/dav/props/"; - rName.name - = strdup( OUStringToOString( rFullName, - RTL_TEXTENCODING_UTF8 ).getStr() ); + rName.nspace = "http://ucb.openoffice.org/dav/props/"_ostr; + rName.name = + OUStringToOString( rFullName, + RTL_TEXTENCODING_UTF8 ); } } @@ -154,10 +154,7 @@ void DAVProperties::createUCBPropName( const char * nspace, // static bool DAVProperties::isUCBDeadProperty( const SerfPropName & rName ) { - return ( rName.nspace && - ( rtl_str_compareIgnoreAsciiCase( - rName.nspace, "http://ucb.openoffice.org/dav/props/" ) - == 0 ) ); + return rName.nspace.equalsIgnoreAsciiCase("http://ucb.openoffice.org/dav/props/"); } bool DAVProperties::isUCBSpecialProperty(std::u16string_view rFullName, OUString& rParsedName) diff --git a/ucb/source/ucp/webdav-curl/DAVProperties.hxx b/ucb/source/ucp/webdav-curl/DAVProperties.hxx index 8466692612a0..392177b0870c 100644 --- a/ucb/source/ucp/webdav-curl/DAVProperties.hxx +++ b/ucb/source/ucp/webdav-curl/DAVProperties.hxx @@ -21,11 +21,12 @@ #pragma once #include <rtl/ustring.hxx> +#include <rtl/string.hxx> namespace http_dav_ucp { -typedef struct { const char *nspace, *name; } SerfPropName; +typedef struct { OString nspace; OString name; } SerfPropName; struct DAVProperties { commit ae0897f051e45a08c3d53c9973b9a8049eecc974 Author: Caolán McNamara <[email protected]> AuthorDate: Wed Jul 30 10:59:23 2025 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Wed Aug 13 20:11:38 2025 +0200 cid#1660391 Resource leak Change-Id: Iddabd4ab9c06f508bd328d34013d038ebc039020 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188590 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit 5bae1a972389eba54d2806171c226649a23c2a57) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189493 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/comphelper/source/misc/backupfilehelper.cxx b/comphelper/source/misc/backupfilehelper.cxx index 76fdfb6da6bb..9ec924f051af 100644 --- a/comphelper/source/misc/backupfilehelper.cxx +++ b/comphelper/source/misc/backupfilehelper.cxx @@ -896,13 +896,13 @@ namespace nSize -= nToTransfer; } + } #if !defined Z_PREFIX - deflateEnd(&zstream); + deflateEnd(&zstream); #else - z_deflateEnd(&zstream); + z_deflateEnd(&zstream); #endif - } } maFile->close();
