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
|
||||
*
|
||||
* $RCSfile: numitem.cxx,v $
|
||||
* $Revision: 1.27 $
|
||||
* $Revision: 1.28 $
|
||||
*
|
||||
* 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
|
||||
{
|
||||
DBG_ASSERT(nLevel < SVX_MAX_NUM, "falsches Level" )
|
||||
if( nLevel < SVX_MAX_NUM )
|
||||
return aFmtsSet[nLevel] ? aFmts[nLevel] : 0;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
/* -----------------02.11.98 09:10-------------------
|
||||
*
|
||||
@ -972,7 +975,8 @@ const SvxNumberFormat& SvxNumRule::GetLevel(USHORT nLevel)const
|
||||
}
|
||||
|
||||
DBG_ASSERT(nLevel < SVX_MAX_NUM, "falsches Level" )
|
||||
return aFmts[nLevel] ?
|
||||
|
||||
return ( ( nLevel < SVX_MAX_NUM ) && aFmts[nLevel] ) ?
|
||||
*aFmts[nLevel] : eNumberingType == SVX_RULETYPE_NUMBERING ?
|
||||
*pStdNumFmt : *pStdOutlineNumFmt;
|
||||
}
|
||||
@ -982,7 +986,9 @@ const SvxNumberFormat& SvxNumRule::GetLevel(USHORT nLevel)const
|
||||
* --------------------------------------------------*/
|
||||
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 ];
|
||||
aFmts[ i ] = new SvxNumberFormat( rNumFmt );
|
||||
@ -995,6 +1001,10 @@ void SvxNumRule::SetLevel( USHORT i, const SvxNumberFormat& rNumFmt, BOOL bIsVal
|
||||
* --------------------------------------------------*/
|
||||
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;
|
||||
if(pFmt)
|
||||
SetLevel(nLevel, *pFmt);
|
||||
@ -1003,6 +1013,7 @@ void SvxNumRule::SetLevel(USHORT nLevel, const SvxNumberFormat* pFmt)
|
||||
delete aFmts[nLevel];
|
||||
aFmts[nLevel] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* -----------------28.10.98 15:38-------------------
|
||||
*
|
||||
@ -1220,18 +1231,8 @@ SvxNumRule* SvxConvertNumRule( const SvxNumRule* pRule, USHORT nLevels, SvxNumRu
|
||||
const USHORT nSrcLevels = pRule->GetLevelCount();
|
||||
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
|
||||
const sal_Bool bConvertUp = pRule->GetNumRuleType() != SVX_RULETYPE_PRESENTATION_NUMBERING &&
|
||||
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 ) );
|
||||
for( USHORT nLevel = 0; (nLevel < nLevels) && (nLevel < nSrcLevels); nLevel++ )
|
||||
pNewRule->SetLevel( nLevel, pRule->GetLevel( nLevel ) );
|
||||
|
||||
return pNewRule;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user