summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/GraphicImport.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'writerfilter/source/dmapper/GraphicImport.cxx')
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index f9c8b453a617..891f26f95c43 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -367,11 +367,12 @@ public:
{
try
{
- // Ask the graphic naming helper to find out the name for this
- // object: It's around till the end of the import, so it remembers
- // what's the first free name.
- uno::Reference< container::XNamed > xNamed( xGraphicObjectProperties, uno::UNO_QUERY_THROW );
- xNamed->setName(rDomainMapper.GetGraphicNamingHelper().NameGraphic(sName));
+ if (!sName.isEmpty())
+ {
+ uno::Reference<container::XNamed> const xNamed(xGraphicObjectProperties, uno::UNO_QUERY_THROW);
+ xNamed->setName(sName);
+ }
+ // else: name is automatically generated by SwDoc::MakeFlySection_()
xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_DESCRIPTION ),
uno::makeAny( sAlternativeText ));