online.git: engine/xmloff

0 views
Skip to first unread message

"Caolán McNamara (via cogerrit)"

unread,
May 15, 2026, 3:54:33 PM (10 days ago) May 15
to collaboraon...@googlegroups.com
engine/xmloff/source/text/XMLFootnoteImportContext.cxx | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit e060ac2fcc65ebd7b308066a3fbc579782a494f4
Author: Caolán McNamara <caolan....@collabora.com>
AuthorDate: Fri May 15 09:53:25 2026 +0000
Commit: Caolán McNamara <caolan....@collabora.com>
CommitDate: Fri May 15 19:54:12 2026 +0000

ofz#513256641 Null-dereference READ

Bail when the factory does not provide a Footnote/Endnote service, which
happens when a text:note element is seen while importing into
Calc/Impress.

Then extend the mbListContextPushed check to cover the whole
endFastElement body. Originally that was already the case at:

commit 530897d64bdedae156cf91697ae29dfb47e3809d
Date: Wed Oct 1 06:34:11 2008 +0000

CWS-TOOLING: integrate CWS swlists02

but at:

commit 5f4938d89d641681346001746f3762dffcb831b4
Date: Wed Nov 15 10:03:54 2017 +0200

loplugin:flatten in xmloff

the early return, left DeleteParagraph and SetCursor(xOldCursor)
reachable on the !xFactory.is() path

Signed-off-by: Caolán McNamara <caolan....@collabora.com>
Change-Id: Ibcaa525e314833660aa90bcbfe66461d626718cd
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2678
Tested-by: Jenkins CPCI <rel...@collaboraoffice.com>
Reviewed-by: Michael Stahl <michae...@collabora.com>

