Kaydet (Commit) 432f605e authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#101000 ensure unique image names in .docs

Change-Id: Id4f93638ad366b66968e6946a835239beee16942
üst d2b014ed
...@@ -30,8 +30,9 @@ ...@@ -30,8 +30,9 @@
#include <sfx2/docfile.hxx> #include <sfx2/docfile.hxx>
#include <sfx2/fcontnr.hxx> #include <sfx2/fcontnr.hxx>
#include <grfatr.hxx> #include <grfatr.hxx>
#include <fmtflcnt.hxx>
#include <fmtanchr.hxx> #include <fmtanchr.hxx>
#include <fmtcntnt.hxx>
#include <fmtflcnt.hxx>
#include <frmfmt.hxx> #include <frmfmt.hxx>
#include <fltshell.hxx> #include <fltshell.hxx>
#include <pam.hxx> #include <pam.hxx>
...@@ -455,6 +456,19 @@ void SwWW8ImplReader::PicRead(SvStream *pDataStream, WW8_PIC *pPic, ...@@ -455,6 +456,19 @@ void SwWW8ImplReader::PicRead(SvStream *pDataStream, WW8_PIC *pPic,
pDataStream->SeekRel(2); //cProps pDataStream->SeekRel(2); //cProps
} }
namespace
{
SwNodeType GetNodeType(SwFrameFormat &rSource)
{
const SwNodeIndex* pNodeIndex = rSource.GetContent().GetContentIdx();
if (!pNodeIndex)
return SwNodeType::NONE;
const SwNode& rCSttNd = pNodeIndex->GetNode();
SwNodeRange aRg(rCSttNd, 1, *rCSttNd.EndOfSectionNode());
return aRg.aStart.GetNode().GetNodeType();
}
}
SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj, SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj,
SwFrameFormat* pOldFlyFormat) SwFrameFormat* pOldFlyFormat)
{ {
...@@ -671,12 +685,11 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj, ...@@ -671,12 +685,11 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj,
if (pRecord) if (pRecord)
SetAttributesAtGrfNode(pRecord, pRet, nullptr); SetAttributesAtGrfNode(pRecord, pRet, nullptr);
// #i68101# OUString aObjectName(pObject->GetName());
// removed pObject->HasSetName() usage since always returned if (aObjectName.isEmpty() || !m_rDoc.FindFlyByName(aObjectName, GetNodeType(*pRet)))
// true, also removed else-part and wrote an informing mail pRet->SetName(aObjectName);
// to Henning Brinkmann about this to clarify. else
pRet->SetName(pObject->GetName()); m_aGrfNameGenerator.SetUniqueGraphName(pRet, aObjectName);
// determine the pointer to the new object and update // determine the pointer to the new object and update
// Z-order-list accordingly (or delete entry) // Z-order-list accordingly (or delete entry)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment