INTEGRATION: CWS impressodf12 (1.26.24); FILE MERGED
2008/04/25 08:59:48 cl 1.26.24.3: RESYNC: (1.26-1.27); FILE MERGED 2008/04/24 15:26:52 cl 1.26.24.2: #i35937# removed different offsets in presentation numbering rules 2008/04/10 16:50:54 cl 1.26.24.1: #i35937# allow paragraph depth of -1 to switch of numbering
This commit is contained in:
parent
086b63906f
commit
01af39f7a7
@ -7,7 +7,7 @@
|
|||||||
* OpenOffice.org - a multi-platform office productivity suite
|
* OpenOffice.org - a multi-platform office productivity suite
|
||||||
*
|
*
|
||||||
* $RCSfile: numitem.cxx,v $
|
* $RCSfile: numitem.cxx,v $
|
||||||
* $Revision: 1.27 $
|
* $Revision: 1.28 $
|
||||||
*
|
*
|
||||||
* This file is part of OpenOffice.org.
|
* This file is part of OpenOffice.org.
|
||||||
*
|
*
|
||||||
@ -958,7 +958,10 @@ int SvxNumRule::operator==( const SvxNumRule& rCopy) const
|
|||||||
const SvxNumberFormat* SvxNumRule::Get(USHORT nLevel)const
|
const SvxNumberFormat* SvxNumRule::Get(USHORT nLevel)const
|
||||||
{
|
{
|
||||||
DBG_ASSERT(nLevel < SVX_MAX_NUM, "falsches Level" )
|
DBG_ASSERT(nLevel < SVX_MAX_NUM, "falsches Level" )
|
||||||
|
if( nLevel < SVX_MAX_NUM )
|
||||||
return aFmtsSet[nLevel] ? aFmts[nLevel] : 0;
|
return aFmtsSet[nLevel] ? aFmts[nLevel] : 0;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
/* -----------------02.11.98 09:10-------------------
|
/* -----------------02.11.98 09:10-------------------
|
||||||
*
|
*
|
||||||
@ -972,7 +975,8 @@ const SvxNumberFormat& SvxNumRule::GetLevel(USHORT nLevel)const
|
|||||||
}
|
}
|
||||||
|
|
||||||
DBG_ASSERT(nLevel < SVX_MAX_NUM, "falsches Level" )
|
DBG_ASSERT(nLevel < SVX_MAX_NUM, "falsches Level" )
|
||||||
return aFmts[nLevel] ?
|
|
||||||
|
return ( ( nLevel < SVX_MAX_NUM ) && aFmts[nLevel] ) ?
|
||||||
*aFmts[nLevel] : eNumberingType == SVX_RULETYPE_NUMBERING ?
|
*aFmts[nLevel] : eNumberingType == SVX_RULETYPE_NUMBERING ?
|
||||||
*pStdNumFmt : *pStdOutlineNumFmt;
|
*pStdNumFmt : *pStdOutlineNumFmt;
|
||||||
}
|
}
|
||||||
@ -982,7 +986,9 @@ const SvxNumberFormat& SvxNumRule::GetLevel(USHORT nLevel)const
|
|||||||
* --------------------------------------------------*/
|
* --------------------------------------------------*/
|
||||||
void SvxNumRule::SetLevel( USHORT i, const SvxNumberFormat& rNumFmt, BOOL bIsValid )
|
void SvxNumRule::SetLevel( USHORT i, const SvxNumberFormat& rNumFmt, BOOL bIsValid )
|
||||||
{
|
{
|
||||||
if( !aFmtsSet[i] || !(rNumFmt == *Get( i )) )
|
DBG_ASSERT(i < SVX_MAX_NUM, "falsches Level" )
|
||||||
|
|
||||||
|
if( (i < SVX_MAX_NUM) && (!aFmtsSet[i] || !(rNumFmt == *Get( i ))) )
|
||||||
{
|
{
|
||||||
delete aFmts[ i ];
|
delete aFmts[ i ];
|
||||||
aFmts[ i ] = new SvxNumberFormat( rNumFmt );
|
aFmts[ i ] = new SvxNumberFormat( rNumFmt );
|
||||||
@ -994,6 +1000,10 @@ void SvxNumRule::SetLevel( USHORT i, const SvxNumberFormat& rNumFmt, BOOL bIsVal
|
|||||||
*
|
*
|
||||||
* --------------------------------------------------*/
|
* --------------------------------------------------*/
|
||||||
void SvxNumRule::SetLevel(USHORT nLevel, const SvxNumberFormat* pFmt)
|
void SvxNumRule::SetLevel(USHORT nLevel, const SvxNumberFormat* pFmt)
|
||||||
|
{
|
||||||
|
DBG_ASSERT(nLevel < SVX_MAX_NUM, "falsches Level" )
|
||||||
|
|
||||||
|
if( nLevel < SVX_MAX_NUM )
|
||||||
{
|
{
|
||||||
aFmtsSet[nLevel] = 0 != pFmt;
|
aFmtsSet[nLevel] = 0 != pFmt;
|
||||||
if(pFmt)
|
if(pFmt)
|
||||||
@ -1004,6 +1014,7 @@ void SvxNumRule::SetLevel(USHORT nLevel, const SvxNumberFormat* pFmt)
|
|||||||
aFmts[nLevel] = 0;
|
aFmts[nLevel] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* -----------------28.10.98 15:38-------------------
|
/* -----------------28.10.98 15:38-------------------
|
||||||
*
|
*
|
||||||
* --------------------------------------------------*/
|
* --------------------------------------------------*/
|
||||||
@ -1220,18 +1231,8 @@ SvxNumRule* SvxConvertNumRule( const SvxNumRule* pRule, USHORT nLevels, SvxNumRu
|
|||||||
const USHORT nSrcLevels = pRule->GetLevelCount();
|
const USHORT nSrcLevels = pRule->GetLevelCount();
|
||||||
SvxNumRule* pNewRule = new SvxNumRule( pRule->GetFeatureFlags(), nLevels, pRule->IsContinuousNumbering(), eType );
|
SvxNumRule* pNewRule = new SvxNumRule( pRule->GetFeatureFlags(), nLevels, pRule->IsContinuousNumbering(), eType );
|
||||||
|
|
||||||
// move all levels one level up if the destination is a presentation numbering and the source is not
|
for( USHORT nLevel = 0; (nLevel < nLevels) && (nLevel < nSrcLevels); nLevel++ )
|
||||||
const sal_Bool bConvertUp = pRule->GetNumRuleType() != SVX_RULETYPE_PRESENTATION_NUMBERING &&
|
pNewRule->SetLevel( nLevel, pRule->GetLevel( nLevel ) );
|
||||||
eType == SVX_RULETYPE_PRESENTATION_NUMBERING;
|
|
||||||
|
|
||||||
// move all levels one level down if the source is a presentation numbering and the destination is not
|
|
||||||
const sal_Bool bConvertDown = pRule->GetNumRuleType() == SVX_RULETYPE_PRESENTATION_NUMBERING &&
|
|
||||||
eType != SVX_RULETYPE_PRESENTATION_NUMBERING;
|
|
||||||
|
|
||||||
USHORT nSrcLevel = bConvertDown ? 1 : 0;
|
|
||||||
USHORT nDstLevel = bConvertUp ? 1 : 0;
|
|
||||||
for( ; (nDstLevel < nLevels) && (nSrcLevel < nSrcLevels); nSrcLevel++, nDstLevel++ )
|
|
||||||
pNewRule->SetLevel( nDstLevel, pRule->GetLevel( nSrcLevel ) );
|
|
||||||
|
|
||||||
return pNewRule;
|
return pNewRule;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user