diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-04-07 22:20:49 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-04-14 14:40:29 +0200 |
commit | 80523c8ffe895bf6778299af1aac2183e68ea1bc (patch) | |
tree | 9b643ec8cc61cb8b23243359563b3a33a1b8f535 /xmloff | |
parent | 70fad439621979ea76f2fe8cfcbd66955ea2f0c2 (diff) |
tdf#89802: xmloff: fix ODF import of frame with empty style name ref
draw:fill-gradient-name="" in the graphic properties now causes
BaseFrameProperties_Impl::FillBaseProperties() to fail and prevent
insertion of the SwXTextFrame.
(regression from 6e61ecd09679a66060f932835622821d39e92f01)
(cherry picked from commit db1d278dcc308c73eb5edebc20481c96e7f479d8)
Change-Id: I9b4f3ddb0f0e1b3a80e86bbdc1af2dade1c8edf7
Reviewed-on: https://gerrit.libreoffice.org/15192
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/XMLShapeStyleContext.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/xmloff/source/draw/XMLShapeStyleContext.cxx b/xmloff/source/draw/XMLShapeStyleContext.cxx index 720ac4cf4883..0dc8371a1944 100644 --- a/xmloff/source/draw/XMLShapeStyleContext.cxx +++ b/xmloff/source/draw/XMLShapeStyleContext.cxx @@ -238,6 +238,20 @@ void XMLShapeStyleContext::FillPropertySet( const Reference< beans::XPropertySet OUString sStyleName; rState.maValue >>= sStyleName; sStyleName = GetImport().GetStyleDisplayName( aFamilies[i], sStyleName ); + // All of these attributes refer to something with draw:name + // of type styleName = NCName which is non-empty. + // tdf#89802: for Writer frames there would be no exception here but + // it will fail later on attach() and take out the entire frame + if (sStyleName.isEmpty()) + { + Sequence<OUString> seq(1); + seq[0] = sStyleName; + GetImport().SetError( + XMLERROR_STYLE_PROP_VALUE | XMLERROR_FLAG_WARNING, + seq, "empty style name reference", NULL ); + break; + } + try { |