diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx index 6011e47c8f98..808bce851676 100644 --- a/sd/source/ui/dlg/sdpreslt.cxx +++ b/sd/source/ui/dlg/sdpreslt.cxx @@ -119,15 +119,18 @@ void SdPresLayoutDlg::GetAttr(SfxItemSet& rOutAttrs) OUString aLayoutName; - if( bLoad ) + if (nIndex >= 0) { - aLayoutName = maName + "#" + maLayoutNames.at(nIndex); - } - else if (nIndex >= 0) - { - aLayoutName = maLayoutNames.at(nIndex); - if( aLayoutName == maStrNone ) - aLayoutName.clear(); // that way we encode "- nothing -" (see below) + if( bLoad ) + { + aLayoutName = maName + "#" + maLayoutNames.at(nIndex); + } + else + { + aLayoutName = maLayoutNames.at(nIndex); + if( aLayoutName == maStrNone ) + aLayoutName.clear(); // that way we encode "- nothing -" (see below) + } } rOutAttrs.Put( SfxStringItem( ATTR_PRESLAYOUT_NAME, aLayoutName ) );