diff options
author | Oliver Specht <os@openoffice.org> | 2001-02-23 11:45:30 +0000 |
---|---|---|
committer | Oliver Specht <os@openoffice.org> | 2001-02-23 11:45:30 +0000 |
commit | 34d554d442fd35baa717ec3b396b94d744a103d5 (patch) | |
tree | 1f3b1f06ee54f0b64f7cecad2d9738e34774f3d4 /sw/source/core | |
parent | 02255839a51a09caf853c1e6495f01c0e528d4f0 (diff) |
Complete use of DefaultNumbering component
Diffstat (limited to 'sw/source/core')
-rw-r--r-- | sw/source/core/doc/docdesc.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/doc/docftn.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/doc/docnum.cxx | 32 | ||||
-rw-r--r-- | sw/source/core/doc/doctxm.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/doc/lineinfo.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/doc/number.cxx | 528 | ||||
-rw-r--r-- | sw/source/core/doc/poolfmt.cxx | 88 | ||||
-rw-r--r-- | sw/source/core/docnode/ndnum.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 27 | ||||
-rw-r--r-- | sw/source/core/fields/chpfld.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/fields/docufld.cxx | 28 | ||||
-rw-r--r-- | sw/source/core/fields/fldbas.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/frmedt/fews.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/text/txtfld.cxx | 26 | ||||
-rw-r--r-- | sw/source/core/text/txtftn.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/tox/txmsrt.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/unocore/unosett.cxx | 75 | ||||
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 9 |
19 files changed, 312 insertions, 589 deletions
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index 6ed6116e87d2..648fd3b73bb2 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docdesc.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jp $ $Date: 2000-11-20 09:15:07 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -340,7 +340,7 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged ) ((SwPageDesc&)rChged).GetLeft() ); //NumType uebernehmen. - if( rChged.GetNumType().eType != pDesc->GetNumType().eType ) + if( rChged.GetNumType().GetNumberingType() != pDesc->GetNumType().GetNumberingType() ) { pDesc->SetNumType( rChged.GetNumType() ); // JP 30.03.99: Bug 64121 - den Seitennummernfeldern bescheid sagen, diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx index bf9d977f22fd..11d981b39144 100644 --- a/sw/source/core/doc/docftn.cxx +++ b/sw/source/core/doc/docftn.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docftn.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:15 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -156,7 +156,7 @@ BOOL SwEndNoteInfo::operator==( const SwEndNoteInfo& rInfo ) const aAnchorCharFmtDep.GetRegisteredIn() == rInfo.aAnchorCharFmtDep.GetRegisteredIn() && GetFtnTxtColl() == rInfo.GetFtnTxtColl() && - aFmt.eType == rInfo.aFmt.eType && + aFmt.GetNumberingType() == rInfo.aFmt.GetNumberingType() && nFtnOffset == rInfo.nFtnOffset && bEndNote == rInfo.bEndNote && sPrefix == rInfo.sPrefix && @@ -194,7 +194,7 @@ SwEndNoteInfo::SwEndNoteInfo(SwTxtFmtColl *pFmt) : nFtnOffset( 0 ), bEndNote( TRUE ) { - aFmt.eType = SVX_NUM_ROMAN_LOWER; + aFmt.SetNumberingType(SVX_NUM_ROMAN_LOWER); } SwPageDesc *SwEndNoteInfo::GetPageDesc( SwDoc &rDoc ) const @@ -316,7 +316,7 @@ SwFtnInfo::SwFtnInfo(SwTxtFmtColl *pFmt) : eNum( FTNNUM_DOC ), ePos( FTNPOS_PAGE ) { - aFmt.eType = SVX_NUM_ARABIC; + aFmt.SetNumberingType(SVX_NUM_ARABIC); bEndNote = FALSE; } @@ -342,7 +342,7 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo) rInfo.GetPageDesc( *this ) != rOld.GetPageDesc( *this ); FASTBOOL bExtra = rInfo.aQuoVadis != rOld.aQuoVadis || rInfo.aErgoSum != rOld.aErgoSum || - rInfo.aFmt.eType != rOld.aFmt.eType || + rInfo.aFmt.GetNumberingType() != rOld.aFmt.GetNumberingType() || rInfo.GetPrefix() != rOld.GetPrefix() || rInfo.GetSuffix() != rOld.GetSuffix(); SwCharFmt *pOldChrFmt = rOld.GetCharFmt( *this ), @@ -402,7 +402,7 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo) FASTBOOL bNumChg = rInfo.nFtnOffset != GetEndNoteInfo().nFtnOffset; FASTBOOL bExtra = !bNumChg && - rInfo.aFmt.eType != GetEndNoteInfo().aFmt.eType|| + rInfo.aFmt.GetNumberingType() != GetEndNoteInfo().aFmt.GetNumberingType()|| rInfo.GetPrefix() != GetEndNoteInfo().GetPrefix() || rInfo.GetSuffix() != GetEndNoteInfo().GetSuffix(); FASTBOOL bFtnDesc = rInfo.GetPageDesc( *this ) != diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 0bd120e82164..f24b3aeecb3c 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docnum.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: jp $ $Date: 2001-01-26 18:08:21 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -176,9 +176,9 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule ) rOld.GetFirstLineOffset() != rNew.GetFirstLineOffset() ) nChkLevel |= nMask; } - else if( SVX_NUM_NUMBER_NONE > rNew.eType && 1 < rNew.GetUpperLevel() && + else if( SVX_NUM_NUMBER_NONE > rNew.GetNumberingType() && 1 < rNew.GetIncludeUpperLevels() && 0 != (nChgFmtLevel & GetUpperLvlChg( n, - rNew.GetUpperLevel(), nMask )) ) + rNew.GetIncludeUpperLevels(), nMask )) ) nChgFmtLevel |= nMask; } (*pOutlineRule) = rRule; @@ -682,8 +682,8 @@ void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule, SwHistory* pHist, rOldFmt.GetFirstLineOffset() != rNewFmt.GetFirstLineOffset() ) nChkLevel |= nMask; } - else if( SVX_NUM_NUMBER_NONE > rNewFmt.eType && 1 < rNewFmt.GetUpperLevel() && - 0 != (nChgFmtLevel & GetUpperLvlChg( n, rNewFmt.GetUpperLevel(),nMask )) ) + else if( SVX_NUM_NUMBER_NONE > rNewFmt.GetNumberingType() && 1 < rNewFmt.GetIncludeUpperLevels() && + 0 != (nChgFmtLevel & GetUpperLvlChg( n, rNewFmt.GetIncludeUpperLevels(),nMask )) ) nChgFmtLevel |= nMask; } @@ -1748,7 +1748,7 @@ BOOL SwDoc::NumOrNoNum( const SwNodeIndex& rIdx, BOOL bDel, BOOL bOutline ) ((SwNumRuleItem*)pItem)->GetValue() )) )) && (bDel ? 0 != ( pNum->GetLevel() & NO_NUMLEVEL ) : 0 == ( pNum->GetLevel() & NO_NUMLEVEL ) ) && - SVX_NUM_NUMBER_NONE != pRule->Get( GetRealLevel(pNum->GetLevel()) ).eType ) + SVX_NUM_NUMBER_NONE != pRule->Get( GetRealLevel(pNum->GetLevel()) ).GetNumberingType() ) { if( DoesUndo() ) { @@ -1971,7 +1971,7 @@ void SwDoc::UpdateNumRule( const String& rName, ULONG nUpdPos ) SwNodeNum aNum( 0 ); if( pRule->IsContinusNum() ) - nNumVal = pRule->Get( 0 ).GetStartValue(); + nNumVal = pRule->Get( 0 ).GetStart(); SwTxtNode* pStt = aUpd.GetList().GetObject( nUpdPos ); SwTxtNode* pPrev = nUpdPos ? aUpd.GetList().GetObject( nUpdPos-1 ) : 0; @@ -2048,7 +2048,7 @@ void SwDoc::UpdateNumRule( const String& rName, ULONG nUpdPos ) (MAXLEVEL) * sizeof( aNum.GetLevelVal()[0]) ); if( pRule->IsContinusNum() ) { - nNumVal = pRule->Get( 0 ).GetStartValue(); + nNumVal = pRule->Get( 0 ).GetStart(); nInitLevels |= 1; } else @@ -2078,15 +2078,15 @@ void SwDoc::UpdateNumRule( const String& rName, ULONG nUpdPos ) { // beim Format mit Bitmap die Graphicen schon mal anfordern const SwNumFmt* pNumFmt = pRule->GetNumFmt( GetRealLevel( nLevel )); - if( pNumFmt && SVX_NUM_BITMAP == pNumFmt->eType ) + if( pNumFmt && SVX_NUM_BITMAP == pNumFmt->GetNumberingType() ) pNumFmt->GetGraphic(); if( pRule->IsContinusNum() ) { if( !(nInitLevels & 1) && - !( pNumFmt && (SVX_NUM_CHAR_SPECIAL == pNumFmt->eType || - SVX_NUM_BITMAP == pNumFmt->eType || - SVX_NUM_NUMBER_NONE == pNumFmt->eType ))) + !( pNumFmt && (SVX_NUM_CHAR_SPECIAL == pNumFmt->GetNumberingType() || + SVX_NUM_BITMAP == pNumFmt->GetNumberingType() || + SVX_NUM_NUMBER_NONE == pNumFmt->GetNumberingType() ))) ++nNumVal; aNum.GetLevelVal()[ nLevel ] = nNumVal; } @@ -2105,18 +2105,18 @@ void SwDoc::UpdateNumRule( const String& rName, ULONG nUpdPos ) { nInitLevels &= ~( 1 << ii ); aNum.GetLevelVal()[ ii ] = - pRule->Get( ii ).GetStartValue(); + pRule->Get( ii ).GetStart(); } aNum.GetLevelVal()[ nLevel ] = USHRT_MAX == aNum.GetSetValue() - ? pRule->Get( nLevel ).GetStartValue() + ? pRule->Get( nLevel ).GetStart() : aNum.GetSetValue(); } else if( USHRT_MAX != aNum.GetSetValue() ) aNum.GetLevelVal()[ nLevel ] = aNum.GetSetValue(); else if( nInitLevels & ( 1 << nLevel )) aNum.GetLevelVal()[ nLevel ] = - pRule->Get( nLevel ).GetStartValue(); + pRule->Get( nLevel ).GetStart(); else aNum.GetLevelVal()[ nLevel ]++; } diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 015bf1ed046e..b5a43c30c280 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -2,9 +2,9 @@ * * $RCSfile: doctxm.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: os $ $Date: 2001-02-14 10:40:40 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2026,7 +2026,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd, USHORT nOld = rNums[0], nBeg = nOld, nCount = 0; - String aNumStr( SwNumType( ((SwPageDesc*)rDescs[0])->GetNumType() ). + String aNumStr( SvxNumberType( ((SwPageDesc*)rDescs[0])->GetNumType() ). GetNumStr( nBeg ) ); if( pCharStyleIdx && lcl_HasMainEntry( pMainEntryNums, nBeg )) { @@ -2055,7 +2055,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd, for(USHORT i = 1; i < rNums.Count(); ++i) { - SwNumType aType( ((SwPageDesc*)rDescs[i])->GetNumType() ); + SvxNumberType aType( ((SwPageDesc*)rDescs[i])->GetNumType() ); if( TOX_INDEX == SwTOXBase::GetType() ) { // Zusammenfassen f. ff. // Alle folgenden aufaddieren @@ -2129,7 +2129,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd, aNumStr.AppendAscii( sPageDeli ); //#58127# Wenn nCount == 0, dann steht die einzige Seitenzahl schon im aNumStr! if(nCount) - aNumStr += SwNumType( ((SwPageDesc*)rDescs[i-1])-> + aNumStr += SvxNumberType( ((SwPageDesc*)rDescs[i-1])-> GetNumType() ).GetNumStr( nBeg+nCount ); } } diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx index 87219f156245..543f78fd3f4c 100644 --- a/sw/source/core/doc/lineinfo.cxx +++ b/sw/source/core/doc/lineinfo.cxx @@ -2,9 +2,9 @@ * * $RCSfile: lineinfo.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:16 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -138,7 +138,7 @@ SwLineNumberInfo& SwLineNumberInfo::operator=(const SwLineNumberInfo &rCpy) BOOL SwLineNumberInfo::operator==( const SwLineNumberInfo& rInf ) const { return GetRegisteredIn() == rInf.GetRegisteredIn() && - aType.eType == rInf.GetNumType().eType && + aType.GetNumberingType() == rInf.GetNumType().GetNumberingType() && aDivider == rInf.GetDivider() && nPosFromLeft == rInf.GetPosFromLeft() && nCountBy == rInf.GetCountBy() && diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 5e501646e369..5205bf50dfef 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -2,9 +2,9 @@ * * $RCSfile: number.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:16 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -144,197 +144,118 @@ extern const sal_Char __FAR_DATA sBulletFntName[] = "starbats"; extern const sal_Char __FAR_DATA sBulletFntName[] = "StarBats"; #endif - -// Methoden fuer die Klassen aus NUMRULE.HXX - -SwNumFmt::SwNumFmt() - : SwClient( 0 ), - pBulletFont( 0 ), - cBullet( cBulletChar ), - eNumAdjust( SVX_ADJUST_LEFT ), - nLSpace( 0 ), - nAbsLSpace( 0 ), - nFirstLineOffset( 0 ), - nCharTextOffset( 0 ), - nStart( 0 ), - pGrfBrush( 0 ), pVertOrient( 0 ) -{ - nInclUpperLevel = MAXLEVEL; - bRelLSpace = FALSE; -} - - -SwNumFmt::SwNumFmt( const SwNumFmt& rNumFmt ) - : SwClient( rNumFmt.pRegisteredIn ), SwNumType( rNumFmt ), - cBullet( rNumFmt.cBullet ), - pBulletFont( 0 ), - eNumAdjust( rNumFmt.eNumAdjust ), - nLSpace( rNumFmt.nLSpace ), - nAbsLSpace( rNumFmt.nAbsLSpace ), - nFirstLineOffset( rNumFmt.nFirstLineOffset ), - nCharTextOffset( rNumFmt.nCharTextOffset ), - nStart( rNumFmt.nStart ), - aPrefix( rNumFmt.aPrefix ), - aPostfix( rNumFmt.aPostfix ), - pGrfBrush( 0 ), pVertOrient( 0 ) +inline void lcl_SetRuleChgd( SwTxtNode& rNd, BYTE nLevel ) { - SetBulletFont(rNumFmt.GetBulletFont()); - nInclUpperLevel = rNumFmt.nInclUpperLevel; - bRelLSpace = rNumFmt.bRelLSpace; - - SetGrfBrush( rNumFmt.GetGrfBrush(), &rNumFmt.GetGrfSize(), - rNumFmt.GetGrfOrient() ); + if( rNd.GetNum() && + (~NO_NUMLEVEL & rNd.GetNum()->GetLevel() ) == nLevel ) + rNd.NumRuleChgd(); } +/* -----------------------------22.02.01 13:41-------------------------------- - -SwNumFmt::~SwNumFmt() + ---------------------------------------------------------------------------*/ +SwNumFmt::SwNumFmt() : + SwClient( 0 ), + SvxNumberFormat(SVX_NUM_ARABIC), + pVertOrient(0) { - delete pBulletFont; - delete pGrfBrush; - delete pVertOrient; } +/* -----------------------------22.02.01 13:42-------------------------------- - -void SwNumFmt::SetBulletFont(const Font* pFont) + ---------------------------------------------------------------------------*/ +SwNumFmt::SwNumFmt( const SwNumFmt& rFmt) : + SwClient( rFmt.pRegisteredIn ), + SvxNumberFormat(rFmt), + pVertOrient(0) { - if( pBulletFont ) - { - if( pFont ) - *pBulletFont = *pFont; - else - delete pBulletFont, pBulletFont = 0; - } - else if( pFont ) - pBulletFont = new Font( *pFont ); + SvxFrameVertOrient eOrient = rFmt.GetVertOrient(); + SetGraphicBrush( rFmt.GetBrush(), &rFmt.GetGraphicSize(), + SVX_VERT_NONE == eOrient ? 0 : &eOrient); } +/* -----------------------------22.02.01 13:58-------------------------------- - -void SwNumFmt::SetGrfBrush( const SvxBrushItem* pGrfBr, const Size* pSz, - const SwFmtVertOrient* pVOrient ) + ---------------------------------------------------------------------------*/ +SwNumFmt::SwNumFmt(const SvxNumberFormat& rNumFmt, SwDoc* pDoc) : + SvxNumberFormat(rNumFmt), + pVertOrient(0) { - if( pGrfBr ) + const String& rCharStyleName = rNumFmt.SvxNumberFormat::GetCharFmtName(); + if( rCharStyleName.Len() ) { - if( pGrfBrush ) - { - if( !( *pGrfBrush == *pGrfBr ) ) - { - delete pGrfBrush; - pGrfBrush = (SvxBrushItem*)pGrfBr->Clone(); - } - } - else - pGrfBrush = (SvxBrushItem*)pGrfBr->Clone(); - - if( pVertOrient != pVOrient ) + SwCharFmt* pCFmt = pDoc->FindCharFmtByName( rCharStyleName ); + if( !pCFmt ) { - if(pVertOrient) - delete pVertOrient; - - pVertOrient = pVOrient ? (SwFmtVertOrient*)pVOrient->Clone() : 0; + USHORT nId = pDoc->GetPoolId( rCharStyleName, + GET_POOLID_CHRFMT ); + pCFmt = nId != USHRT_MAX + ? pDoc->GetCharFmtFromPool( nId ) + : pDoc->MakeCharFmt( rCharStyleName, 0 ); } - if( pSz ) - aGrfSize = *pSz; - else - aGrfSize.Width() = aGrfSize.Height() = 0; - - pGrfBrush->SetDoneLink( STATIC_LINK( this, SwNumFmt, GraphicArrived) ); - } - else - { - delete pGrfBrush, pGrfBrush = 0; - delete pVertOrient, pVertOrient = 0; - aGrfSize.Width() = aGrfSize.Height() = 0; + pCFmt->Add( this ); } + else if( GetRegisteredIn() ) + pRegisteredIn->Remove( this ); + } +/* -----------------------------22.02.01 13:42-------------------------------- + ---------------------------------------------------------------------------*/ +SwNumFmt::~SwNumFmt() +{ + delete pVertOrient; +} +/* -----------------------------23.02.01 09:28-------------------------------- -SwNumFmt& SwNumFmt::operator=( const SwNumFmt& rNumFmt ) + ---------------------------------------------------------------------------*/ +SwNumFmt& SwNumFmt::operator=( const SwNumFmt& rNumFmt) { - cBullet = rNumFmt.cBullet; - eType = rNumFmt.eType; - nInclUpperLevel = rNumFmt.nInclUpperLevel; - bRelLSpace = rNumFmt.bRelLSpace; - - eNumAdjust = rNumFmt.eNumAdjust; - nLSpace = rNumFmt.nLSpace; - nAbsLSpace = rNumFmt.nAbsLSpace; - nFirstLineOffset = rNumFmt.nFirstLineOffset; - nCharTextOffset = rNumFmt.nCharTextOffset; - nStart = rNumFmt.nStart; - aPrefix = rNumFmt.aPrefix; - aPostfix = rNumFmt.aPostfix; - - SetBulletFont(rNumFmt.GetBulletFont()); + SvxNumberFormat::operator=(rNumFmt); if( rNumFmt.GetRegisteredIn() ) rNumFmt.pRegisteredIn->Add( this ); else if( GetRegisteredIn() ) pRegisteredIn->Remove( this ); - - SetGrfBrush( rNumFmt.GetGrfBrush(), &rNumFmt.GetGrfSize(), - rNumFmt.GetGrfOrient() ); - return *this; } +/* -----------------------------23.02.01 09:28-------------------------------- - -BOOL SwNumFmt::operator==( const SwNumFmt& rNumFmt ) const + ---------------------------------------------------------------------------*/ +BOOL SwNumFmt::operator==( const SwNumFmt& rNumFmt) const { - BOOL bRet = ( - eType == rNumFmt.eType && - nInclUpperLevel == rNumFmt.nInclUpperLevel && - bRelLSpace == rNumFmt.bRelLSpace && - eNumAdjust == rNumFmt.eNumAdjust && - nLSpace == rNumFmt.nLSpace && - nAbsLSpace == rNumFmt.nAbsLSpace && - nFirstLineOffset == rNumFmt.nFirstLineOffset && - nCharTextOffset == rNumFmt.nCharTextOffset && - nStart == rNumFmt.nStart && - aPrefix == rNumFmt.aPrefix && - aPostfix == rNumFmt.aPostfix && - pRegisteredIn == rNumFmt.pRegisteredIn); - - if( bRet ) - { - switch( eType ) - { - case SVX_NUM_CHAR_SPECIAL: - - if( cBullet != rNumFmt.cBullet || - ( pBulletFont - ? ( !rNumFmt.GetBulletFont() || - *pBulletFont != *rNumFmt.GetBulletFont() ) - : 0 != rNumFmt.GetBulletFont() ) ) - bRet = FALSE; - break; - - case SVX_NUM_BITMAP: - - if( aGrfSize != rNumFmt.aGrfSize || - ( pGrfBrush - ? ( !rNumFmt.pGrfBrush || - *pGrfBrush != *rNumFmt.pGrfBrush ) - : 0 != rNumFmt.pGrfBrush ) || - ( pVertOrient + BOOL bRet = SvxNumberFormat::operator==(rNumFmt) && + pRegisteredIn == rNumFmt.pRegisteredIn; + if(bRet && GetNumberingType() == SVX_NUM_BITMAP) + { + if(pVertOrient ? ( !rNumFmt.pVertOrient || *pVertOrient != *rNumFmt.pVertOrient ) - : 0 != rNumFmt.pVertOrient ) ) - bRet = FALSE; - break; - } - } + : 0 != rNumFmt.pVertOrient ); + bRet = FALSE; + } return bRet; } +/* -----------------------------22.02.01 13:42-------------------------------- -void SwNumFmt::SetCharFmt( SwCharFmt* pChFmt ) + ---------------------------------------------------------------------------*/ +const Graphic* SwNumFmt::GetGraphic() const +{ + const Graphic* pGrf = 0; + if( GetBrush() && GetCharFmt() ) + pGrf = GetBrush()->GetGraphic( GetCharFmt()->GetDoc()->GetDocShell() ); + return pGrf; +} +/* -----------------------------22.02.01 13:44-------------------------------- + + ---------------------------------------------------------------------------*/ +void SwNumFmt::SetCharFmt( SwCharFmt* pChFmt) { if( pChFmt ) pChFmt->Add( this ); else if( GetRegisteredIn() ) pRegisteredIn->Remove( this ); } +/* -----------------------------22.02.01 13:45-------------------------------- - + ---------------------------------------------------------------------------*/ void SwNumFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) { // dann suche mal in dem Doc nach dem NumRules-Object, in dem dieses @@ -353,47 +274,55 @@ void SwNumFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) else SwClient::Modify( pOld, pNew ); } +/* -----------------------------23.02.01 11:08-------------------------------- - -void SwNumFmt::SetGraphic( const String& rName ) + ---------------------------------------------------------------------------*/ +void SwNumFmt::SetCharFmtName(const String& rSet) { - if( pGrfBrush && *pGrfBrush->GetGraphicLink() == rName ) - return ; - - delete pGrfBrush; - - pGrfBrush = new SvxBrushItem( rName, aEmptyStr, GPOS_AREA ); - pGrfBrush->SetDoneLink( STATIC_LINK( this, SwNumFmt, GraphicArrived) ); - if( !pVertOrient ) - pVertOrient = new SwFmtVertOrient( 0, VERT_TOP ); - - aGrfSize.Width() = aGrfSize.Height() = 0; + SvxNumberFormat::SetCharFmtName(rSet); } +/* -----------------------------22.02.01 13:47-------------------------------- + ---------------------------------------------------------------------------*/ +const String& SwNumFmt::GetCharFmtName() const +{ + if((SwCharFmt*)pRegisteredIn) + return ((SwCharFmt*)pRegisteredIn)->GetName(); + else + return aEmptyStr; +} +/* -----------------------------22.02.01 16:05-------------------------------- -IMPL_STATIC_LINK( SwNumFmt, GraphicArrived, void *, EMPTYARG ) + ---------------------------------------------------------------------------*/ +void SwNumFmt::SetGraphicBrush( const SvxBrushItem* pBrushItem, const Size* pSize, + const SvxFrameVertOrient* pOrient) { - // ggfs. die GrfSize setzen: - if( !pThis->aGrfSize.Width() || !pThis->aGrfSize.Height() ) - { - const Graphic* pGrf = pThis->pGrfBrush->GetGraphic(); - if( pGrf ) - pThis->aGrfSize = ::GetGraphicSizeTwip( *pGrf, 0 ); - } + DELETEZ(pVertOrient); + if(pOrient) + pVertOrient = new SwFmtVertOrient( 0, (SwVertOrient) *pOrient); + SvxNumberFormat::SetGraphicBrush( pBrushItem, pSize, pOrient); +} +/* -----------------------------22.02.01 16:05-------------------------------- - if( pThis->GetCharFmt() ) - pThis->UpdateNumNodes( (SwDoc*)pThis->GetCharFmt()->GetDoc() ); + ---------------------------------------------------------------------------*/ +void SwNumFmt::SetVertOrient(SvxFrameVertOrient eSet) +{ + SvxNumberFormat::SetVertOrient(eSet); + DELETEZ(pVertOrient); + if(VERT_NONE != eSet) + pVertOrient = new SwFmtVertOrient( 0, (SwVertOrient) eSet); - return 0; } +/* -----------------------------22.02.01 16:05-------------------------------- -inline void lcl_SetRuleChgd( SwTxtNode& rNd, BYTE nLevel ) + ---------------------------------------------------------------------------*/ +SvxFrameVertOrient SwNumFmt::GetVertOrient() const { - if( rNd.GetNum() && - (~NO_NUMLEVEL & rNd.GetNum()->GetLevel() ) == nLevel ) - rNd.NumRuleChgd(); + return pVertOrient ? (SvxFrameVertOrient)pVertOrient->GetVertOrient() : SVX_VERT_NONE; } +/* -----------------------------22.02.01 13:54-------------------------------- + ---------------------------------------------------------------------------*/ void SwNumFmt::UpdateNumNodes( SwDoc* pDoc ) { BOOL bDocIsModified = pDoc->IsModified(); @@ -470,137 +399,6 @@ void SwNumFmt::UpdateNumNodes( SwDoc* pDoc ) pDoc->ResetModified(); } -// Graphic ggfs. reinswappen -const Graphic* SwNumFmt::GetGraphic() const -{ - const Graphic* pGrf = 0; - if( pGrfBrush && GetCharFmt() ) - pGrf = pGrfBrush->GetGraphic( GetCharFmt()->GetDoc()->GetDocShell() ); - return pGrf; -} - - -/* */ - -void SwNumType::GetRomanStr( ULONG nNo, String& rStr ) const -{ - nNo %= 4000; // mehr kann nicht dargestellt werden -// i, ii, iii, iv, v, vi, vii, vii, viii, ix -// (Dummy),1000,500,100,50,10,5,1 - const sal_Char *cRomanArr = SVX_NUM_ROMAN_UPPER == eType - ? "MDCLXVI--" // +2 Dummy-Eintraege !! - : "mdclxvi--"; // +2 Dummy-Eintraege !! - - USHORT nMask = 1000; - while( nMask ) - { - BYTE nZahl = BYTE(nNo / nMask); - BYTE nDiff = 1; - nNo %= nMask; - - if( 5 < nZahl ) - { - if( nZahl < 9 ) - rStr += *(cRomanArr-1); - ++nDiff; - nZahl -= 5; - } - switch( nZahl ) - { - case 3: { rStr += *cRomanArr; } - case 2: { rStr += *cRomanArr; } - case 1: { rStr += *cRomanArr; } - break; - - case 4: { - rStr += *cRomanArr; - rStr += *(cRomanArr-nDiff); - } - break; - case 5: { rStr += *(cRomanArr-nDiff); } - break; - } - - nMask /= 10; // zur naechsten Dekade - cRomanArr += 2; - } -} - - -void SwNumType::GetCharStr( ULONG nNo, String& rStr ) const -{ - ASSERT( nNo, "0 ist eine ungueltige Nummer !!" ); - - const ULONG coDiff = 'Z' - 'A' +1; - char cAdd = (SVX_NUM_CHARS_UPPER_LETTER == eType ? 'A' : 'a') - 1; - ULONG nCalc; - - do { - nCalc = nNo % coDiff; - if( !nCalc ) - nCalc = coDiff; - rStr.Insert( (sal_Unicode)(cAdd + nCalc ), 0 ); - nNo -= nCalc; - if( nNo ) - nNo /= coDiff; - } while( nNo ); -} - -void SwNumType::GetCharStrN( ULONG nNo, String& rStr ) const -{ - ASSERT( nNo, "0 ist eine ungueltige Nummer !!" ); - - const ULONG coDiff = 'Z' - 'A' +1; - sal_Unicode cChar = --nNo % coDiff; - if( SVX_NUM_CHARS_UPPER_LETTER_N == eType ) - cChar += 'A'; - else - cChar += 'a'; - - rStr.Fill( (nNo / coDiff) + 1, cChar ); -} - - -String SwNumType::GetNumStr( ULONG nNo ) const -{ - String aTmpStr; - if( nNo ) - { - switch( eType ) - { - case SVX_NUM_CHARS_UPPER_LETTER: - case SVX_NUM_CHARS_LOWER_LETTER: - GetCharStr( nNo, aTmpStr ); - break; - - case SVX_NUM_CHARS_UPPER_LETTER_N: - case SVX_NUM_CHARS_LOWER_LETTER_N: - GetCharStrN( nNo, aTmpStr ); - break; - - case SVX_NUM_ROMAN_UPPER: - case SVX_NUM_ROMAN_LOWER: - GetRomanStr( nNo, aTmpStr ); - break; - - case SVX_NUM_CHAR_SPECIAL: //JP 06.12.99: this types dont have - case SVX_NUM_BITMAP: // any number, so return emptystr - case SVX_NUM_NUMBER_NONE: // Bug: 70527 - break; - -// case ARABIC: ist jetzt default - default: - aTmpStr = String::CreateFromInt32( nNo ); - break; - } - } - else - aTmpStr = '0'; - return aTmpStr; -} - -/* */ - BOOL SwNodeNum::operator==( const SwNodeNum& rNum ) const { return nMyLevel == rNum.nMyLevel && @@ -629,14 +427,12 @@ SwNumRule::SwNumRule( const String& rNm, SwNumRuleType eType, BOOL bAutoFlg ) for( int n = 0; n < MAXLEVEL; ++n ) { pFmt = new SwNumFmt; - pFmt->SetUpperLevel( 1 ); -// pFmt->SetRelLSpace( TRUE ); - pFmt->SetRelLSpace( FALSE ); - pFmt->SetStartValue( 1 ); + pFmt->SetIncludeUpperLevels( 1 ); + pFmt->SetStart( 1 ); pFmt->SetLSpace( lNumIndent ); pFmt->SetAbsLSpace( SwNumRule::GetNumIndent( n ) ); pFmt->SetFirstLineOffset( lNumFirstLineOffset ); - pFmt->SetPostfix( aDotStr ); + pFmt->SetSuffix( aDotStr ); SwNumRule::aBaseFmts[ NUM_RULE ][ n ] = pFmt; } @@ -646,9 +442,9 @@ SwNumRule::SwNumRule( const String& rNm, SwNumRuleType eType, BOOL bAutoFlg ) pFmt = new SwNumFmt; //JP 18.01.96: heute soll es mal wieder vollstaendig numeriert werden //JP 10.03.96: und nun mal wieder nicht - pFmt->eType = SVX_NUM_NUMBER_NONE; + pFmt->SetNumberingType(SVX_NUM_NUMBER_NONE); // pFmt->eType = ARABIC; - pFmt->SetStartValue( 1 ); + pFmt->SetStart( 1 ); SwNumRule::aBaseFmts[ OUTLINE_RULE ][ n ] = pFmt; } } @@ -815,14 +611,14 @@ String SwNumRule::MakeNumString( const SwNodeNum& rNum, BOOL bInclStrings, if( NO_NUM > rNum.GetLevel() && !( NO_NUMLEVEL & rNum.GetLevel() ) ) { const SwNumFmt& rMyNFmt = Get( rNum.GetLevel() ); - if( SVX_NUM_NUMBER_NONE != rMyNFmt.eType ) + if( SVX_NUM_NUMBER_NONE != rMyNFmt.GetNumberingType() ) { BYTE i = rNum.GetLevel(); if( !IsContinusNum() && - rMyNFmt.IsInclUpperLevel() ) // nur der eigene Level ? + rMyNFmt.GetIncludeUpperLevels() ) // nur der eigene Level ? { - BYTE n = rMyNFmt.GetUpperLevel(); + BYTE n = rMyNFmt.GetIncludeUpperLevels(); if( 1 < n ) { if( i+1 >= n ) @@ -835,7 +631,7 @@ String SwNumRule::MakeNumString( const SwNodeNum& rNum, BOOL bInclStrings, for( ; i <= rNum.GetLevel(); ++i ) { const SwNumFmt& rNFmt = Get( i ); - if( SVX_NUM_NUMBER_NONE == rNFmt.eType ) + if( SVX_NUM_NUMBER_NONE == rNFmt.GetNumberingType() ) { // Soll aus 1.1.1 --> 2. NoNum --> 1..1 oder 1.1 ?? // if( i != rNum.nMyLevel ) @@ -860,11 +656,11 @@ String SwNumRule::MakeNumString( const SwNodeNum& rNum, BOOL bInclStrings, //JP 14.12.99: the type dont have any number, so dont append // the Post-/Prefix String if( bInclStrings && !bOnlyArabic && - SVX_NUM_CHAR_SPECIAL != rMyNFmt.eType && - SVX_NUM_BITMAP != rMyNFmt.eType ) + SVX_NUM_CHAR_SPECIAL != rMyNFmt.GetNumberingType() && + SVX_NUM_BITMAP != rMyNFmt.GetNumberingType() ) { aStr.Insert( rMyNFmt.GetPrefix(), 0 ); - aStr += rMyNFmt.GetPostfix(); + aStr += rMyNFmt.GetSuffix(); } } return aStr; @@ -898,80 +694,6 @@ SwNumRule& SwNumRule::CopyNumRule( SwDoc* pDoc, const SwNumRule& rNumRule ) bInvalidRuleFlag = TRUE; return *this; } -/* -----------------30.10.98 08:40------------------- - * - * --------------------------------------------------*/ -SwNumFmt::SwNumFmt(const SvxNumberFormat& rNumFmt, SwDoc* pDoc) : - pBulletFont( 0 ), - pGrfBrush( 0 ), - pVertOrient( 0 ) -{ - cBullet = rNumFmt.GetBulletChar(); - eType = rNumFmt.GetNumType(); - nInclUpperLevel = rNumFmt.GetIncludeUpperLevels(); - bRelLSpace = FALSE; - - eNumAdjust = rNumFmt.GetNumAdjust(); - nLSpace = rNumFmt.GetLSpace(); - nAbsLSpace = rNumFmt.GetAbsLSpace(); - nFirstLineOffset = rNumFmt.GetFirstLineOffset(); - nCharTextOffset = rNumFmt.GetCharTextDistance(); - nStart = rNumFmt.GetStart(); - aPrefix = rNumFmt.GetPrefix(); - aPostfix = rNumFmt.GetSuffix(); - - SetBulletFont(rNumFmt.GetBulletFont()); - if( rNumFmt.GetCharFmt().Len() ) - { - SwCharFmt* pCFmt = pDoc->FindCharFmtByName( rNumFmt.GetCharFmt() ); - if( !pCFmt ) - { - USHORT nId = pDoc->GetPoolId( rNumFmt.GetCharFmt(), - GET_POOLID_CHRFMT ); - pCFmt = nId != USHRT_MAX - ? pDoc->GetCharFmtFromPool( nId ) - : pDoc->MakeCharFmt( rNumFmt.GetCharFmt(), 0 ); - } - pCFmt->Add( this ); - } - else if( GetRegisteredIn() ) - pRegisteredIn->Remove( this ); - - SwVertOrient eOrient = (SwVertOrient)(USHORT) rNumFmt.GetVertOrient(); - SwFmtVertOrient aOrient(0, eOrient); - Size aTmpSize(rNumFmt.GetGraphicSize()); - SetGrfBrush( rNumFmt.GetBrush(), &aTmpSize, - &aOrient ); - -} -/* -----------------30.10.98 12:36------------------- - * - * --------------------------------------------------*/ -SvxNumberFormat SwNumFmt::MakeSvxFormat() const -{ - SvxNumberFormat aRet(eType); - aRet.SetNumAdjust(eNumAdjust); - aRet.SetIncludeUpperLevels(nInclUpperLevel); - aRet.SetStart(nStart); - aRet.SetBulletChar(cBullet); - aRet.SetFirstLineOffset(nFirstLineOffset); - aRet.SetAbsLSpace(nAbsLSpace); - aRet.SetLSpace(nLSpace); - aRet.SetPrefix(aPrefix); - aRet.SetSuffix(aPostfix); - if( GetCharFmt() ) - aRet.SetCharFmt( GetCharFmt()->GetName() ); - aRet.SetCharTextDistance(nCharTextOffset); - - SvxFrameVertOrient eOrient = SVX_VERT_NONE; - if(pVertOrient) - eOrient = (SvxFrameVertOrient)(USHORT)pVertOrient->GetVertOrient(); - aRet.SetGraphicBrush( pGrfBrush, &aGrfSize, &eOrient); - - aRet.SetBulletFont(pBulletFont); - return aRet; -} - /* -----------------30.10.98 08:33------------------- * * --------------------------------------------------*/ @@ -1008,8 +730,8 @@ SvxNumRule SwNumRule::MakeSvxNumRule() const for( USHORT n = 0; n < MAXLEVEL; ++n ) { const SwNumFmt rNumFmt = Get(n); - SvxNumberFormat aSvxFormat = rNumFmt.MakeSvxFormat(); - aRule.SetLevel(n, aSvxFormat, aFmts[n] != 0); +// SvxNumberFormat aSvxFormat = rNumFmt.MakeSvxFormat(); + aRule.SetLevel(n, rNumFmt, aFmts[n] != 0); } return aRule; } diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx index f411f91b961b..1b508c45361c 100644 --- a/sw/source/core/doc/poolfmt.cxx +++ b/sw/source/core/doc/poolfmt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: poolfmt.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: jp $ $Date: 2000-11-20 09:14:31 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1761,11 +1761,11 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc, case RES_POOLNUMRULE_NUM1: { SwNumFmt aFmt; - aFmt.eType = SVX_NUM_ARABIC; + aFmt.SetNumberingType(SVX_NUM_ARABIC); aFmt.SetCharFmt( pNumCFmt ); - aFmt.SetStartValue( 1 ); - aFmt.SetUpperLevel( 1 ); - aFmt.SetPostfix( aDotStr ); + aFmt.SetStart( 1 ); + aFmt.SetIncludeUpperLevels( 1 ); + aFmt.SetSuffix( aDotStr ); static const USHORT aAbsSpace[ MAXLEVEL ] = { @@ -1819,15 +1819,15 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc, const USHORT* pArr = aAbsSpace; #endif SwNumFmt aFmt; - aFmt.eType = SVX_NUM_ARABIC; + aFmt.SetNumberingType(SVX_NUM_ARABIC); aFmt.SetCharFmt( pNumCFmt ); - aFmt.SetUpperLevel( 1 ); + aFmt.SetIncludeUpperLevels( 1 ); USHORT nSpace = 0; for( n = 0; n < MAXLEVEL; ++n ) { aFmt.SetAbsLSpace( nSpace += pArr[ n ] ); aFmt.SetFirstLineOffset( - pArr[ n ] ); - aFmt.SetStartValue( n+1 ); + aFmt.SetStart( n+1 ); pNewRule->Set( n, aFmt ); } } @@ -1835,16 +1835,16 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc, case RES_POOLNUMRULE_NUM3: { SwNumFmt aFmt; - aFmt.eType = SVX_NUM_ARABIC; + aFmt.SetNumberingType(SVX_NUM_ARABIC); aFmt.SetCharFmt( pNumCFmt ); - aFmt.SetUpperLevel( 1 ); + aFmt.SetIncludeUpperLevels( 1 ); USHORT nOffs = GetMetricVal( CM_1 ) * 3; aFmt.SetFirstLineOffset( - nOffs ); for( n = 0; n < MAXLEVEL; ++n ) { aFmt.SetAbsLSpace( (n+1) * nOffs ); - aFmt.SetStartValue( n+1 ); + aFmt.SetStart( n+1 ); pNewRule->Set( n, aFmt ); } } @@ -1852,10 +1852,10 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc, case RES_POOLNUMRULE_NUM4: { SwNumFmt aFmt; - aFmt.eType = SVX_NUM_ROMAN_UPPER; + aFmt.SetNumberingType(SVX_NUM_ROMAN_UPPER); aFmt.SetCharFmt( pNumCFmt ); - aFmt.SetUpperLevel( 1 ); - aFmt.SetPostfix( aDotStr ); + aFmt.SetIncludeUpperLevels( 1 ); + aFmt.SetSuffix( aDotStr ); static const USHORT aAbsSpace[ MAXLEVEL ] = { @@ -1878,7 +1878,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc, aFmt.SetFirstLineOffset( - (*pArr) ); for( n = 0; n < MAXLEVEL; ++n, ++pArr ) { - aFmt.SetStartValue( n + 1 ); + aFmt.SetStart( n + 1 ); aFmt.SetAbsLSpace( *pArr ); pNewRule->Set( n, aFmt ); } @@ -1909,32 +1909,32 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc, const USHORT* pArr0to2 = aAbsSpace0to2; #endif SwNumFmt aFmt; - aFmt.eType = SVX_NUM_ARABIC; - aFmt.SetStartValue( 1 ); - aFmt.SetUpperLevel( 1 ); - aFmt.SetPostfix( aDotStr ); + aFmt.SetNumberingType(SVX_NUM_ARABIC); + aFmt.SetStart( 1 ); + aFmt.SetIncludeUpperLevels( 1 ); + aFmt.SetSuffix( aDotStr ); aFmt.SetFirstLineOffset( -pArr0to2[0] ); // == 0.40 cm aFmt.SetAbsLSpace( pArr0to2[1] ); // == 0.40 cm aFmt.SetCharFmt( pNumCFmt ); pNewRule->Set( 0, aFmt ); - aFmt.SetUpperLevel( 2 ); - aFmt.SetStartValue( 2 ); + aFmt.SetIncludeUpperLevels( 2 ); + aFmt.SetStart( 2 ); aFmt.SetFirstLineOffset( -pArr0to2[2] ); // == 0.65 cm aFmt.SetAbsLSpace( pArr0to2[3] ); // == 1.10 cm pNewRule->Set( 1, aFmt ); - aFmt.eType = SVX_NUM_CHARS_LOWER_LETTER; - aFmt.SetPostfix( ')'); - aFmt.SetUpperLevel( 1 ); - aFmt.SetStartValue( 3 ); + aFmt.SetNumberingType(SVX_NUM_CHARS_LOWER_LETTER); + aFmt.SetSuffix( ')'); + aFmt.SetIncludeUpperLevels( 1 ); + aFmt.SetStart( 3 ); aFmt.SetFirstLineOffset( - pArr0to2[4] ); // == 0.45cm aFmt.SetAbsLSpace( pArr0to2[5] ); // == 1.55 cm pNewRule->Set( 2, aFmt ); - aFmt.eType = SVX_NUM_CHAR_SPECIAL; + aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); aFmt.SetCharFmt( pBullCFmt ); aFmt.SetBulletFont( &SwNumRule::GetDefBulletFont() ); aFmt.SetBulletChar( cBulletChar ); @@ -1942,10 +1942,10 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc, nOffs2 = GetMetricVal( CM_1 ) * 2; aFmt.SetFirstLineOffset( - nOffs ); - aFmt.SetPostfix( aEmptyStr ); + aFmt.SetSuffix( aEmptyStr ); for( n = 3; n < MAXLEVEL; ++n ) { - aFmt.SetStartValue( n+1 ); + aFmt.SetStart( n+1 ); aFmt.SetAbsLSpace( nOffs2 + ((n-3) * nOffs) ); pNewRule->Set( n, aFmt ); } @@ -1955,10 +1955,10 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc, case RES_POOLNUMRULE_BUL1: { SwNumFmt aFmt; - aFmt.eType = SVX_NUM_CHAR_SPECIAL; + aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); aFmt.SetCharFmt( pBullCFmt ); - aFmt.SetStartValue( 1 ); - aFmt.SetUpperLevel( 1 ); + aFmt.SetStart( 1 ); + aFmt.SetIncludeUpperLevels( 1 ); aFmt.SetBulletFont( &SwNumRule::GetDefBulletFont() ); aFmt.SetBulletChar( cBulletChar ); @@ -1991,10 +1991,10 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc, case RES_POOLNUMRULE_BUL2: { SwNumFmt aFmt; - aFmt.eType = SVX_NUM_CHAR_SPECIAL; + aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); aFmt.SetCharFmt( pBullCFmt ); - aFmt.SetStartValue( 1 ); - aFmt.SetUpperLevel( 1 ); + aFmt.SetStart( 1 ); + aFmt.SetIncludeUpperLevels( 1 ); aFmt.SetBulletFont( &SwNumRule::GetDefBulletFont() ); aFmt.SetBulletChar( 0xF000 + 150 ); @@ -2027,10 +2027,10 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc, case RES_POOLNUMRULE_BUL3: { SwNumFmt aFmt; - aFmt.eType = SVX_NUM_CHAR_SPECIAL; + aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); aFmt.SetCharFmt( pBullCFmt ); - aFmt.SetStartValue( 1 ); - aFmt.SetUpperLevel( 1 ); + aFmt.SetStart( 1 ); + aFmt.SetIncludeUpperLevels( 1 ); aFmt.SetBulletFont( &SwNumRule::GetDefBulletFont() ); USHORT nOffs = GetMetricVal( CM_01 ) * 4; aFmt.SetFirstLineOffset( - nOffs ); @@ -2046,10 +2046,10 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc, case RES_POOLNUMRULE_BUL4: { SwNumFmt aFmt; - aFmt.eType = SVX_NUM_CHAR_SPECIAL; + aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); aFmt.SetCharFmt( pBullCFmt ); - aFmt.SetStartValue( 1 ); - aFmt.SetUpperLevel( 1 ); + aFmt.SetStart( 1 ); + aFmt.SetIncludeUpperLevels( 1 ); aFmt.SetBulletFont( &SwNumRule::GetDefBulletFont() ); static const USHORT aAbsSpace[ MAXLEVEL ] = @@ -2087,10 +2087,10 @@ SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId, String* pDesc, case RES_POOLNUMRULE_BUL5: { SwNumFmt aFmt; - aFmt.eType = SVX_NUM_CHAR_SPECIAL; + aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); aFmt.SetCharFmt( pBullCFmt ); - aFmt.SetStartValue( 1 ); - aFmt.SetUpperLevel( 1 ); + aFmt.SetStart( 1 ); + aFmt.SetIncludeUpperLevels( 1 ); aFmt.SetBulletChar( 0xF000 + 79 ); aFmt.SetBulletFont( &SwNumRule::GetDefBulletFont() ); diff --git a/sw/source/core/docnode/ndnum.cxx b/sw/source/core/docnode/ndnum.cxx index 2721b9a60ca4..77fff59dd978 100644 --- a/sw/source/core/docnode/ndnum.cxx +++ b/sw/source/core/docnode/ndnum.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ndnum.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:17 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -254,11 +254,11 @@ BOOL _OutlinePara::UpdateOutline( SwTxtNode& rTxtNd ) memset( aNum.GetLevelVal() + (aNum.GetLevel()+1), 0, (MAXLEVEL - ( aNum.GetLevel()+1 )) * sizeof( aNum.GetLevelVal()[0])); - nSetValue = pOutlRule->Get( nLevel ).GetStartValue(); + nSetValue = pOutlRule->Get( nLevel ).GetStart(); } else if( bInitNum ) { - nSetValue= pOutlRule->Get( nLevel ).GetStartValue(); + nSetValue= pOutlRule->Get( nLevel ).GetStart(); bInitNum = FALSE; } else diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 2d0f1cf76b43..20119812cfb9 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: autofmt.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: er $ $Date: 2000-10-29 17:13:34 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1598,8 +1598,7 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel ) SwNumFmt aFmt( aRule.Get( n ) ); aFmt.SetBulletFont( pBullFnt ); aFmt.SetBulletChar( cBullChar ); - aFmt.eType = SVX_NUM_CHAR_SPECIAL; - aFmt.SetRelLSpace( FALSE ); + aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); aFmt.SetFirstLineOffset( lBullFirstLineOffset ); aFmt.SetAbsLSpace( nAbsPos ); aRule.Set( n, aFmt ); @@ -1653,17 +1652,17 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel ) if( !nDigitLevel ) { SwNumFmt aFmt( aRule.Get( nLvl ) ); - aFmt.SetStartValue( aPreFix.GetToken( 1, + aFmt.SetStart( aPreFix.GetToken( 1, (sal_Unicode)1 ).ToInt32()); aFmt.SetPrefix( aPreFix.GetToken( 0, (sal_Unicode)1 )); - aFmt.SetPostfix( aPostFix.GetToken( 0, (sal_Unicode)1 )); - aFmt.SetInclUpperLevel( FALSE ); + aFmt.SetSuffix( aPostFix.GetToken( 0, (sal_Unicode)1 )); + aFmt.SetIncludeUpperLevels( 0 ); if( !aFmt.GetCharFmt() ) aFmt.SetCharFmt( pCFmt ); if( aNumTypes.Len() ) - aFmt.eType = (SvxExtNumType)(aNumTypes.GetChar( 0 ) - '0'); + aFmt.SetNumberingType(aNumTypes.GetChar( 0 ) - '0'); aRule.Set( nLvl, aFmt ); } @@ -1674,16 +1673,15 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel ) { SwNumFmt aFmt( aRule.Get( n ) ); - aFmt.SetStartValue( aPreFix.GetToken( n+1, + aFmt.SetStart( aPreFix.GetToken( n+1, (sal_Unicode)1 ).ToInt32() ); if( !n ) aFmt.SetPrefix( aPreFix.GetToken( n, (sal_Unicode)1 )); - aFmt.SetPostfix( aPostFix.GetToken( n, (sal_Unicode)1 )); - aFmt.SetInclUpperLevel( TRUE ); + aFmt.SetSuffix( aPostFix.GetToken( n, (sal_Unicode)1 )); + aFmt.SetIncludeUpperLevels( MAXLEVEL ); if( n < aNumTypes.Len() ) - aFmt.eType = (SvxExtNumType)(aNumTypes.GetChar( n ) - '0'); + aFmt.SetNumberingType((aNumTypes.GetChar( n ) - '0')); - aFmt.SetRelLSpace( FALSE ); aFmt.SetAbsLSpace( USHORT( nSpaceSteps * n ) + lNumIndent ); @@ -1698,8 +1696,7 @@ void SwAutoFormat::BuildEnum( USHORT nLvl, USHORT nDigitLevel ) for( ; n < MAXLEVEL; ++n ) { SwNumFmt aFmt( aRule.Get( n ) ); - aFmt.SetInclUpperLevel( TRUE ); - aFmt.SetRelLSpace( FALSE ); + aFmt.SetIncludeUpperLevels( MAXLEVEL ); if( bDefStep ) aFmt.SetAbsLSpace( USHORT( (nLeftTxtPos + SwNumRule::GetNumIndent( n - nLvl )))); diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx index 6acb68785477..34d3ba068b6b 100644 --- a/sw/source/core/fields/chpfld.cxx +++ b/sw/source/core/fields/chpfld.cxx @@ -2,9 +2,9 @@ * * $RCSfile: chpfld.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:19 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -183,7 +183,7 @@ void SwChapterField::ChangeExpansion( const SwFrm* pFrm, if( nPrevLvl < nLevel ) nLevel = nPrevLvl; else if( SVX_NUM_NUMBER_NONE != pDoc->GetOutlineNumRule() - ->Get( nLevel ).eType ) + ->Get( nLevel ).GetNumberingType() ) { pTxtNd = pONd; break; @@ -205,7 +205,7 @@ void SwChapterField::ChangeExpansion( const SwFrm* pFrm, if( NO_NUM > rNum.GetLevel() && !( NO_NUMLEVEL & rNum.GetLevel() ) ) { const SwNumFmt& rNFmt = pDoc->GetOutlineNumRule()->Get( rNum.GetLevel() ); - sPost = rNFmt.GetPostfix(); + sPost = rNFmt.GetSuffix(); sPre = rNFmt.GetPrefix(); } else diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index f6fef50b11a1..effb3ba47a01 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docufld.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: os $ $Date: 2001-02-21 12:40:23 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -238,7 +238,7 @@ using namespace ::rtl; SwPageNumberFieldType::SwPageNumberFieldType() : SwFieldType( RES_PAGENUMBERFLD ), - eNumFormat( SVX_NUM_ARABIC ), + nNumberingType( SVX_NUM_ARABIC ), nNum( 0 ), nMax( USHRT_MAX ), bVirtuell( sal_False ) @@ -248,7 +248,7 @@ SwPageNumberFieldType::SwPageNumberFieldType() String& SwPageNumberFieldType::Expand( sal_uInt32 nFmt, short nOff, const String& rUserStr, String& rRet ) const { - sal_uInt32 nTmpFmt = (SVX_NUM_PAGEDESC == nFmt) ? (sal_uInt32)eNumFormat : nFmt; + sal_uInt32 nTmpFmt = (SVX_NUM_PAGEDESC == nFmt) ? (sal_uInt32)nNumberingType : nFmt; long nTmp = nNum + nOff; if( 0 >= nTmp || SVX_NUM_NUMBER_NONE == nTmpFmt || (!bVirtuell && nTmp > nMax) ) @@ -266,7 +266,7 @@ SwFieldType* SwPageNumberFieldType::Copy() const pTmp->nNum = nNum; pTmp->nMax = nMax; - pTmp->eNumFormat = eNumFormat; + pTmp->nNumberingType = nNumberingType; pTmp->bVirtuell = bVirtuell; return pTmp; @@ -278,12 +278,12 @@ SwFieldType* SwPageNumberFieldType::Copy() const void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc, sal_uInt16 nPage, sal_uInt16 nNumPages, sal_Bool bVirt, - const SvxExtNumType* pNumFmt ) + const sal_Int16* pNumFmt ) { nNum = nPage; nMax = nNumPages; if( pNumFmt ) - eNumFormat = *pNumFmt; + nNumberingType = *pNumFmt; bVirtuell = sal_False; if( bVirt ) @@ -871,7 +871,7 @@ BOOL SwTemplNameField::PutValue( const uno::Any& rAny, const String& rProperty ) --------------------------------------------------------------------*/ SwDocStatFieldType::SwDocStatFieldType(SwDoc* pDocument) - : SwFieldType( RES_DOCSTATFLD ), eNumFormat( SVX_NUM_ARABIC ) + : SwFieldType( RES_DOCSTATFLD ), nNumberingType( SVX_NUM_ARABIC ) { pDoc = pDocument; } @@ -893,7 +893,7 @@ String SwDocStatFieldType::Expand(sal_uInt16 nSubType, sal_uInt32 nFmt) const ((SwDocStat &)rDStat).nPage = pDoc->GetRootFrm()->GetPageNum(); nVal = rDStat.nPage; if( SVX_NUM_PAGEDESC == nFmt ) - nFmt = (sal_uInt32)eNumFormat; + nFmt = (sal_uInt32)nNumberingType; break; default: ASSERT( sal_False, "SwDocStatFieldType::Expand: unbekannter SubType" ); @@ -950,7 +950,7 @@ void SwDocStatField::ChangeExpansion( const SwFrm* pFrm ) { if( DS_PAGE == nSubType && SVX_NUM_PAGEDESC == GetFormat() ) ((SwDocStatFieldType*)GetTyp())->SetNumFormat( - pFrm->FindPageFrm()->GetPageDesc()->GetNumType().eType ); + pFrm->FindPageFrm()->GetPageDesc()->GetNumType().GetNumberingType() ); } /*-----------------05.03.98 11:38------------------- @@ -2107,7 +2107,7 @@ BOOL SwRefPageSetField::PutValue( const uno::Any& rAny, const String& rProperty --------------------------------------------------------------------*/ SwRefPageGetFieldType::SwRefPageGetFieldType( SwDoc* pDc ) - : SwFieldType( RES_REFPAGEGETFLD ), eNumFormat( SVX_NUM_ARABIC ), pDoc( pDc ) + : SwFieldType( RES_REFPAGEGETFLD ), nNumberingType( SVX_NUM_ARABIC ), pDoc( pDc ) { } /* --------------------------------------------------------------------------- @@ -2116,7 +2116,7 @@ SwRefPageGetFieldType::SwRefPageGetFieldType( SwDoc* pDc ) SwFieldType* SwRefPageGetFieldType::Copy() const { SwRefPageGetFieldType* pNew = new SwRefPageGetFieldType( pDoc ); - pNew->eNumFormat = eNumFormat; + pNew->nNumberingType = nNumberingType; return pNew; } /* --------------------------------------------------------------------------- @@ -2233,7 +2233,7 @@ void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld, sal_uInt32 nTmpFmt = SVX_NUM_PAGEDESC == pGetFld->GetFormat() ? ( !pPgFrm ? SVX_NUM_ARABIC - : pPgFrm->GetPageDesc()->GetNumType().eType ) + : pPgFrm->GetPageDesc()->GetNumType().GetNumberingType() ) : pGetFld->GetFormat(); short nPageNum = Max(0, pSetFld->GetOffset() + (short)nDiff); pGetFld->SetText( FormatNumber( nPageNum, nTmpFmt ) ); @@ -2326,7 +2326,7 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm, SwRefPageGetField* pGetFld = (SwRefPageGetField*)pFld->GetFld().GetFld(); sal_uInt32 nTmpFmt = SVX_NUM_PAGEDESC == pGetFld->GetFormat() - ? pPgFrm->GetPageDesc()->GetNumType().eType + ? pPgFrm->GetPageDesc()->GetNumType().GetNumberingType() : pGetFld->GetFormat(); short nPageNum = Max(0, pSetFld->GetOffset() + (short)nDiff ); pGetFld->SetText( FormatNumber( nPageNum, nTmpFmt ) ); diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index 998847e484d2..ae53437434b7 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fldbas.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: os $ $Date: 2001-02-02 11:47:24 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -660,11 +660,11 @@ SwField* SwFieldList::GetLastField() const String FormatNumber(USHORT nNum, ULONG nFormat) { - SwNumType aNumber; + SvxNumberType aNumber; ASSERT(nFormat != SVX_NUM_NUMBER_NONE, "Falsches Nummern-Format" ); - aNumber.eType = (SvxExtNumType)nFormat; + aNumber.SetNumberingType((sal_Int16)nFormat); return aNumber.GetNumStr(nNum); } diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 8e498f08c1cf..2db05cfb7a9e 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fews.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jp $ $Date: 2000-10-25 12:02:28 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -301,7 +301,7 @@ BOOL SwFEShell::GetPageNumber( long nYPos, BOOL bAtCrsrPos, USHORT& rPhyNum, USH { rPhyNum = ((const SwPageFrm*)pPage)->GetPhyPageNum(); rVirtNum = ((const SwPageFrm*)pPage)->GetVirtPageNum(); - const SwNumType& rNum = ((const SwPageFrm*)pPage)->GetPageDesc()->GetNumType(); + const SvxNumberType& rNum = ((const SwPageFrm*)pPage)->GetPageDesc()->GetNumType(); rDisplay = rNum.GetNumStr( rVirtNum ); } diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index c1c92c7b9abb..657dbd200f05 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2,9 +2,9 @@ * * $RCSfile: atrfrm.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: mib $ $Date: 2001-01-15 11:27:20 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1933,7 +1933,7 @@ int SwFmtFtnEndAtTxtEnd::operator==( const SfxPoolItem& rItem ) const { const SwFmtFtnEndAtTxtEnd& rAttr = (SwFmtFtnEndAtTxtEnd&)rItem; return SfxEnumItem::operator==( rAttr ) && - aFmt.eType == rAttr.aFmt.eType && + aFmt.GetNumberingType() == rAttr.aFmt.GetNumberingType() && nOffset == rAttr.nOffset && sPrefix == rAttr.sPrefix && sSuffix == rAttr.sSuffix; @@ -1962,7 +1962,7 @@ BOOL SwFmtFtnEndAtTxtEnd::QueryValue( uno::Any& rVal, BYTE nMemberId ) const rVal.setValue(&bVal, ::getBooleanCppuType()); } break; - case MID_NUM_TYPE : rVal <<= (sal_Int16) aFmt.eType; break; + case MID_NUM_TYPE : rVal <<= aFmt.GetNumberingType(); break; case MID_PREFIX : rVal <<= OUString(sPrefix); break; case MID_SUFFIX : rVal <<= OUString(sSuffix); break; default: return FALSE; @@ -2020,7 +2020,7 @@ BOOL SwFmtFtnEndAtTxtEnd::PutValue( const uno::Any& rVal, BYTE nMemberId ) (nVal <= SVX_NUM_ARABIC || SVX_NUM_CHARS_UPPER_LETTER_N == nVal || SVX_NUM_CHARS_LOWER_LETTER_N == nVal )) - aFmt.eType = (SvxExtNumType)nVal; + aFmt.SetNumberingType(nVal); else bRet = FALSE; } diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx index f0bbae93cbc1..173f525110cc 100644 --- a/sw/source/core/text/txtfld.cxx +++ b/sw/source/core/text/txtfld.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtfld.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: jp $ $Date: 2001-01-18 14:07:46 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -200,12 +200,12 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf, MSHORT nVirtNum = pFrame->GetVirtPageNum(), nNumPages = pDoc->GetRootFrm()->GetPageNum(); - const SvxExtNumType* pNumFmt = SVX_NUM_PAGEDESC == pFld->GetFormat() - ? &pFrame->FindPageFrm()->GetPageDesc()->GetNumType().eType - : 0; + sal_Int16 nNumFmt = -1; + if(SVX_NUM_PAGEDESC == pFld->GetFormat()) + nNumFmt = pFrame->FindPageFrm()->GetPageDesc()->GetNumType().GetNumberingType(); pPageNr->ChangeExpansion( pDoc, nVirtNum, nNumPages, - bVirt, pNumFmt ); + bVirt, nNumFmt > -1 ? &nNumFmt : 0); } pRet = new SwFldPortion( pFld->GetCntnt( bName ) ); break; @@ -396,14 +396,14 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const if( pNumRule && pNum && MAXLEVEL > pNum->GetLevel() ) { CONST SwNumFmt &rNumFmt = pNumRule->Get( pNum->GetLevel() ); - const sal_Bool bLeft = SVX_ADJUST_LEFT == rNumFmt.GetAdjust(); - const sal_Bool bCenter = SVX_ADJUST_CENTER == rNumFmt.GetAdjust(); - const KSHORT nMinDist = rNumFmt.GetCharTextOffset(); + const sal_Bool bLeft = SVX_ADJUST_LEFT == rNumFmt.GetNumAdjust(); + const sal_Bool bCenter = SVX_ADJUST_CENTER == rNumFmt.GetNumAdjust(); + const KSHORT nMinDist = rNumFmt.GetCharTextDistance(); - if( SVX_NUM_BITMAP == rNumFmt.eType ) + if( SVX_NUM_BITMAP == rNumFmt.GetNumberingType() ) { - pRet = new SwGrfNumPortion( (SwFrm*)GetTxtFrm(),rNumFmt.GetGrfBrush(), - rNumFmt.GetGrfOrient(), rNumFmt.GetGrfSize(), + pRet = new SwGrfNumPortion( (SwFrm*)GetTxtFrm(),rNumFmt.GetBrush(), + rNumFmt.GetGraphicOrientation(), rNumFmt.GetGraphicSize(), bLeft, bCenter, nMinDist ); long nTmpA = rInf.GetLast()->GetAscent(); long nTmpD = rInf.GetLast()->Height() - nTmpA; @@ -418,7 +418,7 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const SwFont *pNumFnt = 0; const SwAttrSet* pFmt = rNumFmt.GetCharFmt() ? &rNumFmt.GetCharFmt()->GetAttrSet() : NULL; - if( SVX_NUM_CHAR_SPECIAL == rNumFmt.eType ) + if( SVX_NUM_CHAR_SPECIAL == rNumFmt.GetNumberingType() ) { const Font *pFmtFnt = rNumFmt.GetBulletFont(); pNumFnt = new SwFont( &rInf.GetCharAttr() ); diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 839056c2bba9..35a0a8ee5b7c 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtftn.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: ama $ $Date: 2001-02-20 09:51:44 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1004,7 +1004,7 @@ XubString lcl_GetPageNumber( const SwPageFrm* pPage ) { ASSERT( pPage, "GetPageNumber: Homeless TxtFrm" ); MSHORT nVirtNum = pPage->GetVirtPageNum(); - const SwNumType& rNum = pPage->GetPageDesc()->GetNumType(); + const SvxNumberType& rNum = pPage->GetPageDesc()->GetNumType(); return rNum.GetNumStr( nVirtNum ); } diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index 5b338e38e3fd..1e9101d0f7aa 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txmsrt.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: os $ $Date: 2001-02-14 15:19:23 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -667,7 +667,7 @@ String SwTOXPara::GetURL() const for( int n = 0; n <= pNum->GetLevel(); ++n ) { int nNum = pNum->GetLevelVal()[ n ]; - nNum -= ( rRule.Get( n ).GetStartValue() - 1 ); + nNum -= ( rRule.Get( n ).GetStart() - 1 ); ( aTxt += String::CreateFromInt32( nNum )) += '.'; } } diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 013d19c4ed72..0eb494bf2bed 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unosett.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: os $ $Date: 2000-12-14 12:41:20 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -495,7 +495,7 @@ void SwXFootnoteProperties::setPropertyValue(const OUString& rPropertyName, cons (nTmp <= SVX_NUM_ARABIC || nTmp == SVX_NUM_CHARS_UPPER_LETTER_N|| nTmp == SVX_NUM_CHARS_LOWER_LETTER_N)) - aFtnInfo.aFmt.eType = (SvxExtNumType)nTmp; + aFtnInfo.aFmt.SetNumberingType(nTmp); else throw lang::IllegalArgumentException(); } @@ -611,7 +611,7 @@ uno::Any SwXFootnoteProperties::getPropertyValue(const OUString& rPropertyName) break; case WID_NUMBERING_TYPE : { - aRet <<= (sal_Int16)rFtnInfo.aFmt.eType; + aRet <<= rFtnInfo.aFmt.GetNumberingType(); } break; case WID_START_AT: @@ -827,7 +827,7 @@ void SwXEndnoteProperties::setPropertyValue(const OUString& rPropertyName, const { INT16 nTmp; aValue >>= nTmp; - aEndInfo.aFmt.eType = (SvxExtNumType)nTmp; + aEndInfo.aFmt.SetNumberingType(nTmp); } break; case WID_START_AT: @@ -893,7 +893,7 @@ uno::Any SwXEndnoteProperties::getPropertyValue(const OUString& rPropertyName) aRet <<= OUString(rEndInfo.GetSuffix()); break; case WID_NUMBERING_TYPE : - aRet <<= (sal_Int16)rEndInfo.aFmt.eType; + aRet <<= rEndInfo.aFmt.GetNumberingType(); break; case WID_START_AT: aRet <<= (sal_Int16)rEndInfo.nFtnOffset; @@ -1070,10 +1070,10 @@ void SwXLineNumberingProperties::setPropertyValue( break; case WID_NUMBERING_TYPE : { - SwNumType aNumType(aInfo.GetNumType()); + SvxNumberType aNumType(aInfo.GetNumType()); INT16 nTmp; aValue >>= nTmp; - aNumType.eType = (SvxExtNumType)nTmp; + aNumType.SetNumberingType(nTmp); aInfo.SetNumType(aNumType); } break; @@ -1181,7 +1181,7 @@ Any SwXLineNumberingProperties::getPropertyValue(const OUString& rPropertyName) SFX_STYLE_FAMILY_CHAR )); break; case WID_NUMBERING_TYPE : - aRet <<= (sal_Int16)rInfo.GetNumType().eType; + aRet <<= rInfo.GetNumType().GetNumberingType(); break; case WID_NUMBER_POSITION : { @@ -1555,13 +1555,13 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::getNumberingRuleByIndex( //fill all properties into the array //adjust - SvxAdjust eAdj = rFmt.GetAdjust(); + SvxAdjust eAdj = rFmt.GetNumAdjust(); sal_Int16 nINT16 = aSvxToUnoAdjust[(sal_uInt16)eAdj]; PropValData* pData = new PropValData((void*)&nINT16, "Adjust", ::getCppuType((const sal_Int16*)0) ); aPropertyValues.Insert(pData, aPropertyValues.Count()); //parentnumbering - nINT16 = rFmt.GetUpperLevel(); + nINT16 = rFmt.GetIncludeUpperLevels(); pData = new PropValData((void*)&nINT16, "ParentNumbering", ::getCppuType((const sal_Int16*)0)); aPropertyValues.Insert(pData, aPropertyValues.Count()); @@ -1571,7 +1571,7 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::getNumberingRuleByIndex( aPropertyValues.Insert(pData, aPropertyValues.Count()); //suffix - aUString = rFmt.GetPostfix(); + aUString = rFmt.GetSuffix(); pData = new PropValData((void*)&aUString, "Suffix", ::getCppuType((const OUString*)0)); aPropertyValues.Insert(pData, aPropertyValues.Count()); @@ -1591,7 +1591,7 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::getNumberingRuleByIndex( aPropertyValues.Insert(pData, aPropertyValues.Count()); //startvalue - nINT16 = rFmt.GetStartValue(); + nINT16 = rFmt.GetStart(); pData = new PropValData((void*)&nINT16, "StartWith", ::getCppuType((const sal_Int16*)0)); aPropertyValues.Insert(pData, aPropertyValues.Count()); @@ -1601,7 +1601,7 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::getNumberingRuleByIndex( aPropertyValues.Insert(pData, aPropertyValues.Count()); //chartextoffset - nINT32 = TWIP_TO_MM100(rFmt.GetCharTextOffset()); + nINT32 = TWIP_TO_MM100(rFmt.GetCharTextDistance()); pData = new PropValData((void*)&nINT32, UNO_NAME_SYMBOL_TEXT_DISTANCE, ::getCppuType((const sal_Int32*)0)); aPropertyValues.Insert(pData, aPropertyValues.Count()); @@ -1610,15 +1610,14 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::getNumberingRuleByIndex( pData = new PropValData((void*)&nINT32, UNO_NAME_FIRST_LINE_OFFSET, ::getCppuType((const sal_Int32*)0)); aPropertyValues.Insert(pData, aPropertyValues.Count()); - //TODO: Enum fuer NumberingType erweitern // - nINT16 = rFmt.eType; + nINT16 = rFmt.GetNumberingType(); pData = new PropValData((void*)&nINT16, "NumberingType", ::getCppuType((const sal_Int16*)0)); aPropertyValues.Insert(pData, aPropertyValues.Count()); if(!bChapterNum) { - if(SVX_NUM_CHAR_SPECIAL == rFmt.eType) + if(SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType()) { //BulletId nINT16 = rFmt.GetBulletChar(); @@ -1649,10 +1648,10 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::getNumberingRuleByIndex( aPropertyValues.Insert(pData, aPropertyValues.Count()); } } - if(SVX_NUM_BITMAP == rFmt.eType) + if(SVX_NUM_BITMAP == rFmt.GetNumberingType()) { //GraphicURL - const SvxBrushItem* pBrush = rFmt.GetGrfBrush(); + const SvxBrushItem* pBrush = rFmt.GetBrush(); if(pBrush) { Any aAny; @@ -1675,13 +1674,13 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::getNumberingRuleByIndex( ::getCppuType((const uno::Reference<awt::XBitmap>*)0)); aPropertyValues.Insert(pData, aPropertyValues.Count()); } - Size aSize = rFmt.GetGrfSize(); + Size aSize = rFmt.GetGraphicSize(); aSize.Width() = TWIP_TO_MM100( aSize.Width() ); aSize.Height() = TWIP_TO_MM100( aSize.Height() ); pData = new PropValData((void*)&aSize, UNO_NAME_GRAPHIC_SIZE, ::getCppuType((const awt::Size*)0)); aPropertyValues.Insert(pData, aPropertyValues.Count()); - const SwFmtVertOrient* pOrient = rFmt.GetGrfOrient(); + const SwFmtVertOrient* pOrient = rFmt.GetGraphicOrientation(); if(pOrient) { pData = new PropValData((void*)0, UNO_NAME_VERT_ORIENT, ::getCppuType((const sal_Int16*)0)); @@ -1822,7 +1821,7 @@ void SwXNumberingRules::setNumberingRuleByIndex( nValue <= HoriOrientation::LEFT && USHRT_MAX != aUnoToSvxAdjust[nValue]) { - aFmt.SetAdjust((SvxAdjust)aUnoToSvxAdjust[nValue]); + aFmt.SetNumAdjust((SvxAdjust)aUnoToSvxAdjust[nValue]); } else bWrongArg = sal_True; @@ -1833,7 +1832,7 @@ void SwXNumberingRules::setNumberingRuleByIndex( sal_Int16 nSet; pData->aVal >>= nSet; if(nSet >= 0 && MAXLEVEL >= nSet) - aFmt.SetUpperLevel(nSet); + aFmt.SetIncludeUpperLevels(nSet); } break; case 2: //"Prefix", @@ -1847,7 +1846,7 @@ void SwXNumberingRules::setNumberingRuleByIndex( { OUString uTmp; pData->aVal >>= uTmp; - aFmt.SetPostfix(uTmp); + aFmt.SetSuffix(uTmp); } break; case 4: //"CharStyleName", @@ -1903,7 +1902,7 @@ void SwXNumberingRules::setNumberingRuleByIndex( { INT16 nVal; pData->aVal >>= nVal; - aFmt.SetStartValue(nVal); + aFmt.SetStart(nVal); } break; case 6: //UNO_NAME_LEFT_MARGIN, @@ -1921,7 +1920,7 @@ void SwXNumberingRules::setNumberingRuleByIndex( sal_Int32 nValue; pData->aVal >>= nValue; if(nValue >= 0) - aFmt.SetCharTextOffset((sal_uInt16) MM100_TO_TWIP(nValue)); + aFmt.SetCharTextDistance((sal_uInt16) MM100_TO_TWIP(nValue)); else bWrongArg = sal_True; } @@ -1946,7 +1945,7 @@ void SwXNumberingRules::setNumberingRuleByIndex( sal_Int16 nSet; pData->aVal >>= nSet; if(nSet <= (sal_Int16)SVX_NUM_CHARS_LOWER_LETTER_N) - aFmt.eType = (SvxExtNumType)nSet; + aFmt.SetNumberingType(nSet); else bWrongArg = sal_True; } @@ -2000,7 +1999,7 @@ void SwXNumberingRules::setNumberingRuleByIndex( pData->aVal >>= sBrushURL; if(!pSetBrush) { - const SvxBrushItem* pOrigBrush = aFmt.GetGrfBrush(); + const SvxBrushItem* pOrigBrush = aFmt.GetBrush(); if(pOrigBrush) { pSetBrush = new SvxBrushItem(*pOrigBrush); @@ -2018,7 +2017,7 @@ void SwXNumberingRules::setNumberingRuleByIndex( { if(!pSetBrush) { - const SvxBrushItem* pOrigBrush = aFmt.GetGrfBrush(); + const SvxBrushItem* pOrigBrush = aFmt.GetBrush(); if(pOrigBrush) { pSetBrush = new SvxBrushItem(*pOrigBrush); @@ -2055,8 +2054,8 @@ void SwXNumberingRules::setNumberingRuleByIndex( { if(!pSetVOrient) { - if(aFmt.GetGrfOrient()) - pSetVOrient = (SwFmtVertOrient*)aFmt.GetGrfOrient()->Clone(); + if(aFmt.GetGraphicOrientation()) + pSetVOrient = (SwFmtVertOrient*)aFmt.GetGraphicOrientation()->Clone(); else pSetVOrient = new SwFmtVertOrient; } @@ -2089,24 +2088,26 @@ void SwXNumberingRules::setNumberingRuleByIndex( } if(!bExcept && !bWrongArg && (pSetBrush || pSetSize || pSetVOrient)) { - if(!pSetBrush && aFmt.GetGrfBrush()) - pSetBrush = new SvxBrushItem(*aFmt.GetGrfBrush()); + if(!pSetBrush && aFmt.GetBrush()) + pSetBrush = new SvxBrushItem(*aFmt.GetBrush()); if(pSetBrush) { - if(!pSetVOrient && aFmt.GetGrfOrient()) - pSetVOrient = new SwFmtVertOrient(*aFmt.GetGrfOrient()); + if(!pSetVOrient && aFmt.GetGraphicOrientation()) + pSetVOrient = new SwFmtVertOrient(*aFmt.GetGraphicOrientation()); if(!pSetSize) { - pSetSize = new Size(aFmt.GetGrfSize()); + pSetSize = new Size(aFmt.GetGraphicSize()); if(!pSetSize->Width() || !pSetSize->Height()) { const Graphic* pGraphic = pSetBrush->GetGraphic(); *pSetSize = ::GetGraphicSizeTwip(*pGraphic, 0); } } - aFmt.SetGrfBrush( pSetBrush, pSetSize, pSetVOrient ); + SvxFrameVertOrient eOrient = pSetVOrient ? + (SvxFrameVertOrient)pSetVOrient->GetVertOrient() : SVX_VERT_NONE; + aFmt.SetGraphicBrush( pSetBrush, pSetSize, SVX_VERT_NONE == eOrient ? 0 : &eOrient ); } } delete pSetBrush; diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 9c91e68ef005..43c6ea3924d7 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -2,9 +2,9 @@ * * $RCSfile: viewsh.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: os $ $Date: 2000-10-17 09:25:09 $ + * last change: $Author: os $ $Date: 2001-02-23 12:45:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -897,7 +897,7 @@ void ViewShell::SizeChgNotify(const Size &rSize) if ( pCnt && 0 != (pPage = pCnt->FindPageFrm()) ) { USHORT nVirtNum = pPage->GetVirtPageNum(); - const SwNumType& rNum = pPage->GetPageDesc()->GetNumType(); + const SvxNumberType& rNum = pPage->GetPageDesc()->GetNumType(); String sDisplay = rNum.GetNumStr( nVirtNum ); PageNumNotify( this, pCnt->GetPhyPageNum(), nVirtNum, sDisplay ); } @@ -2098,6 +2098,9 @@ BOOL ViewShell::IsNewLayout() const /************************************************************************ $Log: not supported by cvs2svn $ + Revision 1.2 2000/10/17 09:25:09 os + #79537# CareChildWin/GetCareWin need current shell as parameter + Revision 1.1.1.1 2000/09/19 00:08:29 hr initial import |