make FillFrames a member
Change-Id: I1582705ce3ae9cc7bbe33789a1626e8d7d3853cf
This commit is contained in:
@@ -1610,6 +1610,7 @@ struct SwXParaFrameEnumerationImpl SAL_FINAL : public SwXParaFrameEnumeration
|
|||||||
m_vFrames.erase(iter, m_vFrames.end());
|
m_vFrames.erase(iter, m_vFrames.end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void FillFrame();
|
||||||
bool CreateNextObject();
|
bool CreateNextObject();
|
||||||
uno::Reference< text::XTextContent > m_xNextObject;
|
uno::Reference< text::XTextContent > m_xNextObject;
|
||||||
FrameClientList_t m_vFrames;
|
FrameClientList_t m_vFrames;
|
||||||
@@ -1617,23 +1618,6 @@ struct SwXParaFrameEnumerationImpl SAL_FINAL : public SwXParaFrameEnumeration
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Search for a FLYCNT text attribute at the cursor point and fill the frame
|
|
||||||
// into the array
|
|
||||||
static void
|
|
||||||
lcl_FillFrame(SwUnoCrsr& rUnoCrsr, FrameClientList_t & rFrames)
|
|
||||||
{
|
|
||||||
// search for objects at the cursor - anchored at/as char
|
|
||||||
SwTextAttr const*const pTextAttr = (rUnoCrsr.GetNode().IsTextNode())
|
|
||||||
? rUnoCrsr.GetNode().GetTextNode()->GetTextAttrForCharAt(
|
|
||||||
rUnoCrsr.GetPoint()->nContent.GetIndex(), RES_TXTATR_FLYCNT)
|
|
||||||
: 0;
|
|
||||||
if (pTextAttr)
|
|
||||||
{
|
|
||||||
const SwFormatFlyCnt& rFlyCnt = pTextAttr->GetFlyCnt();
|
|
||||||
SwFrameFormat * const pFrameFormat = rFlyCnt.GetFrameFormat();
|
|
||||||
rFrames.push_back(std::shared_ptr<sw::FrameClient>(new sw::FrameClient(pFrameFormat)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SwXParaFrameEnumeration* SwXParaFrameEnumeration::Create(const SwPaM& rPaM, const enum ParaFrameMode eParaFrameMode, SwFrameFormat* const pFormat)
|
SwXParaFrameEnumeration* SwXParaFrameEnumeration::Create(const SwPaM& rPaM, const enum ParaFrameMode eParaFrameMode, SwFrameFormat* const pFormat)
|
||||||
{ return new SwXParaFrameEnumerationImpl(rPaM, eParaFrameMode, pFormat); }
|
{ return new SwXParaFrameEnumerationImpl(rPaM, eParaFrameMode, pFormat); }
|
||||||
@@ -1676,11 +1660,26 @@ SwXParaFrameEnumerationImpl::SwXParaFrameEnumerationImpl(
|
|||||||
m_vFrames.push_back(std::shared_ptr<sw::FrameClient>(new sw::FrameClient(pFrameFormat)));
|
m_vFrames.push_back(std::shared_ptr<sw::FrameClient>(new sw::FrameClient(pFrameFormat)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FillFrame();
|
||||||
lcl_FillFrame(*GetCursor(), m_vFrames);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Search for a FLYCNT text attribute at the cursor point and fill the frame
|
||||||
|
// into the array
|
||||||
|
void SwXParaFrameEnumerationImpl::FillFrame()
|
||||||
|
{
|
||||||
|
if(!m_pUnoCursor->GetNode().IsTextNode())
|
||||||
|
return;
|
||||||
|
// search for objects at the cursor - anchored at/as char
|
||||||
|
const auto pTextAttr = m_pUnoCursor->GetNode().GetTextNode()->GetTextAttrForCharAt(
|
||||||
|
m_pUnoCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FLYCNT);
|
||||||
|
if(!pTextAttr)
|
||||||
|
return;
|
||||||
|
const SwFormatFlyCnt& rFlyCnt = pTextAttr->GetFlyCnt();
|
||||||
|
SwFrameFormat* const pFrameFormat = rFlyCnt.GetFrameFormat();
|
||||||
|
m_vFrames.push_back(std::shared_ptr<sw::FrameClient>(new sw::FrameClient(pFrameFormat)));
|
||||||
|
}
|
||||||
|
|
||||||
bool SwXParaFrameEnumerationImpl::CreateNextObject()
|
bool SwXParaFrameEnumerationImpl::CreateNextObject()
|
||||||
{
|
{
|
||||||
if (!m_vFrames.size())
|
if (!m_vFrames.size())
|
||||||
@@ -1697,10 +1696,8 @@ bool SwXParaFrameEnumerationImpl::CreateNextObject()
|
|||||||
{
|
{
|
||||||
SdrObject* const pSdr = pContact->GetMaster();
|
SdrObject* const pSdr = pContact->GetMaster();
|
||||||
if (pSdr)
|
if (pSdr)
|
||||||
{
|
|
||||||
m_xNextObject.set(pSdr->getUnoShape(), uno::UNO_QUERY);
|
m_xNextObject.set(pSdr->getUnoShape(), uno::UNO_QUERY);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
|
const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
|
||||||
|
Reference in New Issue
Block a user