Kaydet (Commit) 0659c0c8 authored tarafından Oliver-Rainer Wittmann's avatar Oliver-Rainer Wittmann Kaydeden (comit) Caolán McNamara

Related: #i123021# import of graphic bullets

consider empty graphic frames in graphic bullet area

(cherry picked from commit b16eb2a1)

Conflicts:
	sw/source/filter/ww8/ww8par.cxx

Change-Id: I242762556805b80787bc6c4305c2f735fef711d3
üst 26dc5f2e
...@@ -4807,6 +4807,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos) ...@@ -4807,6 +4807,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
delete mpRedlineStack; delete mpRedlineStack;
DeleteAnchorStk(); DeleteAnchorStk();
DeleteRefStks(); DeleteRefStks();
// For i120928,achieve the graphics from the special bookmark with is for graphic bullet // For i120928,achieve the graphics from the special bookmark with is for graphic bullet
{ {
std::vector<const SwGrfNode*> vecBulletGrf; std::vector<const SwGrfNode*> vecBulletGrf;
...@@ -4823,25 +4824,25 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos) ...@@ -4823,25 +4824,25 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
if ( pTxtNode ) if ( pTxtNode )
{ {
const SwpHints *pHints = pTxtNode->GetpSwpHints(); const SwpHints* pHints = pTxtNode->GetpSwpHints();
for(int nHintPos = 0; pHints && nHintPos < pHints->Count(); ++nHintPos) for( sal_uInt16 nHintPos = 0; pHints && nHintPos < pHints->Count(); ++nHintPos)
{ {
const SwTxtAttr *pHt = (*pHints)[nHintPos]; const SwTxtAttr *pHt = (*pHints)[nHintPos];
xub_StrLen st = *(pHt->GetStart()); const xub_StrLen st = *(pHt->GetStart());
if(pHt && pHt->Which() == RES_TXTATR_FLYCNT && (st >= ppBkmk->get()->GetMarkStart().nContent.GetIndex())) if( pHt
&& pHt->Which() == RES_TXTATR_FLYCNT
&& (st >= ppBkmk->get()->GetMarkStart().nContent.GetIndex()) )
{ {
SwFrmFmt *pFrmFmt = pHt->GetFlyCnt().GetFrmFmt(); SwFrmFmt* pFrmFmt = pHt->GetFlyCnt().GetFrmFmt();
const SwNodeIndex *pNdIdx = pFrmFmt->GetCntnt().GetCntntIdx(); vecFrmFmt.push_back(pFrmFmt);
if (pNdIdx) const SwNodeIndex* pNdIdx = pFrmFmt->GetCntnt().GetCntntIdx();
{ const SwNodes* pNodesArray = (pNdIdx != NULL)
const SwNodes &nos = pNdIdx->GetNodes(); ? &(pNdIdx->GetNodes())
const SwGrfNode *pGrf = dynamic_cast<const SwGrfNode*>(nos[pNdIdx->GetIndex() + 1]); : NULL;
if (pGrf) const SwGrfNode *pGrf = (pNodesArray != NULL)
{ ? dynamic_cast<const SwGrfNode*>((*pNodesArray)[pNdIdx->GetIndex() + 1])
vecBulletGrf.push_back(pGrf); : NULL;
vecFrmFmt.push_back(pFrmFmt); vecBulletGrf.push_back(pGrf);
}
}
} }
} }
// update graphic bullet information // update graphic bullet information
...@@ -4852,14 +4853,16 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos) ...@@ -4852,14 +4853,16 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
for (int j = 0; j < MAXLEVEL; ++j) for (int j = 0; j < MAXLEVEL; ++j)
{ {
SwNumFmt aNumFmt(pRule->Get(j)); SwNumFmt aNumFmt(pRule->Get(j));
sal_Int16 nType = aNumFmt.GetNumberingType(); const sal_Int16 nType = aNumFmt.GetNumberingType();
sal_uInt16 nGrfBulletCP = aNumFmt.GetGrfBulletCP(); const sal_uInt16 nGrfBulletCP = aNumFmt.GetGrfBulletCP();
if (nType == SVX_NUM_BITMAP && vecBulletGrf.size() > nGrfBulletCP) if ( nType == SVX_NUM_BITMAP
&& vecBulletGrf.size() > nGrfBulletCP
&& vecBulletGrf[nGrfBulletCP] != NULL )
{ {
Graphic aGraphic = vecBulletGrf[nGrfBulletCP]->GetGrf(); Graphic aGraphic = vecBulletGrf[nGrfBulletCP]->GetGrf();
SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH); SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH);
Font aFont = numfunc::GetDefBulletFont(); Font aFont = numfunc::GetDefBulletFont();
int nHeight = aFont.GetHeight() * 12;//20; int nHeight = aFont.GetHeight() * 12;
Size aPrefSize( aGraphic.GetPrefSize()); Size aPrefSize( aGraphic.GetPrefSize());
if (aPrefSize.Height() * aPrefSize.Width() != 0 ) if (aPrefSize.Height() * aPrefSize.Width() != 0 )
{ {
......
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