diff --git a/engine/xmloff/source/text/XMLFootnoteImportContext.cxx b/engine/xmloff/source/text/XMLFootnoteImportContext.cxx
index 4ed72b6d7fd0..d1ccd266ed91 100644
--- a/engine/xmloff/source/text/XMLFootnoteImportContext.cxx
+++ b/engine/xmloff/source/text/XMLFootnoteImportContext.cxx
@@ -81,6 +81,13 @@ void XMLFootnoteImportContext::startFastElement(

// attach footnote to document
Reference<XTextContent> xTextContent(xIfc, UNO_QUERY);
+ if (!xTextContent.is())
+ {
+ // e.g. Calc/Impress model
+ SAL_WARN("xmloff.text", "skipping footnote: service unavailable");
+ mbIsValid = false;
+ return;
+ }
rHelper.InsertTextContent(xTextContent);

// process id attribute
@@ -127,6 +134,9 @@ void XMLFootnoteImportContext::startFastElement(

void XMLFootnoteImportContext::endFastElement(sal_Int32 )
{
+ if (!mbListContextPushed)
+ return;
+
// get rid of last dummy paragraph
rHelper.DeleteParagraph();

@@ -134,9 +144,7 @@ void XMLFootnoteImportContext::endFastElement(sal_Int32 )
rHelper.SetCursor(xOldCursor);

// reinstall old list item
- if (mbListContextPushed) {
- rHelper.PopListContext();
- }
+ rHelper.PopListContext();
}

css::uno::Reference< css::xml::sax::XFastContextHandler > XMLFootnoteImportContext::createFastChildContext(

"Méven Car (via cogerrit)"

unread,
4:04 AM (13 hours ago) 4:04 AM
to collaboraon...@googlegroups.com
engine/xmloff/source/chart/SchXMLExport.cxx | 1 -
engine/xmloff/source/style/xmlnume.cxx | 2 +-
engine/xmloff/source/text/XMLTextListAutoStylePool.cxx | 7 +++----
3 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit a8df16a579fd0202460fd66370a7e86261437bb9
Author: Méven Car <meve...@collabora.com>
AuthorDate: Thu May 21 12:54:06 2026 +0000
Commit: Tomaž Vajngerl <tomaz.v...@collabora.com>
CommitDate: Mon May 25 08:03:49 2026 +0000

xmloff: stop warning on legitimate no-style-families and no-data-provider cases

When loading a flat ODF (.fodt) that contains embedded objects, each
embedded object is split into its own storage by re-serialising the
inlined XML through the regular ODF exporter. Two SAL_WARN_IF lines
in that path fire under normal conditions:

* XMLTextListAutoStylePool's constructor is invoked for every
SvXMLExport, including sub-exports (chart, embedded ...) whose
model legitimately does not implement XStyleFamiliesSupplier.
Bail out silently in that case - there is nothing to pre-register.
The same diagnostic is still emitted at the top-level styles.xml
export path (xmlnume.cxx), where a null supplier really is
suspicious.

* SchXMLExportHelper_Impl::InitRangeSegmentationProperties warned
about charts with no external XDataProvider - i.e. charts that
own their data internally, the common case for Writer-embedded
charts.

While here, fix the pre-existing copy-paste typo in xmlnume.cxx that
re-checked xFamiliesSupp instead of the freshly-fetched xFamilies.

Signed-off-by: Méven Car <meve...@collabora.com>
Change-Id: Ic7bfc5014efed32ae7e3350b5ce988fa5b44d833
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3076
Tested-by: Jenkins CPCI <rel...@collaboraoffice.com>
Reviewed-by: Tomaž Vajngerl <tomaz.v...@collabora.com>

diff --git a/engine/xmloff/source/chart/SchXMLExport.cxx b/engine/xmloff/source/chart/SchXMLExport.cxx
index 59d3e27eca3f..182a78f23c0e 100644
--- a/engine/xmloff/source/chart/SchXMLExport.cxx
+++ b/engine/xmloff/source/chart/SchXMLExport.cxx
@@ -4082,7 +4082,6 @@ void SchXMLExportHelper_Impl::InitRangeSegmentationProperties( const Reference<
try
{
Reference< chart2::data::XDataProvider > xDataProvider( xChartDoc->getDataProvider() );
- SAL_WARN_IF( !xDataProvider.is(), "xmloff.chart", "No DataProvider" );
if( xDataProvider.is())
{
Reference< chart2::data::XDataSource > xDataSource( lcl_pressUsedDataIntoRectangularFormat( xChartDoc, mbHasCategoryLabels ));
diff --git a/engine/xmloff/source/style/xmlnume.cxx b/engine/xmloff/source/style/xmlnume.cxx
index 7a56e5e9e3c0..af8626708712 100644
--- a/engine/xmloff/source/style/xmlnume.cxx
+++ b/engine/xmloff/source/style/xmlnume.cxx
@@ -802,7 +802,7 @@ void SvxXMLNumRuleExport::exportStyles( bool bUsed, bool bExportChapterNumbering
return;

Reference< XNameAccess > xFamilies( xFamiliesSupp->getStyleFamilies() );
- SAL_WARN_IF( !xFamiliesSupp.is(), "xmloff", "getStyleFamilies() from XModel failed for export!" );
+ SAL_WARN_IF( !xFamilies.is(), "xmloff", "getStyleFamilies() from XModel failed for export!" );

if( !xFamilies.is() )
return;
diff --git a/engine/xmloff/source/text/XMLTextListAutoStylePool.cxx b/engine/xmloff/source/text/XMLTextListAutoStylePool.cxx
index c347345b6228..a7cd1dc86650 100644
--- a/engine/xmloff/source/text/XMLTextListAutoStylePool.cxx
+++ b/engine/xmloff/source/text/XMLTextListAutoStylePool.cxx
@@ -158,11 +158,10 @@ XMLTextListAutoStylePool::XMLTextListAutoStylePool( SvXMLExport& rExp ) :
m_sPrefix = "ML";

Reference<XStyleFamiliesSupplier> xFamiliesSupp(m_rExport.GetModel(), UNO_QUERY);
- SAL_WARN_IF(!xFamiliesSupp.is(), "xmloff", "getStyleFamilies() from XModel failed for export!");
- Reference< XNameAccess > xFamilies;
- if (xFamiliesSupp.is())
- xFamilies = xFamiliesSupp->getStyleFamilies();
+ if (!xFamiliesSupp.is())
+ return;

+ Reference<XNameAccess> xFamilies = xFamiliesSupp->getStyleFamilies();
Reference<XIndexAccess> xStyles;
static constexpr OUString aNumberStyleName(u"NumberingStyles"_ustr);
if (xFamilies.is() && xFamilies->hasByName(aNumberStyleName))

Reply all
Reply to author
Forward
0 new messages