tdf#129382: sw: assign names to shape object styles

Empty style names for drawing object will cause problems with
udo/redo which right now refers style names instead of style
pointers.

Change-Id: If2266f1db04c624dbfdd716b5599d5f6cbb5371e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86520
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 93f82fb..d56a4a0 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -2080,7 +2080,7 @@
            text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
        // #i44344#, #i44681# - positioning attributes already set
        pFormat->PosAttrSet();
        pFormat->SetName(GetUniqueShapeName());
        pFormat->SetName(rSdrObj.GetName());

        SwDrawContact *pContact = new SwDrawContact( pFormat, &rSdrObj );
        // #i35635#
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 492faee..3b91184 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -711,7 +711,7 @@
    if (pFormat)
    {
        if (pFormat->GetName().isEmpty())
            pFormat->SetName(pDoc->GetUniqueFrameName(), false);
            pFormat->SetName(pSvxShape->GetSdrObject()->GetName(), false);
        pShape->SetFrameFormat(pFormat);
    }
    pShape->m_bDescriptor = false;