diff options
author | Kurt Zenker <kz@openoffice.org> | 2004-06-11 14:47:13 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2004-06-11 14:47:13 +0000 |
commit | ca5ab05e8875f79a05ab149bb1d9ff5437879190 (patch) | |
tree | d1a55695a4d97bfe22700fdc091a287726cad67a /sw/source/ui | |
parent | 06b8d5e2e054a856aa1f1f9201b92adc57936889 (diff) |
INTEGRATION: CWS hbea1bugs01 (1.28.62); FILE MERGED
2004/05/27 09:24:36 hbrinkm 1.28.62.1: #i29560#
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/wrtsh/wrtsh1.cxx | 147 |
1 files changed, 104 insertions, 43 deletions
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index 6f672fd2769c..533afe76b54c 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -2,9 +2,9 @@ * * $RCSfile: wrtsh1.cxx,v $ * - * $Revision: 1.31 $ + * $Revision: 1.32 $ * - * last change: $Author: kz $ $Date: 2004-05-18 15:02:39 $ + * last change: $Author: kz $ $Date: 2004-06-11 15:47:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -238,6 +238,8 @@ #ifndef _SFXREQUEST_HXX //autogen #include <sfx2/request.hxx> #endif +#include <ndtxt.hxx> +#include <svx/acorrcfg.hxx> // -> #111827# #include <SwRewriter.hxx> @@ -1176,29 +1178,48 @@ void SwWrtShell::SplitNode( BOOL bAutoFmt, BOOL bCheckTableStart ) // zum Testen der CharFormate an der Numerierung // extern void SetNumChrFmt( SwWrtShell*, SwNumRules& ); -void SwWrtShell::NumOn() +// -> #i29560# +void SwWrtShell::NumOrBulletOn(BOOL bNum) { - // #115901# - const SwNumRule * pNumRule = - GetDoc()->SearchNumRule(*GetCrsr()->GetPoint(), FALSE, TRUE, 0); - - if (pNumRule) - SetCurNumRule(*pNumRule); - else + const SwNumRule* pCurRule = GetCurNumRule(); + if( !pCurRule || !pCurRule->IsOutlineRule()) { - SwNumRule aNumRule(GetUniqueNumRuleName()); + const SwNumRule * pNumRule = + GetDoc()->SearchNumRule(*GetCrsr()->GetPoint(), FALSE, bNum, FALSE, + 0); - const SwNumRule* pCurRule = GetCurNumRule(); - if( !pCurRule ) + if (pNumRule) + SetCurNumRule(*pNumRule); + else { + SwNumRule aNumRule(GetUniqueNumRuleName()); // Zeichenvorlage an die Numerierung haengen - SwCharFmt* pChrFmt = GetCharFmtFromPool( RES_POOLCHR_NUM_LEVEL ); + SwCharFmt* pChrFmt; SwDocShell* pDocSh = GetView().GetDocShell(); + const Font* pFnt = &SwNumRule::GetDefBulletFont(); + + if (bNum) + { + pChrFmt = GetCharFmtFromPool( RES_POOLCHR_NUM_LEVEL ); + } + else + { + pChrFmt = GetCharFmtFromPool( RES_POOLCHR_BUL_LEVEL ); + } + BOOL bHtml = 0 != PTR_CAST(SwWebDocShell, pDocSh); for( BYTE nLvl = 0; nLvl < MAXLEVEL; ++nLvl ) { SwNumFmt aFmt( aNumRule.Get( nLvl ) ); aFmt.SetCharFmt( pChrFmt ); + + if (! bNum) + { + aFmt.SetBulletFont( pFnt ); + aFmt.SetBulletChar( cBulletChar ); + aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); + } + if(bHtml && nLvl) { // 1/2" fuer HTML @@ -1210,48 +1231,88 @@ void SwWrtShell::NumOn() SetCurNumRule( aNumRule ); } } + else if (pCurRule && pCurRule->IsOutlineRule()) + { + SwNumRule aNumRule(*pCurRule); + + SwTxtNode * pTxtNode = + GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode(); + + if (pTxtNode) + { + const SwNodeNum * pNum = pTxtNode->GetNum(); + + if (pNum) + { + SwNumFmt aFmt(aNumRule.Get(pNum->GetRealLevel())); + + if (bNum) + aFmt.SetNumberingType(SVX_NUM_ARABIC); + else + { + const Font* pFnt = &SwNumRule::GetDefBulletFont(); + aFmt.SetBulletFont( pFnt ); + aFmt.SetBulletChar( cBulletChar ); + aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); + } + aNumRule.Set(pNum->GetRealLevel(), aFmt); + + SetCurNumRule(aNumRule); + } + } + } } -/*------------------------------------------------------------------------ - Beschreibung: Default-Bulletliste erfragen -------------------------------------------------------------------------*/ +void SwWrtShell::NumOn() +{ + NumOrBulletOn(TRUE); +} -void SwWrtShell::BulletOn() +void SwWrtShell::NumOrBulletOff() { - // #115901# - const SwNumRule * pNumRule = - GetDoc()->SearchNumRule(*GetCrsr()->GetPoint(), - FALSE, FALSE, 0); + const SwNumRule * pCurNumRule = GetCurNumRule(); - if (pNumRule) - SetCurNumRule(*pNumRule); - else + if (pCurNumRule) { - SwNumRule aRule( GetUniqueNumRuleName() ); + if (pCurNumRule->IsOutlineRule()) + { + SwNumRule aNumRule(*pCurNumRule); - SwCharFmt* pChrFmt = GetCharFmtFromPool( RES_POOLCHR_BUL_LEVEL ); - const Font* pFnt = &SwNumRule::GetDefBulletFont(); + SwTxtNode * pTxtNode = + GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode(); - SwDocShell* pDocSh = GetView().GetDocShell(); - BOOL bHtml = 0 != PTR_CAST(SwWebDocShell, pDocSh); - for( BYTE n = 0; n < MAXLEVEL; ++n ) - { - SwNumFmt aFmt( aRule.Get( n ) ); - aFmt.SetBulletFont( pFnt ); - aFmt.SetBulletChar( cBulletChar ); - aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); - aFmt.SetCharFmt( pChrFmt ); - if(bHtml && n) + if (pTxtNode) { - // 1/2" fuer HTML - aFmt.SetLSpace(720); - aFmt.SetAbsLSpace(n * 720); + const SwNodeNum * pNum = pTxtNode->GetNum(); + + if (pNum) + { + SwNumFmt aFmt(aNumRule.Get(pNum->GetRealLevel())); + + aFmt.SetNumberingType(SVX_NUM_NUMBER_NONE); + aNumRule.Set(pNum->GetRealLevel(), aFmt); + + SetCurNumRule(aNumRule); + } } - aRule.Set( n, aFmt ); } - SetCurNumRule( aRule ); + else + { + DelNumRules(); + } } } +// <- #i29560# + +/*------------------------------------------------------------------------ + Beschreibung: Default-Bulletliste erfragen +------------------------------------------------------------------------*/ + +void SwWrtShell::BulletOn() +{ + NumOrBulletOn(FALSE); +} + /*-------------------------------------------------- |