summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-01-07 11:57:24 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-01-07 11:57:24 +0000
commit57d9cc8bae84156f7e6a73e96d6531227b0a4f4c (patch)
tree94981e47bc35844afff39f8a8e0fd5d9eec29fcc /sw/source
parent8ecedd6a64f682007f714e21a48bf48a6ceae81c (diff)
CWS-TOOLING: integrate CWS outlinelevel
2008-12-19 10:32:51 +0100 od r265718 : #i70748# method <SwWW8Writer::StartTOX(..)> - correction for custom to outline style assigned paragraph styles 2008-12-19 09:24:41 +0100 od r265715 : #i70748# method <HandleModifyAtTxtNode(..)> - retrieve former applied list style before potential reset of empty list style due to set outline level 2008-12-17 15:33:57 +0100 hde r265608 : #i97013# 2008-12-17 14:43:42 +0100 od r265603 : #i70748# adjust fix i44177 - adjustment of to outline style assigned paragraph styles only for OOo-Templates. 2008-12-17 12:59:42 +0100 od r265598 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - special handling of OOo 2.x document regarding outline numbering of headings. 2008-12-17 12:45:53 +0100 od r265597 : #i70748# method <HandleModifyAtTxtNode(..)> - correct determination of new and former applied list style 2008-12-17 10:18:41 +0100 od r265581 : #i97312# method <XMLTextNumRuleInfo::Set(..)> - check, if numbering rules instance contains any numbering rule. 2008-12-16 14:34:22 +0100 hde r265542 : #i97013 2008-12-16 14:20:24 +0100 od r265541 : #i70748# adjust documentation of "Which"-ID numbers 2008-12-16 14:19:49 +0100 od r265539 : #i70748# Adjust Attribute-Function-Mapping table due to new attribute 2008-12-16 14:06:24 +0100 od r265538 : #i70748# - Correct handling of to outline style assigned paragraph styles on reset of all paragraph style attributes - WW8 import: Consider refactoring of paragraph style's outline level attribute - NO_NUMBERING define no longer exsits. 2008-12-16 10:37:19 +0100 od r265530 : #i70478# Correction on moving outline paragraph up respectively down in its outline level: - Check also outline paragraph, which are not an outline via a to outline style assigned paragraph style, if action is applicable. 2008-12-16 09:10:13 +0100 hde r265523 : #i97277 2008-12-16 09:09:30 +0100 hde r265522 : #i97277 2008-12-16 09:07:40 +0100 hde r265521 : Added control and purged obsolete id's 2008-12-10 13:09:36 +0100 od r265174 : #i70748# correction of previous fix due to warning-free code 2008-12-10 13:03:30 +0100 od r265172 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - Due to performance issues avoid retrieving outline level value from paragraph's paragraph style for each paragraph. Instead retrieve current outline level value from paragraph, which is the inherited value from its paragraph style, and only when it is needed. 2008-12-09 16:50:36 +0100 ufi r265117 : help 2008-12-09 16:49:50 +0100 ufi r265116 : help 2008-12-09 15:45:05 +0100 od r265107 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - some minor rework and check access to paragraph styles 2008-12-09 15:42:04 +0100 od r265106 : #i70748# adjust name of local variable to avoid hiding of class variable 2008-12-09 15:40:51 +0100 od r265105 : #i70748# correct initialization order 2008-12-09 15:35:07 +0100 od r265101 : #i70748# remove duplicate entry in certain property map 2008-12-09 15:33:39 +0100 od r265100 : #i70748# add end of file token 2008-12-07 15:11:54 +0100 zhaojianwei r264952 : conflicts left not to be resolved when cws rebase 2008-12-04 14:52:21 +0100 zhaojianwei r264846 : CWS-TOOLING: rebase CWS outlinelevel to trunk@264325 (milestone: DEV300:m36) 2008-11-28 03:42:09 +0100 zhaojianwei r264525 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:39 +0100 zhaojianwei r264524 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:11 +0100 zhaojianwei r264523 : #i70748#: migrate CWS outlinelevel to SVN
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/bastyp/init.cxx6
-rw-r--r--sw/source/core/crsr/crstrvl.cxx11
-rw-r--r--sw/source/core/doc/dbgoutsw.cxx10
-rw-r--r--sw/source/core/doc/doc.cxx14
-rw-r--r--sw/source/core/doc/docdde.cxx6
-rw-r--r--sw/source/core/doc/docfld.cxx7
-rw-r--r--sw/source/core/doc/docfmt.cxx46
-rw-r--r--sw/source/core/doc/docglbl.cxx370
-rw-r--r--sw/source/core/doc/docnum.cxx132
-rw-r--r--sw/source/core/doc/doctxm.cxx33
-rw-r--r--sw/source/core/doc/fmtcol.cxx63
-rw-r--r--sw/source/core/doc/ftnidx.cxx9
-rw-r--r--sw/source/core/doc/poolfmt.cxx9
-rw-r--r--sw/source/core/docnode/ndnum.cxx143
-rw-r--r--sw/source/core/docnode/ndtbl.cxx3
-rw-r--r--sw/source/core/docnode/node.cxx8
-rw-r--r--sw/source/core/docnode/nodes.cxx39
-rw-r--r--sw/source/core/edit/acorrect.cxx4
-rw-r--r--sw/source/core/edit/ednumber.cxx23
-rw-r--r--sw/source/core/fields/chpfld.cxx9
-rw-r--r--sw/source/core/text/EnhancedPDFExportHelper.cxx5
-rw-r--r--sw/source/core/tox/txmsrt.cxx12
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx285
-rw-r--r--sw/source/core/undo/rolbck.cxx3
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx26
-rw-r--r--sw/source/core/unocore/unomap.cxx11
-rw-r--r--sw/source/core/unocore/unoobj.cxx18
-rw-r--r--sw/source/core/unocore/unoobj2.cxx11
-rw-r--r--sw/source/core/unocore/unoprnms.cxx5
-rw-r--r--sw/source/core/unocore/unosett.cxx27
-rw-r--r--sw/source/core/unocore/unostyle.cxx75
-rw-r--r--sw/source/filter/rtf/rtfatr.cxx12
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx25
-rw-r--r--sw/source/filter/rtf/wrtrtf.cxx12
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx5
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx78
-rw-r--r--sw/source/filter/ww8/ww8par.cxx45
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx3
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx3
-rw-r--r--sw/source/filter/xml/swxml.cxx37
-rw-r--r--sw/source/filter/xml/xmlfmte.cxx9
-rw-r--r--sw/source/ui/app/app.src21
-rw-r--r--sw/source/ui/app/docsh2.cxx143
-rw-r--r--sw/source/ui/app/docst.cxx16
-rw-r--r--sw/source/ui/app/docstyle.cxx8
-rw-r--r--sw/source/ui/chrdlg/numpara.cxx73
-rw-r--r--sw/source/ui/chrdlg/numpara.hrc4
-rw-r--r--sw/source/ui/chrdlg/numpara.src72
-rw-r--r--sw/source/ui/chrdlg/paradlg.src4
-rw-r--r--sw/source/ui/chrdlg/pardlg.cxx7
-rw-r--r--sw/source/ui/docvw/edtwin.cxx17
-rw-r--r--sw/source/ui/fmtui/tmpdlg.cxx8
-rw-r--r--sw/source/ui/fmtui/tmpdlg.src4
-rw-r--r--sw/source/ui/inc/app.hrc11
-rw-r--r--sw/source/ui/inc/numpara.hxx11
-rw-r--r--sw/source/ui/inc/swuicnttab.hxx4
-rw-r--r--sw/source/ui/index/cnttab.cxx106
-rw-r--r--sw/source/ui/index/cnttab.src4
-rw-r--r--sw/source/ui/misc/outline.cxx121
-rw-r--r--sw/source/ui/misc/outline.src5
-rw-r--r--sw/source/ui/uiview/view.hrc1
-rw-r--r--sw/source/ui/uiview/view.src6
-rw-r--r--sw/source/ui/uiview/view2.cxx76
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx43
64 files changed, 1871 insertions, 546 deletions
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 0d43354160b2..9563a51324bb 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -358,6 +358,9 @@ SfxItemInfo __FAR_DATA aSlotTab[] =
{ SID_PARA_VERTALIGN, SFX_ITEM_POOLABLE }, // RES_PARATR_VERTALIGN
{ SID_ATTR_PARA_SNAPTOGRID, SFX_ITEM_POOLABLE }, // RES_PARATR_SNAPTOGRID
{ SID_ATTR_BORDER_CONNECT, SFX_ITEM_POOLABLE }, // RES_PARATR_CONNECT_BORDER
+
+ { SID_ATTR_PARA_OUTLINE_LEVEL, SFX_ITEM_POOLABLE }, // RES_PARATR_OUTLINELEVEL //#outline level,zhaojianwei
+
// --> OD 2008-02-19 #refactorlists#
{ 0, SFX_ITEM_POOLABLE }, // RES_PARATR_LIST_ID
{ 0, SFX_ITEM_POOLABLE }, // RES_PARATR_LIST_LEVEL
@@ -573,6 +576,9 @@ void _InitCore()
aAttrTab[ RES_PARATR_VERTALIGN - POOLATTR_BEGIN ] = new SvxParaVertAlignItem( 0, RES_PARATR_VERTALIGN );
aAttrTab[ RES_PARATR_SNAPTOGRID - POOLATTR_BEGIN ] = new SvxParaGridItem( sal_True, RES_PARATR_SNAPTOGRID );
aAttrTab[ RES_PARATR_CONNECT_BORDER - POOLATTR_BEGIN ] = new SwParaConnectBorderItem;
+
+ aAttrTab[ RES_PARATR_OUTLINELEVEL - POOLATTR_BEGIN ] = new SfxUInt16Item( RES_PARATR_OUTLINELEVEL, 0 );//#outline level,zhaojianwei
+
// --> OD 2008-02-19 #refactorlists#
aAttrTab[ RES_PARATR_LIST_ID - POOLATTR_BEGIN ] = new SfxStringItem( RES_PARATR_LIST_ID, aEmptyStr );
aAttrTab[ RES_PARATR_LIST_LEVEL - POOLATTR_BEGIN ] = new SfxInt16Item( RES_PARATR_LIST_LEVEL, 0 );
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 8f7c229443f7..87a579150e76 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -904,8 +904,11 @@ USHORT SwCrsrShell::GetOutlinePos( BYTE nLevel )
while( nPos-- ) // immer den davor testen !
{
pNd = rNds.GetOutLineNds()[ nPos ];
- if( ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel() <= nLevel )
+
+ //if( ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel() <= nLevel )//#outline level,zhaojianwei
+ if( ((SwTxtNode*)pNd)->GetAttrOutlineLevel()-1 <= nLevel )//<-end,zhaojianwei
return nPos;
+
}
return USHRT_MAX; // davor keiner mehr also Ende
}
@@ -935,11 +938,13 @@ BOOL SwCrsrShell::MakeOutlineSel( USHORT nSttPos, USHORT nEndPos,
if( bWithChilds )
{
- BYTE nLevel = pEndNd->GetTxtNode()->GetTxtColl()->GetOutlineLevel();
+ //BYTE nLevel = pEndNd->GetTxtNode()->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
+ const int nLevel = pEndNd->GetTxtNode()->GetAttrOutlineLevel()-1;//<-end.zhaojianwei
for( ++nEndPos; nEndPos < rOutlNds.Count(); ++nEndPos )
{
pEndNd = rOutlNds[ nEndPos ];
- BYTE nNxtLevel = pEndNd->GetTxtNode()->GetTxtColl()->GetOutlineLevel();
+ //BYTE nNxtLevel = pEndNd->GetTxtNode()->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
+ const int nNxtLevel = pEndNd->GetTxtNode()->GetAttrOutlineLevel()-1;//<-end,zhaojianwei
if( nNxtLevel <= nLevel )
break; // EndPos steht jetzt auf dem naechsten
}
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index 812399ae9bf7..e81383f0d6d5 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -574,9 +574,14 @@ String lcl_dbg_out(const SwNode & rNode)
aTmpStr += String("<tbl/>", RTL_TEXTENCODING_ASCII_US);
aTmpStr += String("<outlinelevel>", RTL_TEXTENCODING_ASCII_US);
+<<<<<<< .working
+ //aTmpStr += String::CreateFromInt32(pTxtNode->GetOutlineLevel());//#outline level,zhaojianwei
+ aTmpStr += String::CreateFromInt32(pTxtNode->GetAttrOutlineLevel()-1);//<-end,zhaojianwei
+=======
aTmpStr += String::CreateFromInt32(pTxtNode->GetOutlineLevel());
aTmpStr += String("</outlinelevel>", RTL_TEXTENCODING_ASCII_US);
+>>>>>>> .merge-right.r264324
const SwNumRule * pNumRule = pTxtNode->GetNumRule();
if (pNumRule != NULL)
@@ -630,7 +635,8 @@ String lcl_dbg_out(const SwNode & rNode)
aTmpStr += String("(", RTL_TEXTENCODING_ASCII_US);
aTmpStr += String::CreateFromInt32
- (static_cast<SwTxtFmtColl *>(pColl)->GetOutlineLevel());
+ //(static_cast<SwTxtFmtColl *>(pColl)->GetOutlineLevel());//#outline level,zhaojianwei
+ (static_cast<SwTxtFmtColl *>(pColl)->GetAssignedOutlineStyleLevel());//<-end,zhaojianwei
const SwNumRuleItem & rItem =
static_cast<const SwNumRuleItem &>
@@ -906,7 +912,7 @@ String lcl_dbg_out(const SwTxtFmtColl & rFmt)
String aResult(rFmt.GetName());
aResult += String("(", RTL_TEXTENCODING_ASCII_US);
- aResult += String::CreateFromInt32(rFmt.GetOutlineLevel());
+ aResult += String::CreateFromInt32(rFmt.GetAttrOutlineLevel());
aResult += String(")", RTL_TEXTENCODING_ASCII_US);
return aResult;
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index caacb62076a0..b02551b4eead 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1414,9 +1414,10 @@ void SwDoc::Summary( SwDoc* pExtDoc, BYTE nLevel, BYTE nPara, BOOL bImpress )
for( i = 0; i < rOutNds.Count(); ++i )
{
::SetProgressState( i, GetDocShell() );
- ULONG nIndex = rOutNds[ i ]->GetIndex();
- BYTE nLvl = ((SwTxtNode*)GetNodes()[ nIndex ])->GetTxtColl()
- ->GetOutlineLevel();
+ const ULONG nIndex = rOutNds[ i ]->GetIndex();
+ //BYTE nLvl = ((SwTxtNode*)GetNodes()[ nIndex ])->GetTxtColl()//#outline level,zhaojianwei
+ // ->GetOutlineLevel();
+ const int nLvl = ((SwTxtNode*)GetNodes()[ nIndex ])->GetAttrOutlineLevel()-1;//<-end,zhaojianwei
if( nLvl > nLevel )
continue;
USHORT nEndOfs = 1;
@@ -1454,8 +1455,11 @@ void SwDoc::Summary( SwDoc* pExtDoc, BYTE nLevel, BYTE nPara, BOOL bImpress )
if( bImpress )
{
SwTxtFmtColl* pMyColl = pNd->GetTxtColl();
- USHORT nHeadLine = static_cast<USHORT>(pMyColl->GetOutlineLevel()==NO_NUMBERING ?
- RES_POOLCOLL_HEADLINE2 : RES_POOLCOLL_HEADLINE1);
+ //USHORT nHeadLine = static_cast<USHORT>(pMyColl->GetOutlineLevel()==NO_NUMBERING ?//#outlinelevel,zhaojianwei
+ const USHORT nHeadLine = static_cast<USHORT>(
+ !pMyColl->IsAssignedToListLevelOfOutlineStyle() //<-end,zhaojianwei
+ ? RES_POOLCOLL_HEADLINE2
+ : RES_POOLCOLL_HEADLINE1 );
pMyColl = pExtDoc->GetTxtCollFromPool( nHeadLine );
pNd->ChgFmtColl( pMyColl );
}
diff --git a/sw/source/core/doc/docdde.cxx b/sw/source/core/doc/docdde.cxx
index 9d3b10404d6e..59cc7cdc97fe 100644
--- a/sw/source/core/doc/docdde.cxx
+++ b/sw/source/core/doc/docdde.cxx
@@ -340,7 +340,8 @@ BOOL SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
if( GotoOutline( aPos, sName ))
{
SwNode* pNd = &aPos.nNode.GetNode();
- BYTE nLvl = pNd->GetTxtNode()->GetTxtColl()->GetOutlineLevel();
+ //BYTE nLvl = pNd->GetTxtNode()->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
+ const int nLvl = pNd->GetTxtNode()->GetAttrOutlineLevel()-1;//<-end,zhaojianwei
const SwOutlineNodes& rOutlNds = GetNodes().GetOutLineNds();
USHORT nTmpPos;
@@ -351,7 +352,8 @@ BOOL SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
for( ++nTmpPos;
nTmpPos < rOutlNds.Count() &&
nLvl < rOutlNds[ nTmpPos ]->GetTxtNode()->
- GetTxtColl()->GetOutlineLevel();
+ //GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
+ GetAttrOutlineLevel()-1;//<-end,zhaojianwei
++nTmpPos )
; // es gibt keinen Block
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 67be965fbb44..39320b14fc02 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -1506,7 +1506,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
if( pSFld->IsSequenceFld() )
{
- BYTE nLvl = pSFldTyp->GetOutlineLvl();
+ const BYTE nLvl = pSFldTyp->GetOutlineLvl();
if( MAXLEVEL > nLvl )
{
// dann teste, ob die Nummer neu aufsetzen muss
@@ -2199,8 +2199,9 @@ bool SwDoc::SetFieldsDirty( bool b, const SwNode* pChk, ULONG nLen )
const SwTxtNode* pTNd = rNds[ nStt++ ]->GetTxtNode();
if( pTNd )
{
- if( pTNd->GetFmtColl() &&
- MAXLEVEL > pTNd->GetTxtColl()->GetOutlineLevel() )
+ if( //pTNd->GetFmtColl() && //#outline level,zhaojianwei
+ // MAXLEVEL > pTNd->GetTxtColl()->GetOutlineLevel() )
+ pTNd->GetAttrOutlineLevel() != 0 )//<-end,zhaojianwei
// Kapitelfelder aktualisieren
b = TRUE;
else if( pTNd->GetpSwpHints() && pTNd->GetSwpHints().Count() )
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index b99f0fbb90d7..5207a638612f 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -131,6 +131,8 @@ struct ParaRstFmt
bool bResetAll;
bool bInclRefToxMark;
+ bool bKeepOutlineLevelAttr; //#outline level,add by zhaojianwei
+
ParaRstFmt( const SwPosition* pStt, const SwPosition* pEnd,
SwHistory* pHst, USHORT nWhch = 0, const SfxItemSet* pSet = 0 )
: pFmtColl(0),
@@ -144,7 +146,8 @@ struct ParaRstFmt
bResetListAttrs( false ),
// <--
bResetAll( true ),
- bInclRefToxMark( false )
+ bInclRefToxMark( false ),
+ bKeepOutlineLevelAttr( false ) //#outline level,add by zhaojianwei
{}
ParaRstFmt( SwHistory* pHst )
@@ -159,7 +162,8 @@ struct ParaRstFmt
bResetListAttrs( false ),
// <--
bResetAll( true ),
- bInclRefToxMark( false )
+ bInclRefToxMark( false ),
+ bKeepOutlineLevelAttr( false ) //#outline level,add by zhaojianwei
{}
};
@@ -217,6 +221,7 @@ BOOL lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
SfxItemSet aSet( pDoc->GetAttrPool(),
RES_PAGEDESC, RES_BREAK,
RES_PARATR_NUMRULE, RES_PARATR_NUMRULE,
+ RES_PARATR_OUTLINELEVEL,RES_PARATR_OUTLINELEVEL,//#outline level,removed by zhaojianwei
RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1,
0 );
const SfxItemSet* pSet = pNode->GetpSwAttrSet();
@@ -247,9 +252,13 @@ BOOL lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
// <--
const SfxPoolItem* pItem;
- USHORT __READONLY_DATA aSavIds[ 3 ] = { RES_PAGEDESC, RES_BREAK,
- RES_PARATR_NUMRULE };
- for( USHORT n = 0; n < 3; ++n )
+ // USHORT __READONLY_DATA aSavIds[ 3 ] = { RES_PAGEDESC, RES_BREAK, //#outline level,removed by zhaojianwei
+ // RES_PARATR_NUMRULE };
+ //for( USHORT n = 0; n < 3; ++n )
+ USHORT __READONLY_DATA aSavIds[ 4 ] = { RES_PAGEDESC, RES_BREAK, //->add by zhaojianwei
+ RES_PARATR_NUMRULE,
+ RES_PARATR_OUTLINELEVEL };
+ for( USHORT n = 0; n < 4; ++n ) //<-end,zhaojianwei
{
if( SFX_ITEM_SET == pSet->GetItemState( aSavIds[ n ], FALSE, &pItem ))
{
@@ -267,6 +276,11 @@ BOOL lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
bSave = 0 != ((SwNumRuleItem*)pItem)->GetValue().Len();
}
break;
+ case RES_PARATR_OUTLINELEVEL: //#outline level,add by zhaojianwei
+ {
+ bSave = pPara && pPara->bKeepOutlineLevelAttr;
+ }
+ break; //<-end,zhaojianwei
}
if( bSave )
{
@@ -1707,6 +1721,10 @@ BOOL lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
SwTxtFmtColl* pFmt = static_cast<SwTxtFmtColl*>(pPara->pFmtColl);
if ( pPara->bReset )
{
+
+ if( pFmt->GetAttrOutlineLevel() == 0 && pPara )
+ pPara->bKeepOutlineLevelAttr = true;
+
lcl_RstAttr( pCNd, pPara );
// --> OD 2007-11-06 #i62675#
@@ -1894,9 +1912,11 @@ SwTxtFmtColl* SwDoc::CopyTxtColl( const SwTxtFmtColl& rColl )
pNewColl->CopyAttrs( rColl, TRUE );
// setze noch den Outline-Level
- if( NO_NUMBERING != rColl.GetOutlineLevel() )
- pNewColl->SetOutlineLevel( rColl.GetOutlineLevel() );
-
+ //if( NO_NUMBERING != rColl.GetOutlineLevel() ) //#outline level,zhaojianwei
+ // pNewColl->SetOutlineLevel( rColl.GetOutlineLevel() );
+ if(rColl.IsAssignedToListLevelOfOutlineStyle())
+ pNewColl->AssignToListLevelOfOutlineStyle(rColl.GetAssignedOutlineStyleLevel());//<-end,zhaojianwei
+ //<-end
pNewColl->SetPoolFmtId( rColl.GetPoolFmtId() );
pNewColl->SetPoolHelpId( rColl.GetPoolHelpId() );
@@ -2046,8 +2066,11 @@ void SwDoc::CopyFmtArr( const SvPtrarr& rSourceArr,
rDestArr, pSrcColl->GetNextTxtFmtColl().GetName() ) );
// setze noch den Outline-Level
- if( NO_NUMBERING != pSrcColl->GetOutlineLevel() )
- pDstColl->SetOutlineLevel( pSrcColl->GetOutlineLevel() );
+ //if( NO_NUMBERING != pSrcColl->GetOutlineLevel() ) //#outline level,zhaojianwei
+ // pDstColl->SetOutlineLevel( pSrcColl->GetOutlineLevel() );
+ if(pSrcColl->IsAssignedToListLevelOfOutlineStyle())
+ pDstColl->AssignToListLevelOfOutlineStyle(pSrcColl->GetAssignedOutlineStyleLevel());//<-end,zhaojianwei
+ //<-end
//FEATURE::CONDCOLL
if( RES_CONDTXTFMTCOLL == pSrc->Which() )
@@ -2604,7 +2627,8 @@ namespace docfunc
SwTxtFmtColl* pTxtFmtColl = (*pTxtFmtColls)[i];
if ( pTxtFmtColl->IsDefault() ||
- pTxtFmtColl->GetOutlineLevel() == NO_NUMBERING )
+ // pTxtFmtColl->GetOutlineLevel() == NO_NUMBERING ) //#outline level,zhaojianwei
+ ! pTxtFmtColl->IsAssignedToListLevelOfOutlineStyle() ) //<-end,zhaojianwei
{
continue;
}
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index 5501054a511c..a4bfb749174c 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -79,6 +79,17 @@ BOOL SwDoc::GenerateGlobalDoc( const String& rPath,
return SplitDoc( SPLITDOC_TO_GLOBALDOC, rPath, pSplitColl );
}
+//#outline level,add by zhaojianwei
+BOOL SwDoc::GenerateGlobalDoc( const String& rPath, int nOutlineLevel )
+{
+ return SplitDoc( SPLITDOC_TO_GLOBALDOC, rPath, nOutlineLevel );
+}
+BOOL SwDoc::GenerateHTMLDoc( const String& rPath, int nOutlineLevel )
+{
+ return SplitDoc( SPLITDOC_TO_HTML, rPath, nOutlineLevel );
+}
+//<-end,zhaojianwei
+
BOOL SwDoc::GenerateHTMLDoc( const String& rPath,
const SwTxtFmtColl* pSplitColl )
{
@@ -88,7 +99,8 @@ BOOL SwDoc::GenerateHTMLDoc( const String& rPath,
BYTE nLvl = 1;
const SwTxtFmtColls& rFmtColls =*GetTxtFmtColls();
for( USHORT n = rFmtColls.Count(); n; )
- if( nLvl == rFmtColls[ --n ]->GetOutlineLevel() )
+ //if( nLvl == rFmtColls[ --n ]->GetOutlineLevel() )//#outline level,zhaojianwei
+ if( nLvl == rFmtColls[ --n ]->GetAttrOutlineLevel() -1 )//<-end,zhaojianwei 0814
{
pSplitColl = rFmtColls[ n ];
break;
@@ -123,7 +135,8 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
{
// wenn keine OutlineNumerierung ist, dann benutze eigenes Array
// und sammel die Nodes zusammen.
- if( NO_NUMBERING == pSplitColl->GetOutlineLevel() )
+ //if( NO_NUMBERING == pSplitColl->GetOutlineLevel() )//#outline level,zhaojianwei
+ if( pSplitColl->GetAttrOutlineLevel() == 0 )//<-end,zhaojianwei, 0814
{
pOutlNds = new SwOutlineNodes( 8, 8 );
SwClientIter aIter( *(SwModify*)pSplitColl );
@@ -144,7 +157,8 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
// dann suche die Gliederungs - Vorlage, der 1. Ebene
const SwTxtFmtColls& rFmtColls =*GetTxtFmtColls();
for( USHORT n = rFmtColls.Count(); n; )
- if( !rFmtColls[ --n ]->GetOutlineLevel() )
+ //if( !rFmtColls[ --n ]->GetOutlineLevel() )//#outline level,zhaojianwei
+ if ( rFmtColls[ --n ]->GetAttrOutlineLevel() == 1 )//<-end,zhaojianwei
{
pSplitColl = rFmtColls[ n ];
break;
@@ -223,11 +237,17 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
pNd = pOutlNds->GetObject( nOutl );
SwTxtFmtColl* pTColl = pNd->GetTxtNode()->GetTxtColl();
+ //if( ( pTColl == pSplitColl || //#outline level,zhaojianwei
+ // ( NO_NUMBERING != pSplitColl->GetOutlineLevel() &&
+ // pTColl->GetOutlineLevel() <
+ // pSplitColl->GetOutlineLevel() )) &&
+ // !pNd->FindTableNode() )
if( ( pTColl == pSplitColl ||
- ( NO_NUMBERING != pSplitColl->GetOutlineLevel() &&
- pTColl->GetOutlineLevel() <
- pSplitColl->GetOutlineLevel() )) &&
- !pNd->FindTableNode() )
+ ( pSplitColl->GetAttrOutlineLevel() > 0 &&
+ pTColl->GetAttrOutlineLevel() > 0 &&
+ pTColl->GetAttrOutlineLevel() <
+ pSplitColl->GetAttrOutlineLevel() )) &&
+ !pNd->FindTableNode() ) //<-end,zhaojianwei
{
pEndNd = pNd;
@@ -493,4 +513,340 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
return pRet && pRet->GetValue();
}
+//#outline level,add by zhaojianwei
+BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel )
+{
+ if( !pDocShell || !pDocShell->GetMedium() ||
+ ( SPLITDOC_TO_GLOBALDOC == eDocType && get(IDocumentSettingAccess::GLOBAL_DOCUMENT) ) )
+ return FALSE;
+
+ USHORT nOutl = 0;
+ SwOutlineNodes* pOutlNds = (SwOutlineNodes*)&GetNodes().GetOutLineNds();
+ SwNodePtr pSttNd;
+
+ const SfxFilter* pFilter;
+ switch( eDocType )
+ {
+ case SPLITDOC_TO_HTML:
+ pFilter = SwIoSystem::GetFilterOfFormat( String::CreateFromAscii(
+ RTL_CONSTASCII_STRINGPARAM( "HTML" )));
+ break;
+
+ default:
+// case SPLITDOC_TO_GLOBALDOC:
+ pFilter = SwIoSystem::GetFilterOfFormat(
+ String::CreateFromAscii( FILTER_XML ));
+ eDocType = SPLITDOC_TO_GLOBALDOC;
+ break;
+ }
+
+ if( !pFilter )
+ return FALSE;
+
+ // Undo/Redline aufjedenfall abschalten
+ DoUndo( FALSE );
+ SetRedlineMode_intern( (RedlineMode_t)(GetRedlineMode() & ~nsRedlineMode_t::REDLINE_ON));
+
+ String sExt( pFilter->GetSuffixes().GetToken(0, ',') );
+ if( !sExt.Len() )
+ sExt.AssignAscii( "sxw" );
+ if( '.' != sExt.GetChar( 0 ) )
+ sExt.Insert( '.', 0 );
+
+ INetURLObject aEntry(rPath);
+ String sLeading(aEntry.GetBase());
+ aEntry.removeSegment();
+ String sPath = aEntry.GetMainURL( INetURLObject::NO_DECODE );
+ utl::TempFile aTemp(sLeading,&sExt,&sPath );
+ aTemp.EnableKillingFile();
+
+ DateTime aTmplDate;
+ {
+ Time a2Min( 0 ); a2Min.SetMin( 2 );
+ aTmplDate += a2Min;
+ }
+
+
+ // alle Ungueltigen ueberspringen
+ while( nOutl < pOutlNds->Count() &&
+ pOutlNds->GetObject( nOutl )->GetIndex() < GetNodes().GetEndOfExtras().GetIndex() )
+ ++nOutl;
+
+ do {
+ pSttNd = 0;
+
+ SwNodePtr pNd;
+ for( ; nOutl < pOutlNds->Count(); ++nOutl )
+ if( ( pNd = pOutlNds->GetObject( nOutl ))->GetTxtNode()->GetAttrOutlineLevel() == nOutlineLevel &&
+ !pNd->FindTableNode() )
+ {
+ pSttNd = pNd;
+ break;
+ }
+
+ if( pSttNd )
+ {
+ SwNodePtr pEndNd = 0;
+ for( ++nOutl; nOutl < pOutlNds->Count(); ++nOutl )
+ {
+ pNd = pOutlNds->GetObject( nOutl );
+
+ const int nLevel = pNd->GetTxtNode()->GetAttrOutlineLevel();
+
+ if( ( 0 < nLevel && nLevel <= nOutlineLevel ) &&
+ !pNd->FindTableNode() )
+ {
+ pEndNd = pNd;
+
+ break;
+ }
+ }
+ SwNodeIndex aEndIdx( pEndNd ? *pEndNd
+ : GetNodes().GetEndOfContent() );
+
+ String sFileName;
+ if( pSttNd->GetIndex() + 1 < aEndIdx.GetIndex() )
+ {
+ SfxObjectShellRef xDocSh( new SwDocShell( SFX_CREATE_MODE_INTERNAL ));
+ if( xDocSh->DoInitNew( 0 ) )
+ {
+ SwDoc* pDoc = ((SwDocShell*)(&xDocSh))->GetDoc();
+
+ uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
+ ((SwDocShell*)(&xDocSh))->GetModel(),
+ uno::UNO_QUERY_THROW);
+ uno::Reference<document::XDocumentProperties> xDocProps(
+ xDPS->getDocumentProperties());
+ DBG_ASSERT(xDocProps.is(), "Doc has no DocumentProperties");
+ // the GlobalDoc is the template
+ xDocProps->setTemplateName(aEmptyStr);
+ ::util::DateTime uDT(aTmplDate.Get100Sec(),
+ aTmplDate.GetSec(), aTmplDate.GetMin(),
+ aTmplDate.GetHour(), aTmplDate.GetDay(),
+ aTmplDate.GetMonth(), aTmplDate.GetYear());
+ xDocProps->setTemplateDate(uDT);
+ xDocProps->setTemplateURL(rPath);
+ //JP 14.06.99: Set the text of the "split para" as title
+ // from the new doc. Is the current doc has
+ // a title, insert it at begin.
+ String sTitle( xDocProps->getTitle() );
+ if( sTitle.Len() )
+ sTitle.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ));
+ sTitle += ((SwTxtNode*)pSttNd)->GetExpandTxt();
+ xDocProps->setTitle( sTitle );
+
+ // Vorlagen ersetzen
+ pDoc->ReplaceStyles( *this );
+
+ // KapitelNumerierung uebernehmen
+ if( pOutlineRule )
+ pDoc->SetOutlineNumRule( *pOutlineRule );
+
+ SwNodeRange aRg( *pSttNd, 0, aEndIdx.GetNode() );
+ SwNodeIndex aTmpIdx( pDoc->GetNodes().GetEndOfContent() );
+ GetNodes()._Copy( aRg, aTmpIdx, FALSE );
+
+ // den initialen TextNode loeschen
+ SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfExtras(), 2 );
+ if( aIdx.GetIndex() + 1 !=
+ pDoc->GetNodes().GetEndOfContent().GetIndex() )
+ pDoc->GetNodes().Delete( aIdx, 1 );
+
+ // alle Flys in dem Bereich
+ _CopyFlyInFly( aRg, aIdx );
+
+
+ // und noch alle Bookmarks
+ // ?????
+
+ utl::TempFile aTempFile2(sLeading,&sExt,&sPath );
+ sFileName = aTempFile2.GetURL();
+ SfxMedium* pTmpMed = new SfxMedium( sFileName,
+ STREAM_STD_READWRITE, TRUE );
+ pTmpMed->SetFilter( pFilter );
+
+ // fuer den HTML-Filter mussen wir aber ein Layout
+ // haben, damit Textrahmen/Controls/OLE-Objecte korrekt
+ // als Grafik exportiert werden koennen.
+ if( SPLITDOC_TO_HTML == eDocType &&
+ pDoc->GetSpzFrmFmts()->Count() )
+ {
+ /* SfxViewFrame* pFrame = */
+ SfxViewFrame::CreateViewFrame( *xDocSh, 0, TRUE );
+ }
+ xDocSh->DoSaveAs( *pTmpMed );
+ xDocSh->DoSaveCompleted( pTmpMed );
+
+ // beim Fehler wird keine FileLinkSection eingefuegt
+ if( xDocSh->GetError() )
+ sFileName.Erase();
+ }
+ xDocSh->DoClose();
+ }
+
+ // dann koennen ja die Bereiche eingefuegt werden
+ if( sFileName.Len() )
+ {
+ switch( eDocType )
+ {
+ case SPLITDOC_TO_HTML:
+ {
+ // loesche alle Nodes im Bereich und setze im "Start-
+ // Node" den Link auf das gespeicherte Doc
+ ULONG nNodeDiff = aEndIdx.GetIndex() -
+ pSttNd->GetIndex() - 1;
+ if( nNodeDiff )
+ {
+ SwPaM aTmp( *pSttNd, aEndIdx.GetNode(), 1, -1 );
+ aTmp.GetPoint()->nContent.Assign( 0, 0 );
+ aTmp.GetMark()->nContent.Assign( 0, 0 );
+ SwNodeIndex aSIdx( aTmp.GetMark()->nNode );
+ SwNodeIndex aEIdx( aTmp.GetPoint()->nNode );
+
+ // versuche hinters Ende zu verschieben
+ if( !aTmp.Move( fnMoveForward, fnGoNode ) )
+ {
+ // na gut, dann an den Anfang
+ aTmp.Exchange();
+ if( !aTmp.Move( fnMoveBackward, fnGoNode ))
+ {
+ ASSERT( FALSE, "kein Node mehr vorhanden" );
+ }
+ }
+ // Bookmarks usw. verschieben
+ CorrAbs( aSIdx, aEIdx, *aTmp.GetPoint(), TRUE);
+
+ // stehen noch FlyFrames rum, loesche auch diese
+ const SwPosition* pAPos;
+ for( USHORT n = 0; n < GetSpzFrmFmts()->Count(); ++n )
+ {
+ SwFrmFmt* pFly = (*GetSpzFrmFmts())[n];
+ const SwFmtAnchor* pAnchor = &pFly->GetAnchor();
+ if( ( FLY_AT_CNTNT == pAnchor->GetAnchorId() ||
+ FLY_AUTO_CNTNT == pAnchor->GetAnchorId() ) &&
+ 0 != ( pAPos = pAnchor->GetCntntAnchor() ) &&
+ aSIdx <= pAPos->nNode &&
+ pAPos->nNode < aEIdx )
+ {
+ DelLayoutFmt( pFly );
+ --n;
+ }
+ }
+
+ GetNodes().Delete( aSIdx, nNodeDiff );
+ }
+
+ // dann setze im StartNode noch den Link:
+ SwFmtINetFmt aINet( sFileName , aEmptyStr );
+ SwTxtNode* pTNd = (SwTxtNode*)pSttNd;
+ pTNd->InsertItem( aINet, 0, pTNd->GetTxt().Len() );
+
+ // wenn der nicht mehr gefunden wird, kann das nur
+ // ein Bug sein!
+ if( !pOutlNds->Seek_Entry( pSttNd, &nOutl ))
+ pSttNd = 0;
+ ++nOutl;
+ }
+ break;
+
+ default:
+ {
+ String sNm( INetURLObject( sFileName ).GetName() );
+ SwSection aSect( FILE_LINK_SECTION,
+ GetUniqueSectionName( &sNm ));
+ SwSectionFmt* pFmt = MakeSectionFmt( 0 );
+ aSect.SetLinkFileName(sFileName );
+ aSect.SetProtect();
+
+ aEndIdx--; // im InsertSection ist Ende inclusive
+ while( aEndIdx.GetNode().IsStartNode() )
+ aEndIdx--;
+
+ // JP 06.07.99 - Bug 67361 - is any Section ends or
+ // starts in the new sectionrange, they must end or
+ // start before or behind the range!
+ SwSectionNode* pSectNd = pSttNd->FindSectionNode();
+ while( pSectNd && pSectNd->EndOfSectionIndex()
+ <= aEndIdx.GetIndex() )
+ {
+ const SwNode* pSectEnd = pSectNd->EndOfSectionNode();
+ if( pSectNd->GetIndex() + 1 ==
+ pSttNd->GetIndex() )
+ {
+ BOOL bMvIdx = aEndIdx == *pSectEnd;
+ DelSectionFmt( pSectNd->GetSection().GetFmt() );
+ if( bMvIdx )
+ aEndIdx--;
+ }
+ else
+ {
+ SwNodeRange aRg( *pSttNd, *pSectEnd );
+ SwNodeIndex aIdx( *pSectEnd, 1 );
+ GetNodes()._MoveNodes( aRg, GetNodes(), aIdx );
+ }
+ pSectNd = pSttNd->FindSectionNode();
+ }
+
+ pSectNd = aEndIdx.GetNode().FindSectionNode();
+ while( pSectNd && pSectNd->GetIndex() >
+ pSttNd->GetIndex() )
+ {
+ if( aEndIdx < pSectNd->EndOfSectionIndex() )
+ {
+ SwNodeRange aRg( *pSectNd, 1, aEndIdx, 1 );
+ SwNodeIndex aIdx( *pSectNd );
+ GetNodes()._MoveNodes( aRg, GetNodes(), aIdx );
+ }
+
+ pSectNd = pSttNd->FindSectionNode();
+ }
+
+ SwNodeIndex aStartIdx(*pSttNd);
+
+ if (aEndIdx >= aStartIdx)
+ pSectNd = GetNodes().InsertSection
+ (aStartIdx, *pFmt, aSect, &aEndIdx, FALSE );
+ else
+ pSectNd = GetNodes().InsertSection
+ (aEndIdx, *pFmt, aSect, &aStartIdx, FALSE );
+
+ pSectNd->GetSection().CreateLink( CREATE_CONNECT );
+ }
+ break;
+ }
+ }
+ }
+ } while( pSttNd );
+
+ if( pOutlNds != &GetNodes().GetOutLineNds() )
+ delete pOutlNds;
+
+ switch( eDocType )
+ {
+ case SPLITDOC_TO_HTML:
+ if( get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
+ {
+ while( GetSections().Count() )
+ DelSectionFmt( GetSections()[ 0 ] );
+
+ SfxFilterContainer* pFCntnr = pDocShell->GetFactory().GetFilterContainer();
+ pFilter = pFCntnr->GetFilter4EA( pFilter->GetTypeName(), SFX_FILTER_EXPORT );
+ }
+ break;
+
+// case SPLITDOC_TO_GLOBALDOC:
+ default:
+ set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true);
+ set(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS, false);
+ }
+
+ SfxRequest aReq( SID_SAVEASDOC, SFX_CALLMODE_SYNCHRON, GetAttrPool() );
+ aReq.AppendItem( SfxStringItem( SID_FILE_NAME, rPath ) );
+ aReq.AppendItem( SfxBoolItem( SID_SAVETO, sal_True ) );
+ if(pFilter)
+ aReq.AppendItem( SfxStringItem( SID_FILTER_NAME, pFilter->GetName() ) );
+ const SfxBoolItem *pRet = (const SfxBoolItem*)pDocShell->ExecuteSlot( aReq );
+
+ return pRet && pRet->GetValue();
+}//<-end,zhaojianwei
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 921e5e7cac3f..423d041c1369 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -137,7 +137,8 @@ void SwDoc::PropagateOutlineRule()
{
SwTxtFmtColl *pColl = (*pTxtFmtCollTbl)[n];
- if (NO_NUMBERING != pColl->GetOutlineLevel())
+ // if (NO_NUMBERING != pColl->GetOutlineLevel())//#outline level,zhaojianwei
+ if(pColl->IsAssignedToListLevelOfOutlineStyle())//<-end,zhaojianwei
{
SwClientIter aIter(*pColl);
@@ -160,36 +161,6 @@ void SwDoc::PropagateOutlineRule()
pColl->SetFmtAttr(aNumItem);
}
}
-
- SwClient * pClient = aIter.First(TYPE(SwTxtNode));
- while (pClient)
- {
- SwTxtNode * pTxtNode = ((SwTxtNode *) pClient);
-
- if (pTxtNode->GetOutlineLevel() == NO_NUMBERING)
- {
- BYTE nOutlineLevel = pColl->GetOutlineLevel();
-
- if (nOutlineLevel < MAXLEVEL)
- {
- aNodes.UpdateOutlineNode(*pTxtNode);
- pTxtNode->UpdateOutlineState();
- }
- }
-
- // --> OD 2006-01-12 #126588# - applying outline level of
- // paragraph style at text node, if its numbering rule is the
- // outline numbering rule doesn't seem to be necessary due to
- // the changes in <SwTxtNode::SyncNumberAndNumRule()>.
- // Thus, only assert, if numbering level of text node with
- // outline numbering rule doesn't fit to outline level of
- // its paragraph style.
- ASSERT( pTxtNode->GetNumRule() != GetOutlineNumRule() ||
- pTxtNode->GetActualListLevel() == pColl->GetOutlineLevel(),
- "<SwDoc::PropagateOutlineRule()> - text node doesn't have excepted numbering level" );
-
- pClient = aIter.Next();
- }
}
}
}
@@ -226,9 +197,14 @@ BOOL SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
for( n = 0; n < pTxtFmtCollTbl->Count(); ++n )
{
- BYTE nLevel = (*pTxtFmtCollTbl)[ n ]->GetOutlineLevel();
- if( nLevel < MAXLEVEL )
+ //BYTE nLevel = (*pTxtFmtCollTbl)[ n ]->GetOutlineLevel();//#outline level,zhaojianwei
+ //if( nLevel < MAXLEVEL )
+ // aCollArr[ nLevel ] = (*pTxtFmtCollTbl)[ n ];
+ if((*pTxtFmtCollTbl)[ n ]->IsAssignedToListLevelOfOutlineStyle())
+ {
+ const int nLevel = (*pTxtFmtCollTbl)[ n ]->GetAssignedOutlineStyleLevel();
aCollArr[ nLevel ] = (*pTxtFmtCollTbl)[ n ];
+ }//<-end,zhaojianwei
}
/* --> #111107# */
@@ -252,10 +228,11 @@ BOOL SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
SwTxtFmtColl *aTmpColl =
GetTxtCollFromPool(static_cast<sal_uInt16>(RES_POOLCOLL_HEADLINE1 + n));
- if (aTmpColl->GetOutlineLevel() == n)
+ //if (aTmpColl->GetOutlineLevel() == n)//#outline level,zhaojianwei
+ if( aTmpColl->IsAssignedToListLevelOfOutlineStyle() &&
+ aTmpColl->GetAssignedOutlineStyleLevel() == n )//<-end,zhaojianwei
{
aCollArr[n] = aTmpColl;
-
break;
}
}
@@ -281,10 +258,11 @@ BOOL SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
SwTxtFmtColl *aTmpColl =
GetTxtCollFromPool(static_cast<sal_uInt16>(RES_POOLCOLL_HEADLINE1 + n));
- if (aTmpColl->GetOutlineLevel() == n)
+ //if (aTmpColl->GetOutlineLevel() == n)//#outline level,zhaojianwei
+ if( aTmpColl->IsAssignedToListLevelOfOutlineStyle() &&
+ aTmpColl->GetAssignedOutlineStyleLevel() == n )//<-end,zhaojianwei
{
aCollArr[n] = aTmpColl;
-
break;
}
}
@@ -361,10 +339,27 @@ BOOL SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
{
SwTxtNode* pTxtNd = rOutlNds[ n ]->GetTxtNode();
SwTxtFmtColl* pColl = pTxtNd->GetTxtColl();
- int nLevel = pColl->GetOutlineLevel();
-
- if (aMoveArr[nLevel] == -1)
- bMoveApplicable = false;
+// int nLevel = pColl->GetOutlineLevel();//#outline level,zhaojianwei
+// if (aMoveArr[nLevel] == -1)
+// bMoveApplicable = false;
+ if( pColl->IsAssignedToListLevelOfOutlineStyle() )
+ {
+ const int nLevel = pColl->GetAssignedOutlineStyleLevel();
+ if (aMoveArr[nLevel] == -1)
+ bMoveApplicable = false;
+ }//<-end,zhaojianwei
+ // --> OD 2008-12-16 #i70748#
+ // Check on outline level attribute of text node, if text node is
+ // not an outline via a to outline style assigned paragraph style.
+ else
+ {
+ const int nNewOutlineLevel = pTxtNd->GetAttrOutlineLevel() + nOffset;
+ if ( nNewOutlineLevel < 1 || nNewOutlineLevel > MAXLEVEL )
+ {
+ bMoveApplicable = false;
+ }
+ }
+ // <--
}
if (! bMoveApplicable )
@@ -386,22 +381,33 @@ BOOL SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
SwTxtNode* pTxtNd = rOutlNds[ n ]->GetTxtNode();
SwTxtFmtColl* pColl = pTxtNd->GetTxtColl();
- ASSERT(pColl->GetOutlineLevel() < MAXLEVEL,
- "non outline node in outline nodes?");
+ if( pColl->IsAssignedToListLevelOfOutlineStyle() )
+ {
+ // ASSERT(pColl->GetOutlineLevel() < MAXLEVEL, //#outline level,removed by zhaojianwei
+ // "non outline node in outline nodes?");
+ //int nLevel = pColl->GetOutlineLevel();
+ const int nLevel = pColl->GetAssignedOutlineStyleLevel();//#outline level,add by zhaojianwei
- int nLevel = pColl->GetOutlineLevel();
+ ASSERT(aMoveArr[nLevel] >= 0,
+ "move table: current TxtColl not found when building table!");
- ASSERT(aMoveArr[nLevel] >= 0,
- "move table: current TxtColl not found when building table!");
+ if (nLevel < MAXLEVEL && aMoveArr[nLevel] >= 0)
+ {
+ pColl = aCollArr[ aMoveArr[nLevel] ];
- if (nLevel < MAXLEVEL && aMoveArr[nLevel] >= 0)
- {
- pColl = aCollArr[ aMoveArr[nLevel] ];
+ if (pColl != NULL)
+ pColl = (SwTxtFmtColl*)pTxtNd->ChgFmtColl( pColl );
+ }
- if (pColl != NULL)
- pColl = (SwTxtFmtColl*)pTxtNd->ChgFmtColl( pColl );
}
+ else if( pTxtNd->GetAttrOutlineLevel() > 0) //#outline level,add by zhaojianwei
+ {
+ int nLevel = pTxtNd->GetAttrOutlineLevel() + nOffset;
+ if( 0 <= nLevel && nLevel <= MAXLEVEL)
+ pTxtNd->SetAttrOutlineLevel( nLevel );
+
+ }//<-end,zhaojianwei
n++;
// Undo ???
@@ -432,10 +438,13 @@ BOOL SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
USHORT nAktPos = 0;
SwNodeIndex aSttRg( rStt.nNode ), aEndRg( rEnd.nNode );
- BYTE nOutLineLevel = NO_NUMBERING;
+ //BYTE nOutLineLevel = NO_NUMBERING; //#outline level,zhaojianwei
+ int nOutLineLevel = MAXLEVEL; //<-end,zhaojianwei
SwNode* pSrch = &aSttRg.GetNode();
- if( pSrch->IsTxtNode() )
- nOutLineLevel = static_cast<BYTE>(((SwTxtNode*)pSrch)->GetOutlineLevel());
+ //if( pSrch->IsTxtNode() ) //#outline level,zhaojianwei
+ // nOutLineLevel = static_cast<BYTE>(((SwTxtNode*)pSrch)->GetOutlineLevel());
+ if( pSrch->IsTxtNode())
+ nOutLineLevel = static_cast<BYTE>(((SwTxtNode*)pSrch)->GetAttrOutlineLevel()-1);//<-end,zhaojianwei
SwNode* pEndSrch = &aEndRg.GetNode();
if( !GetNodes().GetOutLineNds().Seek_Entry( pSrch, &nAktPos ) )
{
@@ -457,7 +466,8 @@ BOOL SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
if( GetNodes().GetOutLineNds().Seek_Entry( pEndSrch, &nTmpPos ) )
{
if( !pEndSrch->IsTxtNode() || pEndSrch == pSrch ||
- nOutLineLevel < ((SwTxtNode*)pEndSrch)->GetOutlineLevel() )
+ //nOutLineLevel < ((SwTxtNode*)pEndSrch)->GetOutlineLevel() )//#outline level,zhaojianwei
+ nOutLineLevel < ((SwTxtNode*)pEndSrch)->GetAttrOutlineLevel()-1 )//<-end,zhaojianwei
++nTmpPos; // For sub outlines only!
}
@@ -648,7 +658,8 @@ USHORT lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
for( ; nPos < rOutlNds.Count(); ++nPos )
{
pNd = rOutlNds[ nPos ]->GetTxtNode();
- BYTE nLvl = pNd->GetTxtColl()->GetOutlineLevel();
+ //BYTE nLvl = pNd->GetTxtColl()->GetOutlineLevel(); //#outline level,zhaojianwei
+ const int nLvl = pNd->GetAttrOutlineLevel()-1; //<-end,zhaojianwei
if( nLvl == nLevel - 1)
{
// check for the outline num
@@ -1649,8 +1660,10 @@ void SwDoc::DelNumRules( const SwPaM& rPam )
if( RES_CONDTXTFMTCOLL == pTNd->GetFmtColl()->Which() )
pTNd->ChkCondColl();
- else if( !pOutlNd && NO_NUMBERING !=
- ((SwTxtFmtColl*)pTNd->GetFmtColl())->GetOutlineLevel() )
+ //else if( !pOutlNd && NO_NUMBERING != //#outline level,zhaojianwei
+ // ((SwTxtFmtColl*)pTNd->GetFmtColl())->GetOutlineLevel() )
+ else if( !pOutlNd &&
+ ((SwTxtFmtColl*)pTNd->GetFmtColl())->IsAssignedToListLevelOfOutlineStyle() )//<-end,zhaojianwei
pOutlNd = pTNd;
}
}
@@ -2739,7 +2752,8 @@ sal_Int32 SwDoc::getOutlineNodesCount() const
int SwDoc::getOutlineLevel( const sal_Int32 nIdx ) const
{
return GetNodes().GetOutLineNds()[ static_cast<USHORT>(nIdx) ]->
- GetTxtNode()->GetOutlineLevel();
+ // GetTxtNode()->GetOutlineLevel(); //#outline level,zhaojianwei
+ GetTxtNode()->GetAttrOutlineLevel()-1; //<-end,zhaojianwei
}
String SwDoc::getOutlineText( const sal_Int32 nIdx,
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 1b8e6262a415..0c849d3c1cba 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1297,7 +1297,8 @@ void SwTOXBaseSection::UpdateOutline( const SwTxtNode* pOwnChapterNode )
::SetProgressState( 0, pDoc->GetDocShell() );
SwTxtNode* pTxtNd = rOutlNds[ n ]->GetTxtNode();
if( pTxtNd && pTxtNd->Len() && pTxtNd->GetDepends() &&
- USHORT(pTxtNd->GetTxtColl()->GetOutlineLevel()+1) <= GetLevel() &&
+ //USHORT(pTxtNd->GetTxtColl()->GetOutlineLevel()+1) <= GetLevel() && //#outline level,zhaojianwei
+ USHORT( pTxtNd->GetAttrOutlineLevel()) <= GetLevel() && //<-end,zhaojianwei
pTxtNd->GetFrm() &&
!pTxtNd->HasHiddenParaField() &&
!pTxtNd->HasHiddenCharAttribute( true ) &&
@@ -1330,8 +1331,9 @@ void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode )
if( !pColl ||
( TOX_CONTENT == SwTOXBase::GetType() &&
GetCreateType() & nsSwTOXElement::TOX_OUTLINELEVEL &&
- NO_NUMBERING != pColl->GetOutlineLevel() ) )
- continue;
+ //NO_NUMBERING != pColl->GetOutlineLevel() ) )//#outline level,zhaojianwei
+ pColl->IsAssignedToListLevelOfOutlineStyle()) )//<-end,zhaojianwei
+ continue;
SwClientIter aIter( *pColl );
SwTxtNode* pTxtNd = (SwTxtNode*)aIter.First( TYPE( SwTxtNode ));
@@ -1549,7 +1551,7 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
if( pCNd )
{
//find node in body text
- USHORT nSetLevel = USHRT_MAX;
+ int nSetLevel = USHRT_MAX;
//#111105# tables of tables|illustrations|objects don't support hierarchies
if( IsLevelFromChapter() &&
@@ -1561,9 +1563,11 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
MAXLEVEL - 1 );
if( pOutlNd )
{
- USHORT nTmp = pOutlNd->GetTxtColl()->GetOutlineLevel();
- if( nTmp < NO_NUMBERING )
- nSetLevel = nTmp + 1;
+ //USHORT nTmp = pOutlNd->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
+ //if( nTmp < NO_NUMBERING )
+ // nSetLevel = nTmp + 1;
+ if( pOutlNd->GetTxtColl()->IsAssignedToListLevelOfOutlineStyle())
+ nSetLevel = pOutlNd->GetTxtColl()->GetAttrOutlineLevel() ;//<-end,zhaojianwei
}
}
@@ -1571,7 +1575,9 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
::lcl_FindChapterNode( *pCNd, 0 ) == pOwnChapterNode ))
{
SwTOXPara * pNew = new SwTOXPara( *pCNd, eMyType,
- USHRT_MAX != nSetLevel ? nSetLevel : FORM_ALPHA_DELIMITTER );
+ ( USHRT_MAX != nSetLevel )
+ ? static_cast<USHORT>(nSetLevel)
+ : FORM_ALPHA_DELIMITTER );
InsertSorted( pNew );
}
}
@@ -1616,9 +1622,14 @@ void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode )
::lcl_FindChapterNode( *pCNd, MAXLEVEL - 1 );
if( pOutlNd )
{
- USHORT nTmp = pOutlNd->GetTxtColl()->GetOutlineLevel();
- if( nTmp < NO_NUMBERING )
- pNew->SetLevel( nTmp + 1 );
+ //USHORT nTmp = pOutlNd->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
+ //if( nTmp < NO_NUMBERING )
+ // pNew->SetLevel( nTmp + 1 );
+ if( pOutlNd->GetTxtColl()->IsAssignedToListLevelOfOutlineStyle())
+ {
+ const int nTmp = pOutlNd->GetTxtColl()->GetAttrOutlineLevel();
+ pNew->SetLevel( static_cast<USHORT>(nTmp) );//<-end ,zhaojianwei
+ }
}
}
InsertSorted(pNew);
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index 9f321c07d104..83ef29ab1d1e 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -46,6 +46,12 @@
#include <numrule.hxx>
#include <paratr.hxx>
+//--> #outlinelevel added by zhaojianwei
+#ifndef _SFXINTITEM_HXX
+#include <svtools/intitem.hxx>
+#endif
+//<--end
+
TYPEINIT1( SwTxtFmtColl, SwFmtColl );
TYPEINIT1( SwGrfFmtColl, SwFmtColl );
TYPEINIT1( SwConditionTxtFmtColl, SwTxtFmtColl );
@@ -75,7 +81,7 @@ namespace TxtFmtCollFunc
// --> OD 2007-01-24 #i73790#
// if ( pTxtFmtColl->AssignedToListLevelOfOutlineStyle() )
if ( !pTxtFmtColl->StayAssignedToListLevelOfOutlineStyle() &&
- pTxtFmtColl->AssignedToListLevelOfOutlineStyle() )
+ pTxtFmtColl->IsAssignedToListLevelOfOutlineStyle() )
// <--
{
if ( !pNewNumRuleItem )
@@ -153,7 +159,7 @@ void SwTxtFmtColl::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
SvxLRSpaceItem *pNewLRSpace = 0, *pOldLRSpace = 0;
SvxFontHeightItem* aFontSizeArr[3] = {0,0,0};
// --> OD 2006-10-17 #i70223#
- const bool bAssignedToListLevelOfOutlineStyle( AssignedToListLevelOfOutlineStyle() );
+ const bool bAssignedToListLevelOfOutlineStyle(IsAssignedToListLevelOfOutlineStyle());//#outline level ,zhaojianwei
const SwNumRuleItem* pNewNumRuleItem( 0L );
// <--
@@ -428,9 +434,24 @@ USHORT SwTxtFmtColl::ResetAllFmtAttr()
{
const bool bOldState( mbStayAssignedToListLevelOfOutlineStyle );
mbStayAssignedToListLevelOfOutlineStyle = true;
+ // --> OD 2008-12-16 #i70748#
+ // Outline level is no longer a member, it is a attribute now.
+ // Thus, it needs to be restored, if the paragraph style is assigned
+ // to the outline style
+ const int nAssignedOutlineStyleLevel = IsAssignedToListLevelOfOutlineStyle()
+ ? GetAssignedOutlineStyleLevel()
+ : -1;
+ // <--
USHORT nRet = SwFmtColl::ResetAllFmtAttr();
+ // --> OD 2008-12-16 #i70748#
+ if ( nAssignedOutlineStyleLevel != -1 )
+ {
+ AssignToListLevelOfOutlineStyle( nAssignedOutlineStyleLevel );
+ }
+ // <--
+
mbStayAssignedToListLevelOfOutlineStyle = bOldState;
return nRet;
@@ -640,18 +661,38 @@ void SwConditionTxtFmtColl::SetConditions( const SwFmtCollConditions& rCndClls )
aCondColls.Insert( pNew, n );
}
}
+//#outline level, zhaojianwei
+void SwTxtFmtColl::SetAttrOutlineLevel( int nLevel)
+{
+ ASSERT( 0 <= nLevel && nLevel <= MAXLEVEL ,"SwTxtFmtColl: Level Out Of Range" );
+ SetFmtAttr( SfxUInt16Item( RES_PARATR_OUTLINELEVEL,
+ static_cast<UINT16>(nLevel) ) );
+}
-void SwTxtFmtColl::SetOutlineLevel( BYTE nLevel )
+int SwTxtFmtColl::GetAttrOutlineLevel() const
{
- ASSERT( nLevel < MAXLEVEL || nLevel == NO_NUMBERING ,
- "SwTxtFmtColl: Level too low" );
- if (!(nLevel < MAXLEVEL || nLevel == NO_NUMBERING))
- // take care of out-of-bounds values that may occasionally crash the office
- // such values may for example occur directly from some bad used API calls
- nOutlineLevel = NO_NUMBERING;
- else
- nOutlineLevel = nLevel;
+ return ((const SfxUInt16Item &)GetFmtAttr(RES_PARATR_OUTLINELEVEL)).GetValue();
}
+int SwTxtFmtColl::GetAssignedOutlineStyleLevel() const
+{
+ ASSERT( IsAssignedToListLevelOfOutlineStyle(),
+ "<SwTxtFmtColl::GetAssignedOutlineStyleLevel()> - misuse of method");
+ return GetAttrOutlineLevel() - 1;
+}
+
+void SwTxtFmtColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
+{
+
+ mbAssignedToOutlineStyle = true;
+ SetAttrOutlineLevel(nAssignedListLevel+1);
+}
+
+void SwTxtFmtColl::DeleteAssignmentToListLevelOfOutlineStyle()
+{
+ mbAssignedToOutlineStyle = false;
+ ResetFmtAttr(RES_PARATR_OUTLINELEVEL);
+}
+//<-end,zhaojianwei
//FEATURE::CONDCOLL
diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx
index b05ac811c846..f91ee10f1ae7 100644
--- a/sw/source/core/doc/ftnidx.cxx
+++ b/sw/source/core/doc/ftnidx.cxx
@@ -113,11 +113,13 @@ void SwFtnIdxs::UpdateFtn( const SwNodeIndex& rStt )
for( n = 0; n < rOutlNds.Count(); ++n )
if( rOutlNds[ n ]->GetIndex() > rStt.GetIndex() )
break; // gefunden
- else if( !rOutlNds[ n ]->GetTxtNode()->GetTxtColl()->GetOutlineLevel() )
+ //else if( !rOutlNds[ n ]->GetTxtNode()->GetTxtColl()->GetOutlineLevel() ) //#outline level,zhaojianwei
+ else if ( rOutlNds[ n ]->GetTxtNode()->GetAttrOutlineLevel() == 1 ) //<-end,zhaojianwei
pCapStt = rOutlNds[ n ]; // Start eines neuen Kapitels
// dann suche jetzt noch das Ende vom Bereich
for( ; n < rOutlNds.Count(); ++n )
- if( !rOutlNds[ n ]->GetTxtNode()->GetTxtColl()->GetOutlineLevel() )
+ //if( !rOutlNds[ n ]->GetTxtNode()->GetTxtColl()->GetOutlineLevel() )//#outline level,zhaojianwei
+ if ( rOutlNds[ n ]->GetTxtNode()->GetAttrOutlineLevel() == 1 )//<-end,zhaojianwei
{
nCapEnd = rOutlNds[ n ]->GetIndex(); // Ende des gefundenen Kapitels
break;
@@ -231,7 +233,8 @@ void SwFtnIdxs::UpdateAllFtn()
nFtnIdx = 0; // Index in das FtnIdx-Array
for( USHORT n = 0; n < rOutlNds.Count(); ++n )
{
- if( !rOutlNds[ n ]->GetTxtNode()->GetTxtColl()->GetOutlineLevel() )
+ //if( !rOutlNds[ n ]->GetTxtNode()->GetTxtColl()->GetOutlineLevel() )//#outline level,zhaojianwei
+ if ( rOutlNds[ n ]->GetTxtNode()->GetAttrOutlineLevel() == 1 )//<-end,zhaojianwei
{
ULONG nCapStt = rOutlNds[ n ]->GetIndex(); // Start eines neuen Kapitels
for( ; nFtnIdx < Count(); ++nFtnIdx )
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index ad06bf858c99..62022147e57c 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -233,7 +233,8 @@ void lcl_SetHeadline( SwDoc* pDoc, SwTxtFmtColl* pColl,
{
if( !( nOutLvlBits & ( 1 << nLevel )) )
{
- pColl->SetOutlineLevel( nLevel );
+ //pColl->SetOutlineLevel( nLevel ); //#outline level zhaojianwei
+ pColl->AssignToListLevelOfOutlineStyle(nLevel);//<-end,zhaojianwei
if( !bHTMLMode )
{
SwNumRule * pOutlineRule = pDoc->GetOutlineNumRule();
@@ -344,8 +345,10 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
{
return pNewColl;
}
- if( pNewColl->GetOutlineLevel() < MAXLEVEL )
- nOutLvlBits |= ( 1 << pNewColl->GetOutlineLevel() );
+ //if( pNewColl->GetOutlineLevel() < MAXLEVEL ) //#outline level,zhaojianwei
+ //nOutLvlBits |= ( 1 << pNewColl->GetOutlineLevel() );
+ if( pNewColl->IsAssignedToListLevelOfOutlineStyle())
+ nOutLvlBits |= ( 1 << pNewColl->GetAssignedOutlineStyleLevel() );//<-end,zhaojianwei
}
// bis hierher nicht gefunden -> neu anlegen
diff --git a/sw/source/core/docnode/ndnum.cxx b/sw/source/core/docnode/ndnum.cxx
index bddc10ddc79c..ae70599de061 100644
--- a/sw/source/core/docnode/ndnum.cxx
+++ b/sw/source/core/docnode/ndnum.cxx
@@ -127,73 +127,82 @@ void SwNodes::UpdateOutlineNode(SwNode & rNd)
}
}
-void SwNodes::UpdateOutlineNode( const SwNode& rNd, BYTE nOldLevel,
- BYTE nNewLevel )
-{
- const SwNodePtr pSrch = (SwNodePtr)&rNd;
- USHORT nSttPos;
- BOOL bSeekIdx = pOutlineNds->Seek_Entry( pSrch, &nSttPos );
-
- if( NO_NUMBERING == nOldLevel ) // neuen Level einfuegen
- {
- // nicht vorhanden, also einfuegen
- //ASSERT( !bSeekIdx, "Der Node ist schon als OutlineNode vorhanden" );
-
- //JP 12.03.99: 63293 - Nodes vom RedlineBereich NIE aufnehmen
- ULONG nNd = rNd.GetIndex();
- if( nNd < GetEndOfRedlines().GetIndex() &&
- nNd > GetEndOfRedlines().StartOfSectionNode()->GetIndex() )
- return ;
-
- // jetzt noch alle nachfolgende Outline-Nodes updaten
- if (! bSeekIdx)
- {
- // --> OD 2005-11-03 #125329#
- // assure that node <pSrch> is in the correct nodes array
- if ( &(pSrch->GetNodes()) == this )
- {
- pOutlineNds->Insert( pSrch );
- }
- else
- {
- ASSERT( false,
- "<SwNodes::UpdateOutlineNode(..)> - node <pSrch> isn't in correct nodes array. This is a serious defect -> inform OD" );
- }
- // <--
- }
-
- }
- else if( NO_NUMBERING == nNewLevel ) // Level entfernen
- {
- if( !bSeekIdx )
- return;
-
- // jetzt noch alle nachfolgende Outline-Nodes updaten
- pOutlineNds->Remove( nSttPos );
- }
- else if( !bSeekIdx ) // Update und Index nicht gefunden ??
- return ;
-
- {
- SwTxtNode & rTxtNd = (SwTxtNode &) rNd;
- SwPaM aPam(rTxtNd); // #115901#
-
- if (nNewLevel != NO_NUMBERING) // #115901#
- {
- rTxtNd.SetAttrListLevel(rTxtNd.GetTxtColl()->GetOutlineLevel());
-
- rTxtNd.NumRuleChgd();
- }
- else
- {
- GetDoc()->DelNumRules(aPam);
- }
- }
-
- // die Gliederungs-Felder Updaten
- GetDoc()->GetSysFldType( RES_CHAPTERFLD )->UpdateFlds();
- GetDoc()->ChkCondColls();
-}
+//void SwNodes::UpdateOutlineNode( const SwNode& rNd, BYTE nOldLevel, //#outline level,removed by zhaojianwei
+// BYTE nNewLevel )
+//{
+// const SwNodePtr pSrch = (SwNodePtr)&rNd;
+// USHORT nSttPos;
+// BOOL bSeekIdx = pOutlineNds->Seek_Entry( pSrch, &nSttPos );
+//
+// //if( NO_NUMBERING == nOldLevel ) //#outline level,zhaojianwei
+// if( 0 == nOldLevel ) //<-end, zhaojianwei
+// {
+// // nicht vorhanden, also einfuegen
+// //ASSERT( !bSeekIdx, "Der Node ist schon als OutlineNode vorhanden" );
+//
+// //JP 12.03.99: 63293 - Nodes vom RedlineBereich NIE aufnehmen
+// ULONG nNd = rNd.GetIndex();
+// if( nNd < GetEndOfRedlines().GetIndex() &&
+// nNd > GetEndOfRedlines().StartOfSectionNode()->GetIndex() )
+// return ;
+//
+// // jetzt noch alle nachfolgende Outline-Nodes updaten
+// if (! bSeekIdx)
+// {
+// // --> OD 2005-11-03 #125329#
+// // assure that node <pSrch> is in the correct nodes array
+// if ( &(pSrch->GetNodes()) == this )
+// {
+// pOutlineNds->Insert( pSrch );
+// }
+// else
+// {
+// ASSERT( false,
+// "<SwNodes::UpdateOutlineNode(..)> - node <pSrch> isn't in correct nodes array. This is a serious defect -> inform OD" );
+// }
+// // <--
+// }
+//
+// }
+// //else if( NO_NUMBERING == nNewLevel ) //#outline level,removed by zhaojianwei
+// else if( 0 == nNewLevel ) //<-end,added by zhaojianwei // Level entfernen
+// {
+// if( !bSeekIdx )
+// return;
+//
+// // jetzt noch alle nachfolgende Outline-Nodes updaten
+// pOutlineNds->Remove( nSttPos );
+// }
+// else if( !bSeekIdx ) // Update und Index nicht gefunden ??
+// return ;
+//
+// {
+// SwTxtNode & rTxtNd = (SwTxtNode &) rNd;
+// SwPaM aPam(rTxtNd); // #115901#
+//
+// //if (nNewLevel != NO_NUMBERING) //#outline level,zhaojianwei // #115901#
+// if (nNewLevel != 0) //<-end,zhaojianwei // #115901#
+// {
+// //rTxtNd.SetLevel(rTxtNd.GetTxtColl()->GetOutlineLevel()); //#outline level,zhaojianwei
+// //rTxtNd.NumRuleChgd();
+// if(rTxtNd.GetTxtColl()->IsAssignedToListLevelOfOutlineStyle())
+// {
+// rTxtNd.SetLevel(rTxtNd.GetTxtColl()->GetAssignedOutlineStyleLevel());
+// rTxtNd.NumRuleChgd();
+// }//<-end,zhaojianwei
+//
+// //GetDoc()->SetNumRule(aPam, *GetDoc()->GetOutlineNumRule());
+// }
+// else
+// {
+// GetDoc()->DelNumRules(aPam);
+// }
+// }
+//
+// // die Gliederungs-Felder Updaten
+// GetDoc()->GetSysFldType( RES_CHAPTERFLD )->UpdateFlds();
+// GetDoc()->ChkCondColls();
+//}//<-end,zhaojianwei
void SwNodes::UpdtOutlineIdx( const SwNode& rNd )
{
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 8763f53ac627..1e1bcd55022a 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -344,7 +344,8 @@ BOOL SwNodes::InsBoxen( SwTableNode* pTblNd,
pPrvBox = new SwTableBox( pBoxFmt, *pSttNd, pLine );
pLine->GetTabBoxes().C40_INSERT( SwTableBox, pPrvBox, nInsPos + n );
- if( NO_NUMBERING == pTxtColl->GetOutlineLevel()
+ //if( NO_NUMBERING == pTxtColl->GetOutlineLevel()//#outline level,zhaojianwei
+ if( ! pTxtColl->IsAssignedToListLevelOfOutlineStyle()//<-end,zhaojianwei
//FEATURE::CONDCOLL
&& RES_CONDTXTFMTCOLL != pTxtColl->Which()
//FEATURE::CONDCOLL
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 226593bc7ffd..00b4a3ec869c 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -880,8 +880,10 @@ const SwTxtNode* SwNode::FindOutlineNodeOfLevel( BYTE nLvl ) const
else
{
// oder ans Feld und von dort holen !!
- while( nPos && nLvl < ( pRet = rONds[nPos]->GetTxtNode() )
- ->GetTxtColl()->GetOutlineLevel() )
+ while( nPos &&
+ nLvl < ( pRet = rONds[nPos]->GetTxtNode() )
+ //->GetTxtColl()->GetOutlineLevel() )//#outline level,zhaojianwei
+ ->GetAttrOutlineLevel() - 1 ) //<-end,zhaojianwei
--nPos;
if( !nPos ) // bei 0 gesondert holen !!
@@ -1998,7 +2000,7 @@ BOOL SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const
if( pOutlNd->IsOutline())
{
- rTmp.SetCondition( PARA_IN_OUTLINE, pOutlNd->GetOutlineLevel() );
+ rTmp.SetCondition( PARA_IN_OUTLINE, pOutlNd->GetAttrOutlineLevel() - 1 );
return TRUE;
}
}
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 2488b1fd285a..ef39f7ced4a4 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -188,7 +188,8 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
pTxtNode->RemoveFromList();
// <--
- if ( pTxtNode->GetTxtColl()->GetOutlineLevel() != NO_NUMBERING )
+ //if ( pTxtNode->GetTxtColl()->GetOutlineLevel() != NO_NUMBERING )//#outline level,zhaojianwei
+ if ( pTxtNode->GetAttrOutlineLevel() != 0 )//<-end,zhaojianwei
{
const SwNodePtr pSrch = (SwNodePtr)&rNd;
pOutlineNds->Remove( pSrch );
@@ -207,7 +208,8 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
// <--
if( bInsOutlineIdx &&
- NO_NUMBERING != rTxtNd.GetTxtColl()->GetOutlineLevel() )
+ //NO_NUMBERING != rTxtNd.GetTxtColl()->GetOutlineLevel() )//#outline level,zhaojianwei
+ 0 != rTxtNd.GetAttrOutlineLevel() )//<-end,zhaojianwei
{
const SwNodePtr pSrch = (SwNodePtr)&rNd;
pOutlineNds->Insert( pSrch );
@@ -248,7 +250,8 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
SwTxtNode* pTxtNd = (SwTxtNode*)pNd;
// loesche die Gliederungs-Indizies aus dem alten Nodes-Array
- if( NO_NUMBERING != pTxtNd->GetTxtColl()->GetOutlineLevel() )
+ //if( NO_NUMBERING != pTxtNd->GetTxtColl()->GetOutlineLevel() )//#outline level,zhaojianwei
+ if( 0 != pTxtNd->GetAttrOutlineLevel() )//<-end,zhaojianwei
pOutlineNds->Remove( pNd );
// muss die Rule kopiere werden?
@@ -287,9 +290,13 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
{
const SwpHints* pHts = pTxtNd->GetpSwpHints();
// setze die OultineNodes im neuen Nodes-Array
- if( bInsOutlineIdx && NO_NUMBERING !=
- pTxtNd->GetTxtColl()->GetOutlineLevel() )
+ //if( bInsOutlineIdx && NO_NUMBERING != //#outline level,removed by zhaojianwei
+ // pTxtNd->GetTxtColl()->GetOutlineLevel() )
+ if( bInsOutlineIdx &&
+ 0 != pTxtNd->GetAttrOutlineLevel() ) //#outline level,added by zhaojianwei
+ {
rNds.pOutlineNds->Insert( pTxtNd );
+ }
// --> OD 2008-03-13 #refactorlists#
// pTxtNd->SyncNumberAndNumRule();
@@ -554,8 +561,10 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
// setze bei Start/EndNodes die richtigen Indizies
// loesche die Gliederungs-Indizies aus
// dem alten Nodes-Array
- if( pCNd->IsTxtNode() && NO_NUMBERING !=
- ((SwTxtNode*)pCNd)->GetTxtColl()->GetOutlineLevel() )
+ //if( pCNd->IsTxtNode() && NO_NUMBERING != //#outline level,zhaojianwei
+ // ((SwTxtNode*)pCNd)->GetTxtColl()->GetOutlineLevel() )
+ if( pCNd->IsTxtNode() && 0 !=
+ ((SwTxtNode*)pCNd)->GetAttrOutlineLevel() )//<-end,by zhaojianwei
pOutlineNds->Remove( pCNd );
else
pCNd = 0;
@@ -593,8 +602,10 @@ BOOL SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
((SwSectionNode*)pNd)->DelFrms();
}
*/
- BOOL bOutlNd = pNd->IsTxtNode() && NO_NUMBERING !=
- ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel();
+ //BOOL bOutlNd = pNd->IsTxtNode() && NO_NUMBERING !=//#outline level,zhaojianwei
+ // ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel();
+ const bool bOutlNd = pNd->IsTxtNode() &&
+ 0 != ((SwTxtNode*)pNd)->GetAttrOutlineLevel();//<-end,zhaojianwei
// loesche die Gliederungs-Indizies aus
// dem alten Nodes-Array
if( bOutlNd )
@@ -1280,9 +1291,10 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, ULONG nNodes)
if( pNd->IsTxtNode() )
{
- if( NO_NUMBERING !=
- ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel() &&
- pOutlineNds->Seek_Entry( pNd, &nIdxPos ))
+ //if( NO_NUMBERING != //#outline level,zhaojianwei
+ // ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel() &&
+ if( 0 != ((SwTxtNode*)pNd)->GetAttrOutlineLevel() &&//<-end,zhaojianwei
+ pOutlineNds->Seek_Entry( pNd, &nIdxPos ))
{
// loesche die Gliederungs-Indizies.
pOutlineNds->Remove( nIdxPos );
@@ -1669,7 +1681,8 @@ void SwNodes::DelNodes( const SwNodeIndex & rStart, ULONG nCnt )
SwNode* pNd = (*this)[ n ];
if( pNd->IsTxtNode() &&
- NO_NUMBERING != ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel() )
+ //NO_NUMBERING != ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel() )//#outline level,zhaojianwei
+ 0 != ((SwTxtNode*)pNd)->GetAttrOutlineLevel() ) //<-end,zhaojianwei
{ // loesche die Gliederungs-Indizies.
USHORT nIdxPos;
if( pOutlineNds->Seek_Entry( pNd, &nIdxPos ))
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index 4894ee5f1cc6..dfe258def74d 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -284,8 +284,8 @@ const String* SwAutoCorrDoc::GetPrevPara( BOOL bAtNormalPos )
(*pIdx)--;
pTNd = pIdx->GetNode().GetTxtNode();
}
-
- if( pTNd && NO_NUMBERING == pTNd->GetTxtColl()->GetOutlineLevel() )
+ //if( pTNd && NO_NUMBERING == pTNd->GetTxtColl()->GetOutlineLevel() )
+ if( pTNd && 0 == pTNd->GetAttrOutlineLevel() )//#outline level,zhaojianwei
pStr = &pTNd->GetTxt();
if( bUndoIdInitialized )
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index 1e4d20855c72..b25804eadfc4 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -392,6 +392,19 @@ BOOL SwEditShell::MoveParagraph( long nOffset )
return bRet;
}
+//#outline level add by zhaojianwei
+int SwEditShell::GetCurrentParaOutlineLevel( ) const
+{
+ int nLevel = 0;
+
+ SwPaM* pCrsr = GetCrsr();
+ const SwTxtNode* pTxtNd = pCrsr->GetNode()->GetTxtNode();
+ if( pTxtNd )
+ nLevel = pTxtNd->GetAttrOutlineLevel();
+ return nLevel;
+}
+//<-end,zhaojianwei
+
void SwEditShell::GetCurrentOutlineLevels( sal_uInt8& rUpper, sal_uInt8& rLower )
{
SwPaM* pCrsr = GetCrsr();
@@ -547,11 +560,14 @@ BOOL SwEditShell::IsProtectedOutlinePara() const
for( ; nPos < rOutlNd.Count(); ++nPos )
{
SwNodePtr pTmpNd = rOutlNd[ nPos ];
+
// --> OD 2008-04-02 #refactorlists#
// BYTE nTmpLvl = GetRealLevel( pTmpNd->GetTxtNode()->
// GetTxtColl()->GetOutlineLevel() );
- int nTmpLvl = pTmpNd->GetTxtNode()->GetOutlineLevel();
- ASSERT( nTmpLvl >= 0 && nTmpLvl < MAXLEVEL,
+ // int nTmpLvl = pTmpNd->GetTxtNode()->GetOutlineLevel();//#outline level,zhaojianwei
+ int nTmpLvl = pTmpNd->GetTxtNode()->GetAttrOutlineLevel();
+ // ASSERT( nTmpLvl >= 0 && nTmpLvl < MAXLEVEL,
+ ASSERT( nTmpLvl >= 0 && nTmpLvl <= MAXLEVEL, //<-end,zhaojianwei
"<SwEditShell::IsProtectedOutlinePara()>" );
// <--
if( bFirst )
@@ -644,7 +660,8 @@ BOOL SwEditShell::IsNoNum( BOOL bChkStart ) const
BYTE SwEditShell::GetNumLevel() const
{
// gebe die akt. Ebene zurueck, auf der sich der Point vom Cursor befindet
- BYTE nLevel = NO_NUMBERING;
+ //BYTE nLevel = NO_NUMBERING; //#outline level,zhaojianwei
+ BYTE nLevel = MAXLEVEL; //end,zhaojianwei
SwPaM* pCrsr = GetCrsr();
const SwTxtNode* pTxtNd = pCrsr->GetNode()->GetTxtNode();
diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx
index 58bfc8049b6f..ed5caed87bfb 100644
--- a/sw/source/core/fields/chpfld.cxx
+++ b/sw/source/core/fields/chpfld.cxx
@@ -156,13 +156,18 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, sal_Bool bSrchNum)
if( pONd && pONd->GetTxtColl() )
{
BYTE nPrevLvl = nLevel;
+
// --> OD 2008-04-02 #refactorlists#
// nLevel = GetRealLevel( pONd->GetTxtColl()->
// GetOutlineLevel() );
- ASSERT( pONd->GetOutlineLevel() >= 0 && pONd->GetOutlineLevel() < MAXLEVEL,
+ //ASSERT( pONd->GetOutlineLevel() >= 0 && pONd->GetOutlineLevel() < MAXLEVEL, //#outline level,zhaojianwei
+ // "<SwChapterField::ChangeExpansion(..)> - outline node with inconsistent outline level. Serious defect -> please inform OD." );
+ //nLevel = static_cast<BYTE>(pONd->GetOutlineLevel());
+ ASSERT( pONd->GetAttrOutlineLevel() >= 0 && pONd->GetAttrOutlineLevel() <= MAXLEVEL,
"<SwChapterField::ChangeExpansion(..)> - outline node with inconsistent outline level. Serious defect -> please inform OD." );
- nLevel = static_cast<BYTE>(pONd->GetOutlineLevel());
+ nLevel = static_cast<BYTE>(pONd->GetAttrOutlineLevel()); //<-end,zhaojianwei
// <--
+
if( nPrevLvl < nLevel )
nLevel = nPrevLvl;
else if( SVX_NUM_NUMBER_NONE != pDoc->GetOutlineNumRule()
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index d274dd2bcaf2..57d32e9e13e3 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -1161,8 +1161,9 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
//
if ( pTxtNd->IsOutline() )
{
- int nRealLevel = pTxtNd->GetOutlineLevel();
- nRealLevel = nRealLevel > 5 ? 5 : nRealLevel;
+ //int nRealLevel = pTxtNd->GetOutlineLevel(); //#outline level,zhaojianwei
+ int nRealLevel = pTxtNd->GetAttrOutlineLevel()-1; //<-end,zhaojianwei
+ nRealLevel = nRealLevel > 5 ? 5 : nRealLevel;
nPDFType = static_cast<USHORT>(vcl::PDFWriter::H1 + nRealLevel);
switch(nRealLevel)
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index afe9f1ef5041..555ff8e39171 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -696,9 +696,12 @@ USHORT SwTOXPara::GetLevel() const
if( nsSwTOXElement::TOX_OUTLINELEVEL == eType && pNd->GetTxtNode() )
{
- USHORT nTmp = ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel();
- if(nTmp < NO_NUMBERING)
- nRet = nTmp + 1;
+ //USHORT nTmp = ((SwTxtNode*)pNd)->GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
+ //if(nTmp < NO_NUMBERING)
+ // nRet = nTmp + 1;
+ const int nTmp = ((SwTxtNode*)pNd)->GetAttrOutlineLevel();//#outline level,zhaojianwei????
+ if(nTmp != 0 )
+ nRet = static_cast<USHORT>(nTmp);
}
return nRet;
}
@@ -715,7 +718,8 @@ String SwTOXPara::GetURL() const
{
const SwTxtNode * pTxtNd = static_cast<const SwTxtNode *>(pNd);
- if( MAXLEVEL >= pTxtNd->GetTxtColl()->GetOutlineLevel())
+ //if( MAXLEVEL >= pTxtNd->GetTxtColl()->GetOutlineLevel()) //#outline level,zhaojianwei
+ if ( pTxtNd->GetAttrOutlineLevel() > 0) //<-end,zhaojianwei
{
aTxt = '#';
const SwNumRule * pRule = pTxtNd->GetNumRule();
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index dd8af9d15a62..11e793e1b394 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -94,6 +94,11 @@
#include <SwStyleNameMapper.hxx>
#include <numrule.hxx>
+//--> #outlinelevel added by zhaojianwei
+#ifndef _SFXINTITEM_HXX
+#include <svtools/intitem.hxx>
+#endif
+//<--end
#include <swtable.hxx>
#include <docsh.hxx>
#include <SwNodeNum.hxx>
@@ -133,11 +138,15 @@ SwTxtNode *SwNodes::MakeTxtNode( const SwNodeIndex & rWhere,
// call method <UpdateOutlineNode(..)> only for the document nodes array
if ( IsDocNodes() )
{
- if ( pColl && NO_NUMBERING != pColl->GetOutlineLevel() )
- {
- UpdateOutlineNode( *pNode, NO_NUMBERING, pColl->GetOutlineLevel() );
- }
- else
+ //if ( pColl && NO_NUMBERING != pColl->GetOutlineLevel() ) //#outline level,removed by zhaojianwei
+ //{
+ // UpdateOutlineNode( *pNode, NO_NUMBERING, pColl->GetOutlineLevel() );
+ //}
+// if ( pColl && 0 != pColl->GetAttrOutlineLevel() )//#outline level,added by zhaojianwei
+// {
+// UpdateOutlineNode( *pNode, 0, pColl->GetAttrOutlineLevel() );
+// }//<--end
+// else
{
UpdateOutlineNode(*pNode);
}
@@ -230,7 +239,10 @@ SwTxtNode::SwTxtNode( const SwNodeIndex &rWhere,
mpNodeNum( 0 ),
bNotifiable( false ),
bLastOutlineState( FALSE ),
- nOutlineLevel( pTxtColl->GetOutlineLevel() ),
+ //nOutlineLevel( pTxtColl->GetOutlineLevel() )//#outline level, removed by zhaojianwei.
+ // --> OD 2008-11-19 #i70748#
+ mbEmptyListStyleSetDueToSetOutlineLevelAttr( false ),
+ // <--
// --> OD 2008-05-06 #refactorlists#
mbInSetOrResetAttr( false ),
mpList( 0 )
@@ -1050,10 +1062,15 @@ void SwTxtNode::_ChgTxtCollUpdateNum( const SwTxtFmtColl *pOldColl,
ASSERT( pDoc, "Kein Doc?" );
// erfrage die OutlineLevel und update gegebenenfalls das Nodes-Array,
// falls sich die Level geaendert haben !
- const BYTE nOldLevel = pOldColl ? pOldColl->GetOutlineLevel():NO_NUMBERING;
- const BYTE nNewLevel = pNewColl ? pNewColl->GetOutlineLevel():NO_NUMBERING;
-
- if ( NO_NUMBERING != nNewLevel )
+ //const BYTE nOldLevel = pOldColl ? pOldColl->GetOutlineLevel():NO_NUMBERING;//#outline level,removed by zhaojianwei
+ //const BYTE nNewLevel = pNewColl ? pNewColl->GetOutlineLevel():NO_NUMBERING;//<-end,zhaojianwei
+ const int nOldLevel = pOldColl && pOldColl->IsAssignedToListLevelOfOutlineStyle() ?
+ pOldColl->GetAssignedOutlineStyleLevel() : MAXLEVEL;
+ const int nNewLevel = pNewColl && pNewColl->IsAssignedToListLevelOfOutlineStyle() ?
+ pNewColl->GetAssignedOutlineStyleLevel() : MAXLEVEL;
+
+// if ( NO_NUMBERING != nNewLevel ) //#outline level,zhaojianwei
+ if ( MAXLEVEL != nNewLevel ) //<-end,zhaojianwei
{
SetAttrListLevel(nNewLevel);
}
@@ -1063,9 +1080,10 @@ void SwTxtNode::_ChgTxtCollUpdateNum( const SwTxtFmtColl *pOldColl,
pDoc->GetNodes().UpdateOutlineNode(*this);
}
+
SwNodes& rNds = GetNodes();
// Update beim Level 0 noch die Fussnoten !!
- if( (!nNewLevel || !nOldLevel) && pDoc->GetFtnIdxs().Count() &&
+ if( ( !nNewLevel || !nOldLevel) && pDoc->GetFtnIdxs().Count() &&
FTNNUM_CHAPTER == pDoc->GetFtnInfo().eNum &&
rNds.IsDocNodes() )
{
@@ -2750,7 +2768,7 @@ long SwTxtNode::GetLeftMarginForTabCalculation() const
long nLeftMarginForTabCalc = 0;
bool bLeftMarginForTabCalcSetToListLevelIndent( false );
- const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
+ const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0;
if( pRule )
{
const SwNumFmt& rFmt = pRule->Get(static_cast<USHORT>(GetActualListLevel()));
@@ -3245,46 +3263,114 @@ namespace {
bParagraphStyleChanged = true;
if( rTxtNode.GetNodes().IsDocNodes() )
{
+ // --> OD 2008-12-17 #i70748#
+ // The former list style set at the paragraph can not be
+ // retrieved from the change set.
+// sOldNumRule =
+// dynamic_cast<const SwFmtChg*>(pOldValue)->pChangedFmt->GetNumRule().GetValue();
+ const SwNumRule* pFormerNumRuleAtTxtNode =
+ rTxtNode.GetNum() ? rTxtNode.GetNum()->GetNumRule() : 0;
+ if ( pFormerNumRuleAtTxtNode )
+ {
+ sOldNumRule = pFormerNumRuleAtTxtNode->GetName();
+ }
+ // <--
+ // --> OD 2008-11-19 #i70748#
+ if ( rTxtNode.IsEmptyListStyleDueToSetOutlineLevelAttr() )
+ {
+ const SwNumRuleItem& rNumRuleItem = rTxtNode.GetTxtColl()->GetNumRule();
+ if ( rNumRuleItem.GetValue().Len() > 0 )
+ {
+ rTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
+ }
+ }
+ // <--
const SwNumRule* pNumRuleAtTxtNode = rTxtNode.GetNumRule();
if ( pNumRuleAtTxtNode )
{
bNumRuleSet = true;
sNumRule = pNumRuleAtTxtNode->GetName();
}
- sOldNumRule =
- dynamic_cast<const SwFmtChg*>(pOldValue)->pChangedFmt->GetNumRule().GetValue();
}
break;
}
case RES_ATTRSET_CHG:
{
const SfxPoolItem* pItem = 0;
+ // --> OD 2008-12-19 #i70748#
+ // The former list style set at the paragraph can not be
+ // retrieved from the change set.
+// if ( dynamic_cast<const SwAttrSetChg*>(pOldValue)->GetChgSet()->GetItemState( RES_PARATR_NUMRULE, FALSE, &pItem ) ==
+// SFX_ITEM_SET )
+// {
+// sOldNumRule = dynamic_cast<const SwNumRuleItem*>(pItem)->GetValue();
+// }
+ const SwNumRule* pFormerNumRuleAtTxtNode =
+ rTxtNode.GetNum() ? rTxtNode.GetNum()->GetNumRule() : 0;
+ if ( pFormerNumRuleAtTxtNode )
+ {
+ sOldNumRule = pFormerNumRuleAtTxtNode->GetName();
+ }
+ // <--
if ( dynamic_cast<const SwAttrSetChg*>(pNewValue)->GetChgSet()->GetItemState( RES_PARATR_NUMRULE, FALSE, &pItem ) ==
SFX_ITEM_SET )
{
+ // --> OD 2008-11-19 #i70748#
+ rTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
+ // <--
bNumRuleSet = true;
- sNumRule = dynamic_cast<const SwNumRuleItem*>(pItem)->GetValue();
+ // The new list style set at the paragraph can not be
+ // retrieved from the change set.
+// sNumRule = dynamic_cast<const SwNumRuleItem*>(pItem)->GetValue();
+ // <--
}
- if ( dynamic_cast<const SwAttrSetChg*>(pOldValue)->GetChgSet()->GetItemState( RES_PARATR_NUMRULE, FALSE, &pItem ) ==
- SFX_ITEM_SET )
+ // --> OD 2008-12-17 #i70748#
+ // The new list style set at the paragraph.
+ const SwNumRule* pNumRuleAtTxtNode = rTxtNode.GetNumRule();
+ if ( pNumRuleAtTxtNode )
{
- sOldNumRule = dynamic_cast<const SwNumRuleItem*>(pItem)->GetValue();
+ sNumRule = pNumRuleAtTxtNode->GetName();
}
+ // <--
break;
}
case RES_PARATR_NUMRULE:
{
if ( rTxtNode.GetNodes().IsDocNodes() )
{
+ // The former list style set at the paragraph can not be
+ // retrieved from the change set.
+// if ( pOldValue )
+// {
+// sOldNumRule = dynamic_cast<const SwNumRuleItem*>(pOldValue)->GetValue();
+// }
+ const SwNumRule* pFormerNumRuleAtTxtNode =
+ rTxtNode.GetNum() ? rTxtNode.GetNum()->GetNumRule() : 0;
+ if ( pFormerNumRuleAtTxtNode )
+ {
+ sOldNumRule = pFormerNumRuleAtTxtNode->GetName();
+ }
+ // <--
if ( pNewValue )
{
+ // --> OD 2008-11-19 #i70748#
+ rTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
+ // <--
bNumRuleSet = true;
- sNumRule = dynamic_cast<const SwNumRuleItem*>(pNewValue)->GetValue();
+ // --> OD 2008-12-17 #i70748#
+ // The new list style set at the paragraph can not be
+ // retrieved from the change set.
+// sNumRule = dynamic_cast<const SwNumRuleItem*>(pNewValue)->GetValue();
+ // <--
}
- if ( pOldValue )
+ // --> OD 2008-12-17 #i70748#
+ // The new list style set at the paragraph.
+ const SwNumRule* pNumRuleAtTxtNode = rTxtNode.GetNumRule();
+ if ( pNumRuleAtTxtNode )
{
- sOldNumRule = dynamic_cast<const SwNumRuleItem*>(pOldValue)->GetValue();
+ sNumRule = pNumRuleAtTxtNode->GetName();
}
+ // <--
}
break;
}
@@ -3321,8 +3407,12 @@ namespace {
if ( sNumRule ==
String::CreateFromAscii( SwNumRule::GetOutlineRuleName() ) )
{
+ // --> OD 2008-09-10 #i70748#
+ ASSERT( rTxtNode.GetTxtColl()->IsAssignedToListLevelOfOutlineStyle(),
+ "<HandleModifyAtTxtNode()> - text node with outline style, but its paragraph style is not assigned to outline style." );
int nNewListLevel =
- rTxtNode.GetTxtColl()->GetOutlineLevel();
+ rTxtNode.GetTxtColl()->GetAssignedOutlineStyleLevel();
+ // <--
if ( 0 <= nNewListLevel && nNewListLevel < MAXLEVEL )
{
rTxtNode.SetAttrListLevel( nNewListLevel );
@@ -3349,6 +3439,12 @@ namespace {
&aResetAttrsArray,
false );
// <--
+ // --> OD 2008-11-19 #i70748#
+ if ( dynamic_cast<const SfxUInt16Item &>(rTxtNode.GetAttr( RES_PARATR_OUTLINELEVEL, FALSE )).GetValue() > 0 )
+ {
+ rTxtNode.SetEmptyListStyleDueToSetOutlineLevelAttr();
+ }
+ // <--
}
}
}
@@ -3484,7 +3580,8 @@ BOOL SwTxtNode::IsOutline() const
{
BOOL bResult = FALSE;
- if ( GetOutlineLevel() != NO_NUMBERING )
+ //if ( GetOutlineLevel() != NO_NUMBERING )//#outline level,removed by zhaojianwei
+ if ( GetAttrOutlineLevel() > 0 ) //<-end,zhaojianwei
{
bResult = !IsInRedlines();
}
@@ -3510,21 +3607,47 @@ void SwTxtNode::UpdateOutlineState()
bLastOutlineState = IsOutline();
}
-int SwTxtNode::GetOutlineLevel() const
+//#outline level, zhaojianwei
+int SwTxtNode::GetAttrOutlineLevel() const
{
-#if 1
- int aResult = NO_NUMBERING;
+ return ((const SfxUInt16Item &)GetAttr(RES_PARATR_OUTLINELEVEL)).GetValue();
+}
+void SwTxtNode::SetAttrOutlineLevel(int nLevel)
+{
+ ASSERT( 0 <= nLevel && nLevel <= MAXLEVEL ,"SwTxtNode: Level Out Of Range" );//#outline level,zhaojianwei
+ if ( 0 <= nLevel && nLevel <= MAXLEVEL )
+ {
+ SetAttr( SfxUInt16Item( RES_PARATR_OUTLINELEVEL,
+ static_cast<UINT16>(nLevel) ) );
+ }
+}
+//<-end
- SwFmtColl * pFmtColl = GetFmtColl();
+// --> OD 2008-11-19 #i70748#
+bool SwTxtNode::IsEmptyListStyleDueToSetOutlineLevelAttr()
+{
+ return mbEmptyListStyleSetDueToSetOutlineLevelAttr;
+}
- if (pFmtColl)
- aResult = ((SwTxtFmtColl *) pFmtColl)->GetOutlineLevel();
+void SwTxtNode::SetEmptyListStyleDueToSetOutlineLevelAttr()
+{
+ if ( !mbEmptyListStyleSetDueToSetOutlineLevelAttr )
+ {
+ SetAttr( SwNumRuleItem() );
+ mbEmptyListStyleSetDueToSetOutlineLevelAttr = true;
+ }
+}
- return aResult;
-#else // for OOo3
- return nOutlineLevel
-#endif
+void SwTxtNode::ResetEmptyListStyleDueToResetOutlineLevelAttr()
+{
+ if ( mbEmptyListStyleSetDueToSetOutlineLevelAttr )
+ {
+ ResetAttr( RES_PARATR_NUMRULE );
+ mbEmptyListStyleSetDueToSetOutlineLevelAttr = false;
+ }
}
+// <--
+
// --> OD 2008-02-27 #refactorlists#
void SwTxtNode::SetAttrListLevel( int nLevel )
@@ -4061,6 +4184,7 @@ namespace {
// is set and changed after the attributes have been set
// (6) Notify list tree, if count in list - RES_PARATR_LIST_ISCOUNTED - is set
// and changed after the attributes have been set
+ // (7) Set or Reset emtpy list style due to changed outline level - RES_PARATR_OUTLINELEVEL.
class HandleSetAttrAtTxtNode
{
public:
@@ -4076,6 +4200,9 @@ namespace {
bool mbUpdateListLevel;
bool mbUpdateListRestart;
bool mbUpdateListCount;
+ // --> OD 2008-11-19 #i70748#
+ bool mbOutlineLevelSet;
+ // <--
};
HandleSetAttrAtTxtNode::HandleSetAttrAtTxtNode( SwTxtNode& rTxtNode,
@@ -4084,7 +4211,10 @@ namespace {
mbAddTxtNodeToList( false ),
mbUpdateListLevel( false ),
mbUpdateListRestart( false ),
- mbUpdateListCount( false )
+ mbUpdateListCount( false ),
+ // --> OD 2008-11-19 #i70748#
+ mbOutlineLevelSet( false )
+ // <--
{
switch ( pItem.Which() )
{
@@ -4175,6 +4305,20 @@ namespace {
}
}
break;
+
+ // --> OD 2008-11-19 #i70748#
+ // handle RES_PARATR_OUTLINELEVEL
+ case RES_PARATR_OUTLINELEVEL:
+ {
+ const SfxUInt16Item& aOutlineLevelItem =
+ dynamic_cast<const SfxUInt16Item&>(pItem);
+ if ( aOutlineLevelItem.GetValue() != mrTxtNode.GetAttrOutlineLevel() )
+ {
+ mbOutlineLevelSet = true;
+ }
+ }
+ break;
+ // <--
}
}
@@ -4185,7 +4329,10 @@ namespace {
mbAddTxtNodeToList( false ),
mbUpdateListLevel( false ),
mbUpdateListRestart( false ),
- mbUpdateListCount( false )
+ mbUpdateListCount( false ),
+ // --> OD 2008-11-19 #i70748#
+ mbOutlineLevelSet( false )
+ // <--
{
const SfxPoolItem* pItem = 0;
// handle RES_PARATR_NUMRULE
@@ -4198,6 +4345,9 @@ namespace {
if ( pNumRuleItem->GetValue().Len() > 0 )
{
mbAddTxtNodeToList = true;
+ // --> OD 2008-11-19 #i70748#
+ mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
+ // <--
}
}
@@ -4269,6 +4419,19 @@ namespace {
mbUpdateListCount = true;
}
}
+
+ // --> OD 2008-11-19 #i70748#
+ // handle RES_PARATR_OUTLINELEVEL
+ if ( rItemSet.GetItemState( RES_PARATR_OUTLINELEVEL, FALSE, &pItem ) == SFX_ITEM_SET )
+ {
+ const SfxUInt16Item* pOutlineLevelItem =
+ dynamic_cast<const SfxUInt16Item*>(pItem);
+ if ( pOutlineLevelItem->GetValue() != mrTxtNode.GetAttrOutlineLevel() )
+ {
+ mbOutlineLevelSet = true;
+ }
+ }
+ // <--
}
HandleSetAttrAtTxtNode::~HandleSetAttrAtTxtNode()
@@ -4301,6 +4464,26 @@ namespace {
const_cast<SwNodeNum*>(mrTxtNode.GetNum())->InvalidateAndNotifyTree();
}
}
+
+ // --> OD 2008-11-19 #i70748#
+ if ( mbOutlineLevelSet )
+ {
+ if ( mrTxtNode.GetAttrOutlineLevel() == 0 )
+ {
+ mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
+ }
+ else
+ {
+ const SfxPoolItem* pItem = 0;
+ if ( mrTxtNode.GetSwAttrSet().GetItemState( RES_PARATR_NUMRULE,
+ TRUE, &pItem )
+ != SFX_ITEM_SET )
+ {
+ mrTxtNode.SetEmptyListStyleDueToSetOutlineLevelAttr();
+ }
+ }
+ }
+ // <--
}
// End of class <HandleSetAttrAtTxtNode>
}
@@ -4349,6 +4532,7 @@ namespace {
// (4) Notify list tree, if list restart - RES_PARATR_LIST_ISRESTART - is reset.
// (5) Notify list tree, if list restart value - RES_PARATR_LIST_RESTARTVALUE - is reset.
// (6) Notify list tree, if count in list - RES_PARATR_LIST_ISCOUNTED - is reset.
+ // (7) Reset empty list style, if outline level attribute - RES_PARATR_OUTLINELEVEL - is reset.
class HandleResetAttrAtTxtNode
{
public:
@@ -4415,6 +4599,14 @@ namespace {
( nWhich1 <= RES_PARATR_LIST_ISCOUNTED && RES_PARATR_LIST_ISCOUNTED <= nWhich2 &&
!mrTxtNode.IsCountedInList() );
}
+
+ // --> OD 2008-11-19 #i70748#
+ // RES_PARATR_OUTLINELEVEL
+ if ( nWhich1 <= RES_PARATR_OUTLINELEVEL && RES_PARATR_OUTLINELEVEL <= nWhich2 )
+ {
+ mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
+ }
+ // <--
}
else
{
@@ -4432,6 +4624,13 @@ namespace {
mbListStyleOrIdReset = true;
// <--
}
+ // --> OD 2008-11-19 #i70748#
+ // RES_PARATR_OUTLINELEVEL
+ else if ( nWhich1 == RES_PARATR_OUTLINELEVEL )
+ {
+ mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
+ }
+ // <--
if ( !bRemoveFromList )
{
@@ -4486,6 +4685,13 @@ namespace {
mbListStyleOrIdReset = true;
// <--
}
+ // --> OD 2008-11-19 #i70748#
+ // RES_PARATR_OUTLINELEVEL
+ else if ( rWhichArr[ n ] == RES_PARATR_OUTLINELEVEL )
+ {
+ mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
+ }
+ // <--
if ( !bRemoveFromList )
{
@@ -4527,6 +4733,9 @@ namespace {
{
rTxtNode.RemoveFromList();
}
+ // --> OD 2008-11-19 #i70748#
+ mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
+ // <--
}
HandleResetAttrAtTxtNode::~HandleResetAttrAtTxtNode()
@@ -4540,6 +4749,12 @@ namespace {
{
mrTxtNode.AddToList();
}
+ // --> OD 2008-11-19 #i70748#
+ else if ( dynamic_cast<const SfxUInt16Item &>(mrTxtNode.GetAttr( RES_PARATR_OUTLINELEVEL, FALSE )).GetValue() > 0 )
+ {
+ mrTxtNode.SetEmptyListStyleDueToSetOutlineLevelAttr();
+ }
+ // <--
}
if ( mrTxtNode.IsInList() )
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 0809ff64ab70..fcf13e06eedf 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -722,7 +722,8 @@ SwHstrySetAttrSet::SwHstrySetAttrSet( const SfxItemSet& rSet, ULONG nNodePos,
aResetArr( 0, 4 ),
nNode( nNodePos ),
// --> OD 2007-07-09 #i77372#
- mnNumLvl( NO_NUMBERING ),
+ //mnNumLvl( MAXLEVEL),//NO_NUMBERING ),
+ mnNumLvl( MAXLEVEL), //#outline level,zhaojianwei
mbIsRestart( false ),
mnRestartVal( USHRT_MAX ),
mbIsCounted( false )
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 5d5fc68e1622..d2485a585605 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -154,7 +154,23 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertyMap* pMap
}
break;
// <--
- case FN_UNO_PARA_CHAPTER_NUMBERING_LEVEL:
+ // --> OD 2008-05-20 #outlinelevel# - no longer needed
+// case FN_UNO_PARA_CHAPTER_NUMBERING_LEVEL:
+// if (pAny)
+// {
+// const SwTxtNode * pTmpNode = pNode;
+
+// if (!pTmpNode)
+// pTmpNode = rPam.GetNode()->GetTxtNode();
+
+// sal_Int8 nRet = -1;
+// if (pTmpNode && pTmpNode->GetOutlineLevel() != NO_NUMBERING)
+// nRet = sal::static_int_cast< sal_Int8 >(pTmpNode->GetOutlineLevel());
+// *pAny <<= nRet;
+// }
+// break;
+ // <--
+ case RES_PARATR_OUTLINELEVEL: //#outlinelevel added by zhaojianwei
if (pAny)
{
const SwTxtNode * pTmpNode = pNode;
@@ -162,13 +178,13 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertyMap* pMap
if (!pTmpNode)
pTmpNode = rPam.GetNode()->GetTxtNode();
- sal_Int8 nRet = -1;
- if (pTmpNode && pTmpNode->GetOutlineLevel() != NO_NUMBERING)
- nRet = sal::static_int_cast< sal_Int8 >(pTmpNode->GetOutlineLevel());
+ sal_Int16 nRet = -1;
+ if ( pTmpNode )
+ nRet = sal::static_int_cast< sal_Int16 >( pTmpNode->GetAttrOutlineLevel() );
*pAny <<= nRet;
}
- break;
+ break; //<-end,zhaojianwei
case FN_UNO_PARA_CONDITIONAL_STYLE_NAME:
case FN_UNO_PARA_STYLE :
{
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 26a0392130b7..8b22521276d5 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -275,7 +275,8 @@ void SwUnoPropertyMapProvider::Sort( sal_uInt16 nId )
{ SW_PROP_NMID(UNO_NAME_LIST_ID), FN_UNO_LIST_ID, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, 0}, \
{ SW_PROP_NMID(UNO_NAME_PARA_IS_NUMBERING_RESTART), FN_NUMBER_NEWSTART, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID, 0 }, \
{ SW_PROP_NMID(UNO_NAME_PARA_CONTINUEING_PREVIOUS_SUB_TREE), FN_UNO_PARA_CONT_PREV_SUBTREE, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::READONLY, 0 }, \
- { SW_PROP_NMID(UNO_NAME_PARA_LIST_LABEL_STRING), FN_UNO_PARA_NUM_STRING, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0 },
+ { SW_PROP_NMID(UNO_NAME_PARA_LIST_LABEL_STRING), FN_UNO_PARA_NUM_STRING, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0 }, \
+ { SW_PROP_NMID(UNO_NAME_OUTLINE_LEVEL), RES_PARATR_OUTLINELEVEL, CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, 0}, //#outline level, zhaojianwei
#define COMMON_HYPERLINK_PROPERTIES \
{ SW_PROP_NMID(UNO_NAME_HYPER_LINK_U_R_L), RES_TXTATR_INETFMT, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID ,MID_URL_URL}, \
@@ -499,6 +500,8 @@ void SwUnoPropertyMapProvider::Sort( sal_uInt16 nId )
{ SW_PROP_NMID(UNO_NAME_CHAR_DIFF_HEIGHT_COMPLEX), RES_CHRATR_CTL_FONTSIZE , CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE , MID_FONTHEIGHT_DIFF|CONVERT_TWIPS},
+//#outline level, zhaojianwei delete { SW_PROP_NMID(UNO_NAME_DEFAULT_OUTLINE_LEVEL), FN_UNO_DEFAULT_OUTLINE_LEVEL, CPPU_E2T(CPPUTYPE_INT8), PropertyAttribute::MAYBEVOID, 0},
+//add { SW_PROP_NMID(UNO_NAME_OUTLINE_LEVEL), RES_PARATR_OUTLINELEVEL,CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, 0},
#define COMMON_PARA_STYLE_PROPERTIES \
{ SW_PROP_NMID(UNO_NAME_BREAK_TYPE), RES_BREAK, CPPU_E2T(CPPUTYPE_BREAK), PROPERTY_NONE, 0},\
{ SW_PROP_NMID(UNO_NAME_PAGE_DESC_NAME), RES_PAGEDESC, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, MID_PAGEDESC_PAGEDESCNAME },\
@@ -595,8 +598,9 @@ void SwUnoPropertyMapProvider::Sort( sal_uInt16 nId )
{ SW_PROP_NMID(UNO_NAME_CATEGORY), FN_UNO_CATEGORY, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE , 0 },\
{ SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 },\
{ SW_PROP_NMID(UNO_NAME_PARA_IS_CONNECT_BORDER), RES_PARATR_CONNECT_BORDER, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID, 0},\
- { SW_PROP_NMID(UNO_NAME_DEFAULT_OUTLINE_LEVEL), FN_UNO_DEFAULT_OUTLINE_LEVEL, CPPU_E2T(CPPUTYPE_INT8), PropertyAttribute::MAYBEVOID, 0},\
{ SW_PROP_NMID(UNO_NAME_SNAP_TO_GRID), RES_PARATR_SNAPTOGRID, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID, 0 }, \
+ { SW_PROP_NMID(UNO_NAME_OUTLINE_LEVEL), RES_PARATR_OUTLINELEVEL,CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, 0},
+
#define COMMON_FLDTYP_PROPERTIES \
{ SW_PROP_NMID(UNO_NAME_IS_FIELD_USED), FIELD_PROP_IS_FIELD_USED, CPPU_E2T(CPPUTYPE_FLOAT), PropertyAttribute::READONLY, 0},\
@@ -650,7 +654,8 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP
{ SW_PROP_NMID(UNO_NAME_TEXT_SECTION), FN_UNO_TEXT_SECTION, CPPU_E2T(CPPUTYPE_REFTEXTSECTION), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY ,0 }, \
{ SW_PROP_NMID(UNO_NAME_PARA_CHAPTER_NUMBERING_LEVEL), FN_UNO_PARA_CHAPTER_NUMBERING_LEVEL,CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE, 0}, \
{ SW_PROP_NMID(UNO_NAME_PARA_CONDITIONAL_STYLE_NAME), RES_FRMATR_CONDITIONAL_STYLE_NAME, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0}, \
- { SW_PROP_NMID(UNO_NAME_PARA_IS_NUMBERING_RESTART), FN_NUMBER_NEWSTART, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID, 0 },
+ { SW_PROP_NMID(UNO_NAME_PARA_IS_NUMBERING_RESTART), FN_NUMBER_NEWSTART, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID, 0 }, \
+ { SW_PROP_NMID(UNO_NAME_OUTLINE_LEVEL), RES_PARATR_OUTLINELEVEL, CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, 0}, //#outline level,zhaojianwei
COMMON_CRSR_PARA_PROPERTIES_WITHOUT_FN
TABSTOPS_MAP_ENTRY
COMMON_TEXT_CONTENT_PROPERTIES
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index e798d6851ee6..7a8a5ace32b1 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -544,24 +544,6 @@ sal_Bool lcl_setCrsrPropertyValue(const SfxItemPropertyMap* pMap,
case FN_UNO_NUM_START_VALUE :
lcl_SetNodeNumStart( rPam, aValue );
break;
- case FN_UNO_PARA_CHAPTER_NUMBERING_LEVEL:
- {
-/* Will be used in OOo 3.0
- SwTxtNode * pTmpNode = rPam.GetNode()->GetTxtNode();
-
- BYTE nLevel;
- aValue >>= nLevel;
-
- if ( pTmpNode )
- {
- pTmpNode->SetOutlineLevel(nLevel);
-
- // --> OD 2005-09-01 #i53198# - update outline nodes array
- rPam.GetDoc()->GetNodes().UpdateOutlineNode( *pTmpNode );
- // <--
- }*/
- }
- break;
case FN_UNO_NUM_LEVEL :
// --> OD 2008-07-14 #i91601#
case FN_UNO_LIST_ID:
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 216cee867e1f..9b536dae7bc8 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -780,6 +780,17 @@ void SwXTextCursor::SetCrsrAttr(SwPaM& rPam, const SfxItemSet& rSet, USHORT nAtt
// UpdateAttr();
pDoc->Insert( *pCrsr, rSet, nFlags );
}
+ //#outline level,add by zhaojianwei
+ if( rSet.GetItemState( RES_PARATR_OUTLINELEVEL, false ) >= SFX_ITEM_AVAILABLE )
+ {
+ SwTxtNode * pTmpNode = rPam.GetNode()->GetTxtNode();
+ if ( pTmpNode )
+ {
+ rPam.GetDoc()->GetNodes().UpdateOutlineNode( *pTmpNode );
+ }
+
+ }
+ //<-end,zhaojianwei
}
/*-- 09.12.98 14:19:04---------------------------------------------------
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index 2f4d5ebb05c6..262adba59ddf 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -718,7 +718,7 @@ const SwPropNameTab aPropNameTab = {
/* 0673 UNO_NAME_TRANSFORMATION_IN_HORI_L2R*/ {MAP_CHAR_LEN("TransformationInHoriL2R")},
/* 0674 UNO_NAME_POSITION_LAYOUT_DIR*/ {MAP_CHAR_LEN("PositionLayoutDir")},
/* 0675 UNO_NAME_NUMBERING_IS_OUTLINE*/ {MAP_CHAR_LEN("NumberingIsOutline")},
-/* 0676 UNO_NAME_DEFAULT_OUTLINE_LEVEL*/ {MAP_CHAR_LEN("DefaultOutlineLevel")},
+///* 0676 UNO_NAME_DEFAULT_OUTLINE_LEVEL*/ {MAP_CHAR_LEN("DefaultOutlineLevel")}, //#outline level,removed by zhaojianwei
/* 0677 UNO_NAME_STARTPOSITION_IN_HORI_L2R*/ {MAP_CHAR_LEN("StartPositionInHoriL2R")},
/* 0678 UNO_NAME_ENDPOSITION_IN_HORI_L2R*/ {MAP_CHAR_LEN("EndPositionInHoriL2R")},
/* 0679 UNO_NAME_SUBJECT */ {MAP_CHAR_LEN("Subject")},
@@ -777,7 +777,8 @@ const SwPropNameTab aPropNameTab = {
/* 0732 UNO_NAME_PARA_LIST_LABEL_STRING */ {MAP_CHAR_LEN("ListLabelString")},
/* 0733 CHAR_OVERLINE */ {MAP_CHAR_LEN("CharOverline")},
/* 0734 CHAR_OVERLINE_COLOR */ {MAP_CHAR_LEN("CharOverlineColor")},
-/* 0735 CHAR_OVERLINE_HAS_COLOR */ {MAP_CHAR_LEN("CharOverlineHasColor")}
+/* 0735 CHAR_OVERLINE_HAS_COLOR */ {MAP_CHAR_LEN("CharOverlineHasColor")},
+/* 0736 UNO_NAME_OUTLINE_LEVEL */ {MAP_CHAR_LEN("OutlineLevel")}//#outline level,add<-zhaojianwei Outlinelevel
};
const SwPropNameLen& SwGetPropName( USHORT nId )
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index ad22fc3991dd..b75cfebd4d27 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1695,8 +1695,11 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
if(rTxtColl.IsDefault())
continue;
- sal_Int8 nOutLevel = rTxtColl.GetOutlineLevel();
- if(nOutLevel == nIndex)
+ //sal_Int8 nOutLevel = rTxtColl.GetOutlineLevel(); //#outline level,zhaojianwei
+ const sal_Int16 nOutLevel = rTxtColl.IsAssignedToListLevelOfOutlineStyle()
+ ? static_cast<sal_Int16>(rTxtColl.GetAssignedOutlineStyleLevel())
+ : MAXLEVEL; //<-end,zhaojianwei
+ if ( nOutLevel == nIndex )
{
sValue = rTxtColl.GetName();
break; // the style for the level in question has been found
@@ -2181,11 +2184,21 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
SwTxtFmtColl &rTxtColl = *((*pColls)[k]);
if(rTxtColl.IsDefault())
continue;
- if(rTxtColl.GetOutlineLevel() == nIndex &&
- rTxtColl.GetName() != sStyleName)
- rTxtColl.SetOutlineLevel(NO_NUMBERING);
- else if(rTxtColl.GetName() == sStyleName)
- rTxtColl.SetOutlineLevel(sal_Int8(nIndex));
+ //if(rTxtColl.GetOutlineLevel() == nIndex && //#outline level,removed by zhaojianwei
+ // rTxtColl.GetName() != sStyleName)
+ // rTxtColl..SetOutlineLevel(NO_NUMBERING);
+ //else if(rTxtColl.GetName() == sStyleName)
+ // rTxtColl.SetOutlineLevel(sal_Int8(nIndex));
+ if ( rTxtColl.IsAssignedToListLevelOfOutlineStyle() && //add by zhaojianwei
+ rTxtColl.GetAssignedOutlineStyleLevel() == nIndex &&
+ rTxtColl.GetName() != sStyleName )
+ {
+ rTxtColl.DeleteAssignmentToListLevelOfOutlineStyle();
+ }
+ else if ( rTxtColl.GetName() == sStyleName )
+ {
+ rTxtColl.AssignToListLevelOfOutlineStyle( nIndex );
+ } //<-end,,zhaojianwei,
}
}
break;
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 0115a0985064..baba996cbad5 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1964,15 +1964,23 @@ void lcl_SetStyleProperty(const SfxItemPropertyMap* pMap,
throw lang::IllegalArgumentException();
}
break;
- case FN_UNO_DEFAULT_OUTLINE_LEVEL:
+ // case FN_UNO_DEFAULT_OUTLINE_LEVEL: //#outline level,removed by zahojianwei
+ //{
+ // sal_Int8 nLevel = 0;
+ // if( rValue >>= nLevel )
+ // rBase.mxNewBase->GetCollection()->SetOutlineLevel( nLevel );
+ // else
+ // rBase.mxNewBase->GetCollection()->SetOutlineLevel( NO_NUMBERING );
+ //}
+ //break;
+ case RES_PARATR_OUTLINELEVEL: //add by zahojianwei
{
- sal_Int8 nLevel = 0;
- if( rValue >>= nLevel )
- rBase.mxNewBase->GetCollection()->SetOutlineLevel( nLevel );
- else
- rBase.mxNewBase->GetCollection()->SetOutlineLevel( NO_NUMBERING );
+ sal_Int16 nLevel = 0;
+ rValue >>= nLevel;
+ if( 0 <= nLevel && nLevel <= MAXLEVEL)
+ rBase.mxNewBase->GetCollection()->SetAttrOutlineLevel( nLevel );
}
- break;
+ break; //<-end,zhaojianwei
case FN_UNO_FOLLOW_STYLE:
{
OUString sTmp;
@@ -2214,7 +2222,9 @@ put_itemset:
if ( SFX_STYLE_FAMILY_PARA == eFamily &&
pMap->nWID == RES_PARATR_NUMRULE &&
rBase.mxNewBase.is() && rBase.mxNewBase->GetCollection() &&
- rBase.mxNewBase->GetCollection()->GetOutlineLevel() < MAXLEVEL /* assigned to list level of outline style */)
+ //rBase.mxNewBase->GetCollection()->GetOutlineLevel() < MAXLEVEL /* assigned to list level of outline style */) //#outline level,removed by zhaojianwei
+ rBase.mxNewBase->GetCollection()->IsAssignedToListLevelOfOutlineStyle() ) ////<-end,add by zhaojianwei
+
{
OUString sNewNumberingRuleName;
rValue >>= sNewNumberingRuleName;
@@ -2223,7 +2233,8 @@ put_itemset:
sTmp != pDoc->GetOutlineNumRule()->GetName() )
{
// delete assignment to list level of outline style.
- rBase.mxNewBase->GetCollection()->SetOutlineLevel( NO_NUMBERING );
+ //rBase.mxNewBase->GetCollection()->SetOutlineLevel( NO_NUMBERING ); //#outline level,removed by zhaojianwei
+ rBase.mxNewBase->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle(); //<-end,adde by zhaojianwei
}
}
}
@@ -2377,14 +2388,21 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertyMap* pMap,
aRet.setValue(&xRules, ::getCppuType((uno::Reference<container::XIndexReplace>*)0));
}
break;
- case FN_UNO_DEFAULT_OUTLINE_LEVEL:
+ //case FN_UNO_DEFAULT_OUTLINE_LEVEL: //#outline level,removed by zahojianwei
+ //{
+ // DBG_ASSERT( SFX_STYLE_FAMILY_PARA == eFamily, "only paras" );
+ // BYTE nLevel = rBase.mxNewBase->GetCollection()->GetOutlineLevel();
+ // if( nLevel != NO_NUMBERING )
+ // aRet <<= static_cast<sal_Int8>( nLevel );
+ //}
+ //break;
+ case RES_PARATR_OUTLINELEVEL: //add by zahojianwei
{
DBG_ASSERT( SFX_STYLE_FAMILY_PARA == eFamily, "only paras" );
- BYTE nLevel = rBase.mxNewBase->GetCollection()->GetOutlineLevel();
- if( nLevel != NO_NUMBERING )
- aRet <<= static_cast<sal_Int8>( nLevel );
+ int nLevel = rBase.mxNewBase->GetCollection()->GetAttrOutlineLevel();
+ aRet <<= static_cast<sal_Int16>( nLevel );
}
- break;
+ break; //<-end,zhaojianwei
case FN_UNO_FOLLOW_STYLE:
{
String aString;
@@ -2779,14 +2797,14 @@ uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates(
{
pStates[i] = beans::PropertyState_DIRECT_VALUE;
}
- else if( FN_UNO_DEFAULT_OUTLINE_LEVEL == pMap->nWID )
- {
- pStates[i] =
- ( xStyle->GetCollection()->GetOutlineLevel()
- == NO_NUMBERING )
- ? beans::PropertyState_DEFAULT_VALUE
- : beans::PropertyState_DIRECT_VALUE;
- }
+ // else if( FN_UNO_DEFAULT_OUTLINE_LEVEL == pMap->nWID ) //#outline level,removed by zahojianwei
+ // {
+ // pStates[i] =
+ // ( xStyle->GetCollection()->GetOutlineLevel()
+ // == NO_NUMBERING )
+ // ? beans::PropertyState_DEFAULT_VALUE
+ // : beans::PropertyState_DIRECT_VALUE;
+ // } //<-end,zhaojianwei
else if(SFX_STYLE_FAMILY_PAGE == eFamily &&
(rPropName.EqualsAscii("Header", 0, 6)
|| rPropName.EqualsAscii("Footer", 0, 6)))
@@ -2910,10 +2928,14 @@ void SAL_CALL SwXStyle::setPropertiesToDefault( const uno::Sequence< OUString >&
if ( pMap->nFlags & beans::PropertyAttribute::READONLY )
throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "setPropertiesToDefault: property is read-only: " ) ) + pNames[nProp], static_cast < cppu::OWeakObject * > ( this ) );
- if( pMap->nWID == FN_UNO_DEFAULT_OUTLINE_LEVEL )
- static_cast<SwTxtFmtColl*>(pTargetFmt)->SetOutlineLevel( NO_NUMBERING );
+ //if( pMap->nWID == FN_UNO_DEFAULT_OUTLINE_LEVEL ) //#outline level, removed by zhaojianwei
+ // static_cast<SwTxtFmtColl*>(pTargetFmt)->SetOutlineLevel( NO_NUMBERING );
+ //else
+ // pTargetFmt->ResetFmtAttr( pMap->nWID );
+ if( pMap->nWID == RES_PARATR_OUTLINELEVEL ) //add by zhaojianwei
+ static_cast<SwTxtFmtColl*>(pTargetFmt)->DeleteAssignmentToListLevelOfOutlineStyle();
else
- pTargetFmt->ResetFmtAttr( pMap->nWID );
+ pTargetFmt->ResetFmtAttr( pMap->nWID ); //<-end,zhaojianwei
}
}
else if ( bIsDescriptor )
@@ -2950,7 +2972,8 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault( )
// --> OD 2007-07-25 #132402# - make code robust
if ( xStyle->GetCollection() )
{
- xStyle->GetCollection()->SetOutlineLevel( NO_NUMBERING );
+ // xStyle->GetCollection()->SetOutlineLevel( NO_NUMBERING ); //#outline level,removed by zhaojianwei
+ xStyle->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle(); //<-end,add by zhaojianwei
}
// <--
}
diff --git a/sw/source/filter/rtf/rtfatr.cxx b/sw/source/filter/rtf/rtfatr.cxx
index 28a410e152d9..3c099fcd62a5 100644
--- a/sw/source/filter/rtf/rtfatr.cxx
+++ b/sw/source/filter/rtf/rtfatr.cxx
@@ -427,14 +427,17 @@ bool SwFmtToSet(SwRTFWriter& rWrt, const SwFmt& rFmt, SfxItemSet &rSet)
rWrt.Strm() << sRTF_S;
rWrt.OutULong( nId );
rWrt.bOutFmtAttr = TRUE;
- BYTE nLvl = ((const SwTxtFmtColl&)rFmt).GetOutlineLevel();
- if( MAXLEVEL > nLvl )
+// BYTE nLvl = ((const SwTxtFmtColl&)rFmt).GetOutlineLevel(); //#outline level,zhaojianwei
+// if( MAXLEVEL > nLvl )
+// {
+ if(((const SwTxtFmtColl&)rFmt).IsAssignedToListLevelOfOutlineStyle())
{
+ int nLvl = ((const SwTxtFmtColl&)rFmt).GetAssignedOutlineStyleLevel(); //<-end,zhaojianwei
USHORT nNumId = rWrt.GetNumRuleId(
*rWrt.pDoc->GetOutlineNumRule() );
if( USHRT_MAX != nNumId )
{
- BYTE nWWLvl = 8 >= nLvl ? nLvl : 8;
+ BYTE nWWLvl = 8 >= nLvl ? static_cast<BYTE>(nLvl) : 8;
rWrt.Strm() << sRTF_LS;
rWrt.OutULong( nNumId );
rWrt.Strm() << sRTF_ILVL; rWrt.OutULong( nWWLvl );
@@ -446,7 +449,7 @@ bool SwFmtToSet(SwRTFWriter& rWrt, const SwFmt& rFmt, SfxItemSet &rSet)
}
}
- const SwNumFmt* pNFmt = &rWrt.pDoc->GetOutlineNumRule()->Get( nLvl );
+ const SwNumFmt* pNFmt = &rWrt.pDoc->GetOutlineNumRule()->Get( static_cast<USHORT>(nLvl) );
if( pNFmt->GetAbsLSpace() )
{
SfxItemSet aSet( *rFmt.GetAttrSet().GetPool(),
@@ -4267,6 +4270,7 @@ SwAttrFnTab aRTFAttrFnTab = {
/* RES_PARATR_VERTALIGN */ OutRTF_SwFontAlign,
/* RES_PARATR_SNAPTOGRID*/ 0, // new
/* RES_PARATR_CONNECT_TO_BORDER */ 0, // new
+/* RES_PARATR_OUTLINELEVEL */ 0, // new - outlinelevel
/* RES_PARATR_LIST_ID */ 0, // new
/* RES_PARATR_LIST_LEVEL */ 0, // new
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index 8d2b6853c85a..2ecfebb09090 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -2761,11 +2761,13 @@ void SwRTFParser::MakeStyleTab()
if( !IsNewDoc() )
{
// search all outlined collections
- BYTE nLvl;
+ //BYTE nLvl;
const SwTxtFmtColls& rColls = *pDoc->GetTxtFmtColls();
for( USHORT n = rColls.Count(); n; )
- if( MAXLEVEL > (nLvl = rColls[ --n ]->GetOutlineLevel() ))
- nValidOutlineLevels |= 1 << nLvl;
+ //if( MAXLEVEL > (nLvl = rColls[ --n ]->GetOutlineLevel() ))//#outline level,zhaojianwei
+ // nValidOutlineLevels |= 1 << nLvl;
+ if( rColls[ --n ]->IsAssignedToListLevelOfOutlineStyle())
+ nValidOutlineLevels |= 1 << rColls[ n ]->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei
}
SvxRTFStyleType* pStyle = GetStyleTbl().First();
@@ -3932,7 +3934,8 @@ SwTxtFmtColl* SwRTFParser::MakeColl(const String& rName, USHORT nPos,
BYTE nOutlineLevel, bool& rbCollExist)
{
if( BYTE(-1) == nOutlineLevel )
- nOutlineLevel = NO_NUMBERING;
+ //nOutlineLevel = NO_NUMBERING;
+ nOutlineLevel = MAXLEVEL;//#outline level,zhaojianwei
rbCollExist = false;
SwTxtFmtColl* pColl;
@@ -3943,7 +3946,11 @@ SwTxtFmtColl* SwRTFParser::MakeColl(const String& rName, USHORT nPos,
if( !nPos )
{
pColl = pDoc->GetTxtCollFromPool( RES_POOLCOLL_STANDARD, false );
- pColl->SetOutlineLevel( nOutlineLevel );
+ //pColl->SetOutlineLevel( nOutlineLevel ); //#outline level,removed by zhaojianwei
+ if(nOutlineLevel < MAXLEVEL ) //->add by zhaojianwei
+ pColl->AssignToListLevelOfOutlineStyle( nOutlineLevel );
+ else
+ pColl->DeleteAssignmentToListLevelOfOutlineStyle(); //<-end,zhaojianwei
return pColl;
}
@@ -3952,7 +3959,6 @@ SwTxtFmtColl* SwRTFParser::MakeColl(const String& rName, USHORT nPos,
aNm += String::CreateFromInt32( nPos );
aNm += ')';
}
-
ww::sti eSti = ww::GetCanonicalStiFromEnglishName(rName);
sw::util::ParaStyleMapper::StyleResult aResult =
maParaStyleMapper.GetStyle(rName, eSti);
@@ -3967,7 +3973,12 @@ SwTxtFmtColl* SwRTFParser::MakeColl(const String& rName, USHORT nPos,
}
if (!rbCollExist)
- pColl->SetOutlineLevel(nOutlineLevel);
+ //pColl->SetOutlineLevel( nOutlineLevel ); //#outline level,removed by zhaojianwei
+ if(nOutlineLevel < MAXLEVEL) //->add by zhaojianwei
+ pColl->AssignToListLevelOfOutlineStyle( nOutlineLevel );
+ else
+ pColl->DeleteAssignmentToListLevelOfOutlineStyle(); //<-end,zhaojianwei
+
return pColl;
}
diff --git a/sw/source/filter/rtf/wrtrtf.cxx b/sw/source/filter/rtf/wrtrtf.cxx
index 1f7a5b94d87d..6a6e13096c6b 100644
--- a/sw/source/filter/rtf/wrtrtf.cxx
+++ b/sw/source/filter/rtf/wrtrtf.cxx
@@ -292,8 +292,10 @@ void SwRTFWriter::Out_SwDoc( SwPaM* pPam )
pCurPam->GetPoint()->nContent.Assign( &rCNd, 0 );
if( !bOutOutlineOnly ||
- ( rCNd.IsTxtNode() && NO_NUMBERING !=
- ((SwTxtNode&)rCNd).GetTxtColl()->GetOutlineLevel() ))
+ //( rCNd.IsTxtNode() && NO_NUMBERING != //#outline level,removed by zhaojianwei
+ //((SwTxtNode&)rCNd).GetTxtColl()->GetOutlineLevel() ))
+ ( rCNd.IsTxtNode() && //->add by zhaojianwei
+ ((SwTxtNode&)rCNd).GetTxtColl()->IsAssignedToListLevelOfOutlineStyle()))//<-end,zhaojianwei
Out( aRTFNodeFnTab, rCNd, *this );
}
@@ -1078,10 +1080,12 @@ void SwRTFWriter::OutRTFStyleTab()
break;
}
- if( NO_NUMBERING != pColl->GetOutlineLevel() )
+ //if( NO_NUMBERING != pColl->GetOutlineLevel() )//#outline level,zhaojianwei
+ if(pColl->IsAssignedToListLevelOfOutlineStyle())//<-end,zhaojianwei
{
Strm() << '{' << sRTF_IGNORE << sRTF_SOUTLVL;
- OutULong( pColl->GetOutlineLevel() ) << '}';
+ //OutULong( pColl->GetOutlineLevel() ) << '}';//#outline level,zhaojianwei
+ OutULong( pColl->GetAssignedOutlineStyleLevel() ) << '}';//<-end,zhaojianwei
}
Strm() << ' ';
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index 7433242f2cb0..28de14c446ce 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -105,8 +105,9 @@ namespace
public:
bool operator()(const SwTxtFmtColl *pA, const SwTxtFmtColl *pB) const
{
- return pA->GetOutlineLevel() < pB->GetOutlineLevel();
- }
+ //return pA->GetOutlineLevel() < pB->GetOutlineLevel(); //#outline level,zhaojianwei
+ return pA->GetAttrOutlineLevel() < pB->GetAttrOutlineLevel(); //<-end,zhaojianwei
+ }
};
bool IsValidSlotWhich(USHORT nSlotId, USHORT nWhichId)
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 332767eb38e7..deafb365bf51 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -781,9 +781,11 @@ bool SwWW8Writer::DisallowInheritingOutlineNumbering(const SwFmt &rFmt)
{
if (const SwFmt *pParent = rFmt.DerivedFrom())
{
- BYTE nLvl = ((const SwTxtFmtColl*)pParent)->GetOutlineLevel();
- if (MAXLEVEL > nLvl)
- {
+ //BYTE nLvl = ((const SwTxtFmtColl*)pParent)->GetOutlineLevel(); //#outline level,removed by zhaojianwei
+ //if (MAXLEVEL > nLvl)
+ //{ //<-end, ->add by zhaojianwei
+ if (((const SwTxtFmtColl*)pParent)->IsAssignedToListLevelOfOutlineStyle())
+ { //<-end,zhaojianwei
if (bWrtWW8)
{
SwWW8Writer::InsUInt16(*pO, 0x2640);
@@ -815,14 +817,18 @@ void SwWW8Writer::Out_SwFmt(const SwFmt& rFmt, bool bPapFmt, bool bChpFmt,
case RES_TXTFMTCOLL:
if( bPapFmt )
{
- BYTE nLvl = ((const SwTxtFmtColl&)rFmt).GetOutlineLevel();
- if (MAXLEVEL > nLvl)
+ //BYTE nLvl = ((const SwTxtFmtColl&)rFmt).GetOutlineLevel(); //#outline level,removed by zhaojianwei
+ //if (MAXLEVEL > nLvl)
+ //{ //<-end, ->add by zhaojianwei
+ if (((const SwTxtFmtColl&)rFmt).IsAssignedToListLevelOfOutlineStyle())
{
+ int nLvl = ((const SwTxtFmtColl&)rFmt).GetAssignedOutlineStyleLevel(); //<-end,zhaojianwei
+
//if outline numbered
// if Write StyleDefinition then write the OutlineRule
- const SwNumFmt& rNFmt = pDoc->GetOutlineNumRule()->Get(nLvl);
+ const SwNumFmt& rNFmt = pDoc->GetOutlineNumRule()->Get(static_cast<USHORT>(nLvl));
if (bStyDef)
- ExportOutlineNumbering(nLvl, rNFmt, rFmt);
+ ExportOutlineNumbering(static_cast<BYTE>(nLvl), rNFmt, rFmt);
// --> OD 2008-06-03 #i86652#
// if (rNFmt.GetAbsLSpace())
@@ -2114,32 +2120,43 @@ void SwWW8Writer::StartTOX( const SwSection& rSect )
// Search over all the outline styles used and figure out
// what is the minimum outline level we need to display
// (ignoring headline styles 1-9)
- BYTE nLvl = 0, nMinLvl = 0;
+ //BYTE nLvl = 0, nMinLvl = 0; //#outline level, removed by zhaojianwei
+ int nLvl = 0, nMinLvl = 0; //<-end,add by zhaojianwei
const SwTxtFmtColls& rColls = *pDoc->GetTxtFmtColls();
const SwTxtFmtColl* pColl;
for( n = rColls.Count(); n; )
{
pColl = rColls[ --n ];
- nLvl = pColl->GetOutlineLevel();
+ //nLvl = pColl->GetOutlineLevel(); //#outline level,zhaojianwei
+ //USHORT nPoolId = pColl->GetPoolFmtId();
+ //if( MAXLEVEL > nLvl && nMinLvl < nLvl && //<-end, ->add by zhaojianwei
USHORT nPoolId = pColl->GetPoolFmtId();
- if( MAXLEVEL > nLvl && nMinLvl < nLvl &&
+ if( pColl->IsAssignedToListLevelOfOutlineStyle() &&
+ nMinLvl < (nLvl = pColl->GetAssignedOutlineStyleLevel()) && //<-end,zhaojianwei
( RES_POOLCOLL_HEADLINE1 > nPoolId ||
RES_POOLCOLL_HEADLINE9 < nPoolId ))
{
-
-
- // If we are using the default heading styles then use nTOXLvl
- if(!nMinLvl)
- nLvl = static_cast< BYTE >(nTOXLvl);
- else
- nLvl = nMinLvl < nTOXLvl ? nMinLvl : (BYTE)nTOXLvl;
+ // If we are using the default heading styles then use nTOXLvl
+ if(!nMinLvl)
+ nLvl = nTOXLvl;
+ else
+ nLvl = nMinLvl < nTOXLvl ? nMinLvl : (BYTE)nTOXLvl;
nMinLvl = nLvl;
}
}
- if( nLvl )
+ // --> OD 2008-12-19 #i70748#
+ // Correction: in the above loop the <nMinLvl> is set != 0,
+ // if a to outline style assigned paragraph style exists,
+ // which does not belong to the default ones.
+ // It has to be considered that the last checked
+ // to outline style assigned paragraph style could have
+ // assigned outline style level == 0.
+ // Thus, check on and export of <nMinLvl> instead of <nLvl>.
+// if( nLvl )
+ if ( nMinLvl > 0 )
{
- USHORT nTmpLvl = nLvl + 1;
+ int nTmpLvl = nMinLvl + 1;
if (nTmpLvl > WW8ListManager::nMaxLevel)
nTmpLvl = WW8ListManager::nMaxLevel;
@@ -2148,16 +2165,24 @@ void SwWW8Writer::StartTOX( const SwSection& rSect )
sStr.AppendAscii(sEntryEnd);
}
+ // <--
- if( nLvl != nMinLvl )
+ // --> OD 2008-12-19 #i70748#
+ // See above, checking <nLvl != nMinLvl> does not make sense.
+// if( nLvl != nMinLvl )
+ if( nMinLvl > 0 )
+ // <--
{
// collect this templates into the \t otion
for( n = rColls.Count(); n;)
{
pColl = rColls[--n];
- nLvl = pColl->GetOutlineLevel();
- if (MAXLEVEL > nLvl && nMinLvl <= nLvl)
- {
+ //nLvl = pColl->GetOutlineLevel(); //#outline level, removed by zhaojianwei
+ //if (MAXLEVEL > nLvl && nMinLvl <= nLvl)
+ //{ //<-end, ->add by zhaojianwei
+ if( pColl->IsAssignedToListLevelOfOutlineStyle() &&
+ nMinLvl <= ( nLvl = pColl->GetAssignedOutlineStyleLevel()))
+ { //<-end,zhaojianwei
if( sTOption.Len() )
sTOption += ';';
(( sTOption += pColl->GetName() ) += ';' )
@@ -3260,8 +3285,10 @@ static Writer& OutWW8_SwNumRuleItem( Writer& rWrt, const SfxPoolItem& rHt )
else if( rWW8Wrt.pOutFmtNode->ISA( SwTxtFmtColl ))
{
const SwTxtFmtColl* pC = (SwTxtFmtColl*)rWW8Wrt.pOutFmtNode;
- if( pC && MAXLEVEL > pC->GetOutlineLevel() )
- nLvl = pC->GetOutlineLevel();
+ //if( pC && MAXLEVEL > pC->GetOutlineLevel() ) //#outline level,removed by zhaojianwei
+ // nLvl = pC->GetOutlineLevel(); //<-end, ->add by zhaojianwei
+ if( pC && pC->IsAssignedToListLevelOfOutlineStyle() )
+ nLvl = static_cast<BYTE>(pC->GetAssignedOutlineStyleLevel()); //<-end,zhaojianwei
}
}
}
@@ -4998,6 +5025,7 @@ SwAttrFnTab aWW8AttrFnTab = {
/* RES_PARATR_VERTALIGN */ OutWW8_SvxParaVertAlignItem,
/* RES_PARATR_SNAPTOGRID*/ OutWW8_SvxParaGridItem,
/* RES_PARATR_CONNECT_TO_BORDER */ 0, // new
+/* RES_PARATR_OUTLINELEVEL */ 0, // new - outlinelevel
/* RES_PARATR_LIST_ID */ 0, // new
/* RES_PARATR_LIST_LEVEL */ 0, // new
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 23c7b6133f81..a5e008811447 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4367,7 +4367,8 @@ public:
outlineeq(BYTE nNum) : mnNum(nNum) {}
bool operator()(const SwTxtFmtColl *pTest) const
{
- return pTest->GetOutlineLevel() == mnNum;
+ //return pTest->GetOutlineLevel() == mnNum; //#outline level,zhaojianwei
+ return pTest->IsAssignedToListLevelOfOutlineStyle() && pTest->GetAssignedOutlineStyleLevel() == mnNum; //<-end,zhaojianwei
}
};
@@ -4389,7 +4390,7 @@ void SwWW8ImplReader::SetOutLineStyles()
sw::ParaStyles aOutLined(sw::util::GetParaStyles(rDoc));
sw::util::SortByOutline(aOutLined);
- typedef sw::ParaStyleIter myiter;
+ typedef sw::ParaStyleIter myParaStyleIter;
/*
If we are inserted into a document then don't clobber existing existing
levels.
@@ -4397,11 +4398,16 @@ void SwWW8ImplReader::SetOutLineStyles()
USHORT nFlagsStyleOutlLevel = 0;
if (!mbNewDoc)
{
- myiter aEnd = aOutLined.end();
- for (myiter aIter = aOutLined.begin(); aIter < aEnd; ++aIter)
+ // --> OD 2008-12-16 #i70748#
+ // backward iteration needed due to the outline level attribute
+ sw::ParaStyles::reverse_iterator aEnd = aOutLined.rend();
+ for ( sw::ParaStyles::reverse_iterator aIter = aOutLined.rbegin(); aIter < aEnd; ++aIter)
+ // <--
{
- if ((*aIter)->GetOutlineLevel() < MAXLEVEL)
- nFlagsStyleOutlLevel |= 1 << (*aIter)->GetOutlineLevel();
+ //if ((*aIter)->GetOutlineLevel() < MAXLEVEL) //#outline level,zhaojianwei,
+ //nFlagsStyleOutlLevel |= 1 << (*aIter)->GetOutlineLevel();
+ if ((*aIter)->IsAssignedToListLevelOfOutlineStyle())
+ nFlagsStyleOutlLevel |= 1 << (*aIter)->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei
else
break;
}
@@ -4463,11 +4469,17 @@ void SwWW8ImplReader::SetOutLineStyles()
if (mpChosenOutlineNumRule != &aOutlineRule)
{
- myiter aEnd = aOutLined.end();
- for (myiter aIter = aOutLined.begin(); aIter < aEnd; ++aIter)
+ // --> OD 2008-12-16 #i70748#
+ // backward iteration needed due to the outline level attribute
+ sw::ParaStyles::reverse_iterator aEnd = aOutLined.rend();
+ for ( sw::ParaStyles::reverse_iterator aIter = aOutLined.rbegin(); aIter < aEnd; ++aIter)
+ // <--
{
- if ((*aIter)->GetOutlineLevel() < MAXLEVEL)
- (*aIter)->SetOutlineLevel(NO_NUMBERING);
+ //if ((*aIter)->GetOutlineLevel() < MAXLEVEL)//#outline level,zhaojianwei
+ // (*aIter)->SetOutlineLevel(NO_NUMBERING);
+ if((*aIter)->IsAssignedToListLevelOfOutlineStyle())
+ (*aIter)->DeleteAssignmentToListLevelOfOutlineStyle(); //<-end
+
else
break;
}
@@ -4494,7 +4506,8 @@ void SwWW8ImplReader::SetOutLineStyles()
*/
rSI.pFmt->SetFmtAttr(
SwNumRuleItem( rSI.pOutlineNumrule->GetName() ) );
- ((SwTxtFmtColl*)rSI.pFmt)->SetOutlineLevel(NO_NUMBERING);
+ //((SwTxtFmtColl*)rSI.pFmt)->SetOutlineLevel(NO_NUMBERING);
+ ((SwTxtFmtColl*)rSI.pFmt)->DeleteAssignmentToListLevelOfOutlineStyle();//#outline level,zhaojianwei
}
else
{
@@ -4509,13 +4522,14 @@ void SwWW8ImplReader::SetOutLineStyles()
the list of level in nFlagsStyleOutlLevel to ignore.
*/
outlineeq aCmp(rSI.nOutlineLevel);
- myiter aResult = std::find_if(aOutLined.begin(),
+ myParaStyleIter aResult = std::find_if(aOutLined.begin(),
aOutLined.end(), aCmp);
- myiter aEnd = aOutLined.end();
+ myParaStyleIter aEnd = aOutLined.end();
while (aResult != aEnd && aCmp(*aResult))
{
- (*aResult)->SetOutlineLevel(NO_NUMBERING);
+ //(*aResult)->SetOutlineLevel(NO_NUMBERING);//#outline level,zhaojianwei
+ (*aResult)->DeleteAssignmentToListLevelOfOutlineStyle();
++aResult;
}
@@ -4535,7 +4549,8 @@ void SwWW8ImplReader::SetOutLineStyles()
const SwNumFmt& rRule=rSI.pOutlineNumrule->Get(nFromLevel);
aOutlineRule.Set(nToLevel, rRule);
// Set my outline level
- ((SwTxtFmtColl*)rSI.pFmt)->SetOutlineLevel(nToLevel);
+ //((SwTxtFmtColl*)rSI.pFmt)->SetOutlineLevel(nToLevel);//#outline level,zhaojianwei
+ ((SwTxtFmtColl*)rSI.pFmt)->AssignToListLevelOfOutlineStyle(nToLevel); //<-end,zhaojianwei
// If there are more styles on this level ignore them
nFlagsStyleOutlLevel |= nAktFlags;
}
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index b63181ddbf65..e9f5442f240a 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -833,7 +833,8 @@ void SwWW8ImplReader::Read_ANLevelNo( USHORT, const BYTE* pData, short nLen )
{
nSwNumLevel = *pData - 1;
if (!bNoAttrImport)
- ((SwTxtFmtColl*)pAktColl)->SetOutlineLevel( nSwNumLevel );
+ //((SwTxtFmtColl*)pAktColl)->SetOutlineLevel( nSwNumLevel ); //#outline level,zhaojianwei
+ ((SwTxtFmtColl*)pAktColl)->AssignToListLevelOfOutlineStyle( nSwNumLevel ); //<-end,zhaojianwei
// Bei WW-NoNumbering koennte auch NO_NUMBERING gesetzt
// werden. ( Bei normaler Nummerierung muss NO_NUM gesetzt
// werden: NO_NUM : Nummerierungs-Pause,
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 452650e20b3b..5450b904c100 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2617,7 +2617,8 @@ bool SwWW8ImplReader::AddExtraOutlinesAsExtraStyles(SwTOXBase& rBase)
sal_uInt16 nStyleLevel = rSI.nOutlineLevel;
sal_uInt16 nMaxLevel = rBase.GetLevel();
if (
- nStyleLevel != pFmt->GetOutlineLevel() &&
+ //nStyleLevel != pFmt->GetOutlineLevel() && //#outline level,zhaojianwei
+ nStyleLevel != (pFmt->GetAttrOutlineLevel()-1) && //<-end,zhaojianwei
nStyleLevel < nMaxLevel
)
{
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index f27d82ae73e5..2536b9bf57e3 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -96,6 +96,10 @@
#include <svx/svdograf.hxx>
// <--
+// --> OD 2008-12-17 #i70748#
+#include <sfx2/docfilt.hxx>
+// <--
+
#include <istyleaccess.hxx>
#define LOGFILE_AUTHOR "mb93740"
@@ -422,9 +426,11 @@ void lcl_AdjustOutlineStylesForOOo( SwDoc& _rDoc )
for ( USHORT n = 1; n < rColls.Count(); ++n )
{
SwTxtFmtColl* pColl = rColls[ n ];
- if ( pColl->GetOutlineLevel() != NO_NUMBERING )
+ //if ( pColl->GetOutlineLevel() != NO_NUMBERING ) //#outline level zhaojianwei
+ if ( pColl->IsAssignedToListLevelOfOutlineStyle() )
{
- aOutlineLevelAssigned[ pColl->GetOutlineLevel() ] = true;
+ // aOutlineLevelAssigned[ pColl->GetOutlineLevel() ] = true;
+ aOutlineLevelAssigned[ pColl->GetAssignedOutlineStyleLevel() ] = true;//<-end,zhaojianwei
}
for ( BYTE i = 0; i < MAXLEVEL; ++i )
@@ -449,11 +455,12 @@ void lcl_AdjustOutlineStylesForOOo( SwDoc& _rDoc )
// if ( aCreatedDefaultOutlineStyles[ i ] != 0 && !aOutlineLevelAssigned[ i ] )
if ( !aOutlineLevelAssigned[ i ] &&
aCreatedDefaultOutlineStyles[ i ] != 0 &&
- aCreatedDefaultOutlineStyles[ i ]->GetOutlineLevel() == NO_NUMBERING )
+ ! aCreatedDefaultOutlineStyles[ i ]->IsAssignedToListLevelOfOutlineStyle() )
// <--
{
// apply outline level at created default outline style
- aCreatedDefaultOutlineStyles[ i ]->SetOutlineLevel( i );
+ //aCreatedDefaultOutlineStyles[ i ]->SetOutlineLevel( i );
+ aCreatedDefaultOutlineStyles[ i ]->AssignToListLevelOfOutlineStyle(i);//#outline level added by zhaojianwei
// apply outline numbering rule, if none is set.
const SfxPoolItem& rItem =
@@ -961,16 +968,22 @@ ULONG XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, const S
xObjectResolver = 0;
rDoc.release();
- // --> OD 2005-09-06 #i44177# - assure that for documents in OpenOffice.org
- // file format the relation between outline numbering rule and styles is
- // filled-up accordingly.
- // Note: The OpenOffice.org file format, which has no content that applys
- // a certain style, which is related to the outline numbering rule,
- // has lost the information, that this certain style is related to
- // the outline numbering rule.
if ( !bOASIS )
{
- lcl_AdjustOutlineStylesForOOo( rDoc );
+ // --> OD 2005-09-06 #i44177# - assure that for documents in OpenOffice.org
+ // file format the relation between outline numbering rule and styles is
+ // filled-up accordingly.
+ // Note: The OpenOffice.org file format, which has no content that applys
+ // a certain style, which is related to the outline numbering rule,
+ // has lost the information, that this certain style is related to
+ // the outline numbering rule.
+ // --> OD 2008-12-17 #i70748# - only for templates
+ if ( pMedium && pMedium->GetFilter() &&
+ pMedium->GetFilter()->IsOwnTemplateFormat() )
+ {
+ lcl_AdjustOutlineStylesForOOo( rDoc );
+ }
+ // <--
// Fix #i58251#: Unfortunately is the static default different to SO7 behaviour,
// so we have to set a dynamic default after importing SO7
rDoc.SetDefault( SfxBoolItem( RES_ROW_SPLIT, FALSE ) );
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index e12c5eb551e3..b8a11b01c441 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -330,15 +330,18 @@ void SwXMLAutoStylePoolP::exportStyleAttributes(
{
OUString sStyleName;
aProperty->maValue >>= sStyleName;
+ // --> OD 2008-11-19 #i70748#
+ // export also empty list styles
if( sStyleName.getLength() )
{
OUString sTmp = rExport.GetTextParagraphExport()->GetListAutoStylePool().Find( sStyleName );
if( sTmp.getLength() )
sStyleName = sTmp;
- GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- sListStyleName,
- GetExport().EncodeStyleName( sStyleName ) );
}
+ GetExport().AddAttribute( XML_NAMESPACE_STYLE,
+ sListStyleName,
+ GetExport().EncodeStyleName( sStyleName ) );
+ // <--
}
break;
case CTF_PAGEDESCNAME:
diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src
index 839fdb0a1ee8..961e8bdc57a0 100644
--- a/sw/source/ui/app/app.src
+++ b/sw/source/ui/app/app.src
@@ -473,8 +473,21 @@ String STR_FDLG_TEMPLATE_BUTTON
String STR_FDLG_TEMPLATE_NAME
{
- Text [ en-US ] = "Styles: " ;
+ //Text [ en-US ] = "Styles: " ; //#outline level,removed by zhaojianwei
+ Text [ en-US ] = "separated by: " ; //<-end,add by zhaojianwei
};
+//#outline level,add by zhaojianwei
+String STR_FDLG_OUTLINE_LEVEL
+{
+ Text [ en-US ] = "Outline: Level ";
+};
+
+String STR_FDLG_STYLE
+{
+ Text [ en-US ] = "Style: ";
+};
+//<-end
+
String STR_PAGEOFFSET
{
@@ -565,7 +578,11 @@ String STR_DONT_ASK_AGAIN
{
Text [ en-US ] = "~Do not show warning again" ;
};
-
+// --> OD 2008-04-14 #outlinelevel#
+String STR_OUTLINE_NUMBERING
+{
+ Text [ en-US ] = "Outline Numbering";
+};
ToolBox RID_MODULE_TOOLBOX
{
HelpID = HID_MODULE_TOOLBOX ;
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index dd163a3216eb..40265dc364b7 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -161,6 +161,8 @@
#include "dialog.hrc"
#include "swabstdlg.hxx"
+#include <ndtxt.hxx> //#outline level,add by zhaojianwei
+
using namespace ::com::sun::star::ui::dialogs;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
@@ -1253,6 +1255,10 @@ void SwDocShell::Execute(SfxRequest& rReq)
{
bDone = FALSE;
BOOL bCreateHtml = FN_NEW_HTML_DOC == nWhich;
+
+ BOOL bCreateByOutlineLevel = false; //#outline level,add by zhaojianwei
+ sal_Int32 nTemplateOutlineLevel = 0 ; //#outline level,add by zhaojianwei
+
String aFileName, aTemplateName;
if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich, FALSE, &pItem ) )
{
@@ -1326,35 +1332,85 @@ void SwDocShell::Execute(SfxRequest& rReq)
if(!bError)
{
uno::Reference<XFilePickerControlAccess> xCtrlAcc(xFP, UNO_QUERY);
- const USHORT nCount = pDoc->GetTxtFmtColls()->Count();
- Sequence<OUString> aListBoxEntries(nCount);
+
+ //#removed by zhaojianwei
+
+ // const USHORT nCount = pDoc->GetTxtFmtColls()->Count();
+ // Sequence<OUString> aListBoxEntries(nCount);
+ // OUString* pEntries = aListBoxEntries.getArray();
+ // sal_Int32 nIdx = 0;
+ // sal_Int16 nSelect = 0;
+ // OUString sStartTemplate;
+ // SwTxtFmtColl *pFnd = 0, *pAny = 0;
+ // for(USHORT i = 0; i < nCount; ++i)
+ // {
+ // SwTxtFmtColl &rTxtColl =
+ // *pDoc->GetTxtFmtColls()->GetObject( i );
+ // if( !rTxtColl.IsDefault() && rTxtColl.IsAtDocNodeSet() )
+ // {
+ // //if( MAXLEVEL >= rTxtColl.GetOutlineLevel() && ( !pFnd || //#outline level,zhaojianwei
+ //if( rTxtColl.IsAssignedToListLevelOfOutlineStyle() && ( !pFnd || //<-end,zhaojianwei
+ // pFnd->GetAssignedOutlineStyleLevel() > rTxtColl.GetAssignedOutlineStyleLevel() ))
+ // {
+ // nSelect = (sal_Int16)nIdx;
+ // pFnd = &rTxtColl;
+ // sStartTemplate = rTxtColl.GetName();
+ // }
+ // else if( !pAny )
+ // pAny = &rTxtColl;
+ // //pEntries[nIdx++] = rTxtColl.GetName(); //#outline level,remove by zhaojianwei
+ // pEntries[nIdx++] = sStyles + rTxtColl.GetName(); //#outline level,add by zhaojianwei
+ // }
+ // }
+ // if(!sStartTemplate.getLength() && pAny)
+ // sStartTemplate = pAny->GetName();
+ // aListBoxEntries.realloc(nIdx);
+ //<-end,zhaojianwei
+
+
+ //#outline level,add by zhaojianwei
+ /////////////////////////////////////////////////////////////////////
+
+ bool bOutline[MAXLEVEL] = {false};
+ const SwOutlineNodes& rOutlNds = pDoc->GetNodes().GetOutLineNds();
+ if( rOutlNds.Count() )
+ {
+ int nLevel;
+ for(USHORT n = 0; n < rOutlNds.Count(); ++n )
+ if( ( nLevel = rOutlNds[n]->GetTxtNode()->GetAttrOutlineLevel()) > 0 &&
+ ! bOutline[nLevel-1] )
+ {
+ bOutline[nLevel-1] = true;
+ }
+ }
+
+ const USHORT nStyleCount = pDoc->GetTxtFmtColls()->Count();
+ Sequence<OUString> aListBoxEntries( MAXLEVEL + nStyleCount);
OUString* pEntries = aListBoxEntries.getArray();
- sal_Int32 nIdx = 0;
- sal_Int16 nSelect = 0;
- OUString sStartTemplate;
- SwTxtFmtColl *pFnd = 0, *pAny = 0;
- for(USHORT i = 0; i < nCount; ++i)
+ sal_Int32 nIdx = 0 ;
+
+ OUString sOutline( SW_RESSTR(STR_FDLG_OUTLINE_LEVEL) );
+ for( USHORT i = 0; i < MAXLEVEL; ++i )
+ {
+ if( bOutline[i] )
+ pEntries[nIdx++] = sOutline + String::CreateFromInt32( i+1 );
+ }
+
+ OUString sStyle( SW_RESSTR(STR_FDLG_STYLE) );
+ for(USHORT i = 0; i < nStyleCount; ++i)
{
SwTxtFmtColl &rTxtColl =
- *pDoc->GetTxtFmtColls()->GetObject( i );
+ *pDoc->GetTxtFmtColls()->GetObject( i );
if( !rTxtColl.IsDefault() && rTxtColl.IsAtDocNodeSet() )
{
- if( MAXLEVEL >= rTxtColl.GetOutlineLevel() && ( !pFnd ||
- pFnd->GetOutlineLevel() > rTxtColl.GetOutlineLevel() ))
- {
- nSelect = (sal_Int16)nIdx;
- pFnd = &rTxtColl;
- sStartTemplate = rTxtColl.GetName();
- }
- else if( !pAny )
- pAny = &rTxtColl;
- pEntries[nIdx++] = rTxtColl.GetName();
+ pEntries[nIdx++] = sStyle + rTxtColl.GetName();
}
}
- if(!sStartTemplate.getLength() && pAny)
- sStartTemplate = pAny->GetName();
aListBoxEntries.realloc(nIdx);
+ sal_Int16 nSelect = 0;
+ /////////////////////////////////////////////////////////////////////
+ //<-end,zhaojianwei
try
{
@@ -1384,7 +1440,22 @@ void SwDocShell::Execute(SfxRequest& rReq)
ListboxControlActions::GET_SELECTED_ITEM );
OUString sTmpl;
aTemplateValue >>= sTmpl;
- aTemplateName = sTmpl;
+ //aTemplateName = sTmpl; //#outline level,removed by zhaojianwei
+ //#outline level,add by zhaojianwei
+
+ sal_Int32 nColonPos = sTmpl.indexOf( sal_Unicode(':') );
+ OUString sPrefix = sTmpl.copy( 0L, nColonPos );
+ if( sPrefix.equalsAscii("Style"))
+ {
+ aTemplateName = sTmpl.copy( 7L ); //get string behind "Style: "
+ }
+ else if( sPrefix.equalsAscii("Outline"))
+ {
+ nTemplateOutlineLevel = ( sTmpl.copy( 15L )).toInt32(); //get string behind "Outline: Leve ";
+ bCreateByOutlineLevel = true;
+ }
+ //<-end,zhaojianwei
+
if ( aFileName.Len() )
{
rReq.AppendItem( SfxStringItem( nWhich, aFileName ) );
@@ -1395,19 +1466,35 @@ void SwDocShell::Execute(SfxRequest& rReq)
}
}
- const SwTxtFmtColl* pSplitColl = 0;
- if ( aTemplateName.Len() )
- pSplitColl = pDoc->FindTxtFmtCollByName(aTemplateName);
-
+ //const SwTxtFmtColl* pSplitColl = 0; //#outline level,removed by zhaojianwei
+ // if ( aTemplateName.Len() )
+ // pSplitColl = pDoc->FindTxtFmtCollByName(aTemplateName);
+ //<-end,zhaojianwei
if( aFileName.Len() )
{
if( PrepareClose( FALSE ) )
{
SwWait aWait( *this, TRUE );
- bDone = bCreateHtml
- ? pDoc->GenerateHTMLDoc( aFileName, pSplitColl )
- : pDoc->GenerateGlobalDoc( aFileName, pSplitColl );
+ //bDone = bCreateHtml //#outline level,removed by zhaojianwei
+ // ? pDoc->GenerateHTMLDoc( aFileName, pSplitColl )
+ // : pDoc->GenerateGlobalDoc( aFileName, pSplitColl );
+ if ( bCreateByOutlineLevel ) //add by zhaojianwei
+ {
+ bDone = bCreateHtml //#outline level,removed by zhaojianwei
+ ? pDoc->GenerateHTMLDoc( aFileName, nTemplateOutlineLevel )
+ : pDoc->GenerateGlobalDoc( aFileName, nTemplateOutlineLevel );
+ }
+ else
+ {
+ const SwTxtFmtColl* pSplitColl = 0;
+ if ( aTemplateName.Len() )
+ pSplitColl = pDoc->FindTxtFmtCollByName(aTemplateName);
+ bDone = bCreateHtml //#outline level,removed by zhaojianwei
+ ? pDoc->GenerateHTMLDoc( aFileName, pSplitColl )
+ : pDoc->GenerateGlobalDoc( aFileName, pSplitColl );
+ }
+ //<-end,zhaojianwei
if( bDone )
{
SfxStringItem aName( SID_FILE_NAME, aFileName );
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index 692e054edd54..cd98bb0cb554 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -85,6 +85,8 @@
#include <list.hxx>
// <--
+#include <paratr.hxx> //#outline level,add by zhaojianwei
+
using namespace ::com::sun::star;
/*--------------------------------------------------------------------
@@ -546,6 +548,20 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam
}
pDStyle->GetCollection()->SetDerivedFrom( pColl );
pDStyle->PresetParent( rParent );
+
+ //#outline level,add by zhaojianwei
+ /*When a new paragraph style is created based on a "to outline style
+ assigned" paragraph style, the outline level attribute and the list
+ style attribute of the new paragraph style have to be set to 0
+ respectively "".*/
+ if( pColl->IsAssignedToListLevelOfOutlineStyle())
+ {
+ SwNumRuleItem aItem(aEmptyStr);
+ pDStyle->GetCollection()->SetFmtAttr( aItem );
+ pDStyle->GetCollection()->SetAttrOutlineLevel( 0 );
+ }
+ //<-end,zhaojianwei
+
}
else
{
diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx
index c7be232b2813..41814d006339 100644
--- a/sw/source/ui/app/docstyle.cxx
+++ b/sw/source/ui/app/docstyle.cxx
@@ -1212,7 +1212,13 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
if( pColl != &pColl->GetNextTxtFmtColl() )
pCColl->SetNextTxtFmtColl( pColl->GetNextTxtFmtColl() );
- pCColl->SetOutlineLevel( pColl->GetOutlineLevel() );
+ //pCColl->SetOutlineLevel( pColl->GetOutlineLevel() );//#outline level,zhaojianwei
+ if( pColl->IsAssignedToListLevelOfOutlineStyle())
+ pCColl->AssignToListLevelOfOutlineStyle(pColl->GetAssignedOutlineStyleLevel());
+ else
+ pCColl->DeleteAssignmentToListLevelOfOutlineStyle();//<--end,zhaojianwei
+
+
SwTxtFmtColl* pFindFmt;
const CommandStruct* pCmds = SwCondCollItem::GetCmds();
diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx
index ef7f4af3ef83..26f146e628f0 100644
--- a/sw/source/ui/chrdlg/numpara.cxx
+++ b/sw/source/ui/chrdlg/numpara.cxx
@@ -53,6 +53,9 @@
#include <fmtline.hxx>
#include <numpara.hxx>
#include <numpara.hrc>
+// --> OD 2008-04-14 #outlinelevel#
+#include <app.hrc>
+// <--
// Globals ******************************************************************
@@ -66,6 +69,9 @@ static USHORT __FAR_DATA aPageRg[] = {
SwParagraphNumTabPage::SwParagraphNumTabPage(Window* pParent,
const SfxItemSet& rAttr ) :
SfxTabPage(pParent, SW_RES(TP_NUMPARA), rAttr),
+ aOutlineStartFL ( this, SW_RES( FL_OUTLINE_START )),
+ aOutlineLvFT ( this, SW_RES( FT_OUTLINE_LEVEL )),
+ aOutlineLvLB ( this, SW_RES( LB_OUTLINE_LEVEL )),
aNumberStyleFT ( this, SW_RES( FT_NUMBER_STYLE ) ),
aNumberStyleLB ( this, SW_RES( LB_NUMBER_STYLE ) ),
aNewStartFL ( this, SW_RES( FL_NEW_START ) ),
@@ -77,6 +83,9 @@ SwParagraphNumTabPage::SwParagraphNumTabPage(Window* pParent,
aRestartParaCountCB ( this, SW_RES( CB_RESTART_PARACOUNT ) ),
aRestartFT ( this, SW_RES( FT_RESTART_NO ) ),
aRestartNF ( this, SW_RES( NF_RESTART_PARA ) ),
+ // --> OD 2008-04-14 #outlinelevel#
+ msOutlineNumbering( SW_RES( STR_OUTLINE_NUMBERING ) ),
+ // <--
bModified(FALSE),
bCurNumrule(FALSE)
{
@@ -135,6 +144,18 @@ USHORT* SwParagraphNumTabPage::GetRanges()
--------------------------------------------------*/
BOOL SwParagraphNumTabPage::FillItemSet( SfxItemSet& rSet )
{
+ //<-#outline level, added by zhaojianwei
+ if( aOutlineLvLB.GetSelectEntryPos() != aOutlineLvLB.GetSavedValue())
+ {
+ USHORT aOutlineLv = aOutlineLvLB.GetSelectEntryPos();
+ const SfxUInt16Item* pOldOutlineLv = (const SfxUInt16Item*)GetOldItem( rSet, SID_ATTR_PARA_OUTLINE_LEVEL);
+ SfxUInt16Item* pOutlineLv = (SfxUInt16Item*)pOldOutlineLv->Clone();
+ pOutlineLv->SetValue( aOutlineLv );
+ rSet.Put(*pOutlineLv);
+ delete pOutlineLv;
+ bModified = TRUE;
+ }
+ //<-end
if( aNumberStyleLB.GetSelectEntryPos() != aNumberStyleLB.GetSavedValue())
{
String aStyle;
@@ -178,16 +199,41 @@ BOOL SwParagraphNumTabPage::FillItemSet( SfxItemSet& rSet )
--------------------------------------------------*/
void SwParagraphNumTabPage::Reset( const SfxItemSet& rSet )
{
- SfxItemState eItemState = rSet.GetItemState( GetWhich(SID_ATTR_PARA_NUMRULE) );
+ BOOL bHasNumberStyle = FALSE;
+
+ SfxItemState eItemState = rSet.GetItemState( GetWhich(SID_ATTR_PARA_OUTLINE_LEVEL) );
+
+ sal_Int16 nOutlineLv;
+ if( eItemState >= SFX_ITEM_AVAILABLE )
+ {
+ nOutlineLv = ((const SfxUInt16Item &)rSet.Get( GetWhich(SID_ATTR_PARA_OUTLINE_LEVEL) )).GetValue();
+ aOutlineLvLB.SelectEntryPos( nOutlineLv ) ;
+ }
+ else
+ {
+ aOutlineLvLB.SetNoSelection();
+ }
+ aOutlineLvLB.SaveValue();
+
+ eItemState = rSet.GetItemState( GetWhich(SID_ATTR_PARA_NUMRULE) );
String aStyle;
- BOOL bHasNumberStyle = FALSE;
if( eItemState >= SFX_ITEM_AVAILABLE )
{
aStyle = ((const SfxStringItem &)rSet.Get( GetWhich(SID_ATTR_PARA_NUMRULE) )).GetValue();
if(!aStyle.Len())
aStyle = aNumberStyleLB.GetEntry(0);
- aNumberStyleLB.SelectEntry( aStyle );
+
+ if( aStyle.EqualsAscii("Outline"))// == String::CreateFromAscii("Outline")) //maybe need modify,zhaojianwei
+ {
+ aNumberStyleLB.InsertEntry( msOutlineNumbering );
+ aNumberStyleLB.SelectEntry( msOutlineNumbering );
+ aNumberStyleLB.RemoveEntry(msOutlineNumbering);
+ aNumberStyleLB.SaveValue();
+ }
+ else
+ aNumberStyleLB.SelectEntry( aStyle );
+
bHasNumberStyle = TRUE;
}
else
@@ -197,7 +243,6 @@ void SwParagraphNumTabPage::Reset( const SfxItemSet& rSet )
aNumberStyleLB.SaveValue();
-
eItemState = rSet.GetItemState( FN_NUMBER_NEWSTART );
if(eItemState > SFX_ITEM_AVAILABLE )
{
@@ -256,9 +301,22 @@ void SwParagraphNumTabPage::Reset( const SfxItemSet& rSet )
/*-----------------31.01.98 08:38-------------------
--------------------------------------------------*/
+void SwParagraphNumTabPage::DisableOutline()
+{
+ aOutlineLvFT.Disable();
+ aOutlineLvLB.Disable();
+}
+void SwParagraphNumTabPage::DisableNumbering()
+{
+ aNumberStyleFT.Disable();
+ aNumberStyleLB.Disable();
+}
+
+/*-----------------31.01.98 08:38-------------------
+
+--------------------------------------------------*/
void SwParagraphNumTabPage::EnableNewStart()
{
- aNewStartFL.Show();
aNewStartCB.Show();
aNewStartNumberCB.Show();
aNewStartNF.Show();
@@ -295,9 +353,14 @@ IMPL_LINK( SwParagraphNumTabPage, LineCountHdl_Impl, CheckBox* , EMPTYARG)
--------------------------------------------------*/
IMPL_LINK( SwParagraphNumTabPage, StyleHdl_Impl, ListBox*, pBox )
{
+// String dd=aNumberStyleLB.GetSavedValue();
+// if( msOutlineNumbering == dd)
+ {
+ }
BOOL bEnable = bCurNumrule || pBox->GetSelectEntryPos() > 0;
aNewStartCB.Enable(bEnable);
NewStartHdl_Impl(&aNewStartCB);
+
return 0;
}
diff --git a/sw/source/ui/chrdlg/numpara.hrc b/sw/source/ui/chrdlg/numpara.hrc
index 20730715d925..97dcb5707e12 100644
--- a/sw/source/ui/chrdlg/numpara.hrc
+++ b/sw/source/ui/chrdlg/numpara.hrc
@@ -44,7 +44,9 @@
#define CB_RESTART_PARACOUNT 9
#define FT_RESTART_NO 10
#define NF_RESTART_PARA 11
-
+#define FL_OUTLINE_START 12
+#define LB_OUTLINE_LEVEL 13
+#define FT_OUTLINE_LEVEL 14
// **********************************************************************
#endif
diff --git a/sw/source/ui/chrdlg/numpara.src b/sw/source/ui/chrdlg/numpara.src
index a2b09a55f8ab..e83487d1cc64 100644
--- a/sw/source/ui/chrdlg/numpara.src
+++ b/sw/source/ui/chrdlg/numpara.src
@@ -40,13 +40,19 @@ TabPage TP_NUMPARA
HelpID = HID_NUMPARA ;
Size = MAP_APPFONT ( 260 , 185 ) ;
Hide = TRUE ;
- FixedText FT_NUMBER_STYLE
+ FixedLine FL_OUTLINE_START
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 248 , 8 ) ;
+ Text [ en-US ] = "Outline" ;
+ };
+ FixedText FT_OUTLINE_LEVEL
{
Pos = MAP_APPFONT ( 12 , 16 ) ;
Size = MAP_APPFONT ( 112 , 8 ) ;
- Text [ en-US ] = "Numbering Style" ;
+ Text [ en-US ] = "Outline level" ;
};
- ListBox LB_NUMBER_STYLE
+ ListBox LB_OUTLINE_LEVEL
{
Pos = MAP_APPFONT ( 130 , 14 ) ;
Size = MAP_APPFONT ( 118 , 65 ) ;
@@ -54,19 +60,59 @@ TabPage TP_NUMPARA
Border = TRUE ;
StringList [ en-US ] =
{
- < "None" ; > ;
+ < "Body text" ; > ;
+ < "Level 1" ; >;
+ < "Level 2" ; >;
+ < "Level 3" ; >;
+ < "Level 4" ; >;
+ < "Level 5" ; >;
+ < "Level 6" ; >;
+ < "Level 7" ; >;
+ < "Level 8" ; >;
+ < "Level 9" ; >;
+ < "Level 10" ; >;
+ };
+ StringList [ x-comment ] =
+ {
+ < "Level 0" ; > ;
+ < "Level 1" ; >;
+ < "Level 2" ; >;
+ < "Level 3" ; >;
+ < "Level 4" ; >;
+ < "Level 5" ; >;
+ < "Level 6" ; >;
+ < "Level 7" ; >;
+ < "Level 8" ; >;
+ < "Level 9" ; >;
+ < "Level 10" ; >;
};
};
FixedLine FL_NEW_START
{
Pos = MAP_APPFONT ( 6 , 32 ) ;
Size = MAP_APPFONT ( 248 , 8 ) ;
- Hide = TRUE ;
Text [ en-US ] = "Numbering" ;
};
- TriStateBox CB_NEW_START
+ FixedText FT_NUMBER_STYLE
{
Pos = MAP_APPFONT ( 12 , 43 ) ;
+ Size = MAP_APPFONT ( 112 , 8 ) ;
+ Text [ en-US ] = "Numbering Style" ;
+ };
+ ListBox LB_NUMBER_STYLE
+ {
+ Pos = MAP_APPFONT ( 130 , 41 ) ;
+ Size = MAP_APPFONT ( 118 , 65 ) ;
+ DropDown = TRUE ;
+ Border = TRUE ;
+ StringList [ en-US ] =
+ {
+ < "None" ; > ;
+ };
+ };
+ TriStateBox CB_NEW_START
+ {
+ Pos = MAP_APPFONT ( 12 , 58 ) ;
Size = MAP_APPFONT ( 160 , 10 ) ;
Hide = TRUE ;
TabStop = TRUE ;
@@ -74,7 +120,7 @@ TabPage TP_NUMPARA
};
TriStateBox CB_NUMBER_NEW_START
{
- Pos = MAP_APPFONT ( 21 , 58 ) ;
+ Pos = MAP_APPFONT ( 21 , 73 ) ;
Size = MAP_APPFONT ( 103 , 10 ) ;
Hide = TRUE ;
Disable = TRUE ;
@@ -83,7 +129,7 @@ TabPage TP_NUMPARA
NumericField NF_NEW_START
{
Border = TRUE ;
- Pos = MAP_APPFONT ( 130 , 57 ) ;
+ Pos = MAP_APPFONT ( 130 , 72 ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
@@ -99,27 +145,27 @@ TabPage TP_NUMPARA
};
FixedLine FL_COUNT_PARA
{
- Pos = MAP_APPFONT ( 6 , 75 ) ;
+ Pos = MAP_APPFONT ( 6 , 89 ) ;
Size = MAP_APPFONT ( 248 , 8 ) ;
Text [ en-US ] = "Line numbering" ;
};
TriStateBox CB_COUNT_PARA
{
- Pos = MAP_APPFONT ( 12 , 86 ) ;
+ Pos = MAP_APPFONT ( 12 , 100 ) ;
Size = MAP_APPFONT ( 160 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Include this paragraph in line numbering" ;
};
TriStateBox CB_RESTART_PARACOUNT
{
- Pos = MAP_APPFONT ( 12 , 100 ) ;
+ Pos = MAP_APPFONT ( 12 , 116 ) ;
Size = MAP_APPFONT ( 160 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Rest~art at this paragraph" ;
};
FixedText FT_RESTART_NO
{
- Pos = MAP_APPFONT ( 21 , 116 ) ;
+ Pos = MAP_APPFONT ( 21 , 132 ) ;
Size = MAP_APPFONT ( 103 , 8 ) ;
Disable = TRUE ;
Text [ en-US ] = "~Start with" ;
@@ -127,7 +173,7 @@ TabPage TP_NUMPARA
NumericField NF_RESTART_PARA
{
Border = TRUE ;
- Pos = MAP_APPFONT ( 130 , 114 ) ;
+ Pos = MAP_APPFONT ( 130 , 130 ) ;
Size = MAP_APPFONT ( 26 , 12 ) ;
TabStop = TRUE ;
Left = TRUE ;
diff --git a/sw/source/ui/chrdlg/paradlg.src b/sw/source/ui/chrdlg/paradlg.src
index 3461668eeba7..54fb712cb22f 100644
--- a/sw/source/ui/chrdlg/paradlg.src
+++ b/sw/source/ui/chrdlg/paradlg.src
@@ -60,7 +60,7 @@ TabDialog DLG_PARA
PageItem
{
Identifier = TP_PARA_EXT ;
- /* ### ACHTUNG: Neuer Text in Resource? Textflu : Textflu */
+ /* ### ACHTUNG: Neuer Text in Resource? Textflu?: Textflu?*/
Text [ en-US ] = "Text Flow" ;
PageResID = TP_PARA_EXT ;
};
@@ -72,7 +72,7 @@ TabDialog DLG_PARA
PageItem
{
Identifier = TP_NUMPARA ;
- Text [ en-US ] = "Numbering" ;
+ Text [ en-US ] = "Outline & Numbering" ;
};
PageItem
{
diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx
index a6a100943fa8..fd8e22e88843 100644
--- a/sw/source/ui/chrdlg/pardlg.cxx
+++ b/sw/source/ui/chrdlg/pardlg.cxx
@@ -244,6 +244,13 @@ void __EXPORT SwParaDlg::PageCreated(USHORT nId, SfxTabPage& rPage)
}
else if( TP_NUMPARA == nId)
{
+ //-->#outline level,added by zhaojianwei
+ SwTxtFmtColl* pTmpColl = rSh.GetCurTxtFmtColl();
+ if( pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle() )
+ {
+ ((SwParagraphNumTabPage&)rPage).DisableOutline() ;
+ }//<-end
+
((SwParagraphNumTabPage&)rPage).EnableNewStart();
ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox();
SfxStyleSheetBasePool* pPool = rView.GetDocShell()->GetStyleSheetPool();
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 2b0b7c0931e1..a68acd0525a4 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -1443,6 +1443,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
KS_NumIndentInc, KS_NumIndentDec,
// <- #i23725#
+ KS_OutlineLvOff,
KS_NextCell, KS_PrevCell, KS_OutlineUp, KS_OutlineDown,
KS_GlossaryExpand, KS_NextPrevGlossary,
KS_AutoFmtByInput,
@@ -1764,7 +1765,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
!rSh.GetCurNumRule()->IsOutlineRule() &&
!rSh.HasSelection() &&
rSh.IsSttPara() && rSh.IsEndPara() )
- eKeyState = KS_NumOff;
+ eKeyState = KS_NumOff, eNextKeyState = KS_OutlineLvOff;
//RETURN fuer neuen Absatz mit AutoFormatierung
else if( pACfg && pACfg->IsAutoFmtByInput() &&
@@ -1934,7 +1935,9 @@ KEYINPUT_CHECKTABLE_INSDEL:
SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl();
if( pColl &&
//0 <= pColl->GetOutlineLevel() && #i24560#
- MAXLEVEL - 1 > pColl->GetOutlineLevel() )
+ //MAXLEVEL - 1 > pColl->GetOutlineLevel() )//#outline level,zhaojianwei
+ pColl->IsAssignedToListLevelOfOutlineStyle()
+ && MAXLEVEL-1 > pColl->GetAssignedOutlineStyleLevel() )//<-end,zhaojianwei
eKeyState = KS_OutlineDown;
}
}
@@ -1984,8 +1987,11 @@ KEYINPUT_CHECKTABLE_INSDEL:
if( rSh.IsSttOfPara() && !rSh.HasReadonlySel() )
{
SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl();
- if( pColl && 0 < pColl->GetOutlineLevel() &&
- MAXLEVEL - 1 >= pColl->GetOutlineLevel() )
+ //if( pColl && 0 < pColl->GetOutlineLevel() && //#outline level,zhaojianwei
+ // MAXLEVEL - 1 >= pColl->GetOutlineLevel() )
+ if( pColl &&
+ pColl->IsAssignedToListLevelOfOutlineStyle() &&
+ 0 < pColl->GetAssignedOutlineStyleLevel())
eKeyState = KS_OutlineUp;
}
}
@@ -2331,6 +2337,9 @@ KEYINPUT_CHECKTABLE_INSDEL:
case KS_NumOff:
// Shellwechsel - also vorher aufzeichnen
rSh.DelNumRules();
+ eKeyState = eNextKeyState;
+ break;
+ case KS_OutlineLvOff: // delete autofmt outlinelevel later
break;
case KS_NumDown:
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index 492e72048131..d7e4225c61c4 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -471,6 +471,14 @@ void SwTemplateDlg::PageCreated( USHORT nId, SfxTabPage &rPage )
break;
case TP_NUMPARA:
{
+ //-->#outlinelevel added by zhaojianwei
+ // handle if the current paragraph style is assigned to a list level of outline style,
+ SwTxtFmtColl* pTmpColl = pWrtShell->FindTxtFmtCollByName( GetStyleSheet().GetName() );
+ if( pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle() )
+ {
+ ((SwParagraphNumTabPage&)rPage).DisableOutline() ;
+ ((SwParagraphNumTabPage&)rPage).DisableNumbering();
+ }//<-end
ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox();
SfxStyleSheetBasePool* pPool = pWrtShell->GetView().GetDocShell()->GetStyleSheetPool();
pPool->SetSearchMask(SFX_STYLE_FAMILY_PSEUDO, SFXSTYLEBIT_ALL);
diff --git a/sw/source/ui/fmtui/tmpdlg.src b/sw/source/ui/fmtui/tmpdlg.src
index fad12491e975..d038a59ace20 100644
--- a/sw/source/ui/fmtui/tmpdlg.src
+++ b/sw/source/ui/fmtui/tmpdlg.src
@@ -105,7 +105,7 @@ TabDialog DLG_TEMPLATE_2
PageItem
{
Identifier = TP_PARA_EXT ;
- /* ### ACHTUNG: Neuer Text in Resource? Textflu : Textflu */
+ /* ### ACHTUNG: Neuer Text in Resource? Textflu?: Textflu?*/
Text [ en-US ] = "Text Flow" ;
PageResID = TP_PARA_EXT ;
};
@@ -141,7 +141,7 @@ TabDialog DLG_TEMPLATE_2
PageItem
{
Identifier = TP_NUMPARA ;
- Text [ en-US ] = "Numbering" ;
+ Text [ en-US ] = "Outline & Numbering" ;
};
PageItem
{
diff --git a/sw/source/ui/inc/app.hrc b/sw/source/ui/inc/app.hrc
index 3013fcba382d..fcca0b6ceaf7 100644
--- a/sw/source/ui/inc/app.hrc
+++ b/sw/source/ui/inc/app.hrc
@@ -169,8 +169,15 @@
#define STR_WRITER_DOCUMENT_FULLTYPE (RC_APP_BEGIN + 100)
#define STR_ABSTRACT_TITLE (RC_APP_BEGIN + 102)
#define STR_DONT_ASK_AGAIN (RC_APP_BEGIN + 103)
-
-#define APP_ACT_END STR_DONT_ASK_AGAIN
+// --> OD 2008-04-14 #outlinelevel#
+#define STR_OUTLINE_NUMBERING (RC_APP_BEGIN + 104)
+// <--
+//#outline level,zhaojianwei
+#define STR_FDLG_OUTLINE_LEVEL (RC_APP_BEGIN + 105)
+#define STR_FDLG_STYLE (RC_APP_BEGIN + 106)
+//<-end,zhaojianwei
+
+#define APP_ACT_END STR_FDLG_STYLE
#if APP_ACT_END > RC_APP_END
#error Resource-Id Ueberlauf in #file, #line
diff --git a/sw/source/ui/inc/numpara.hxx b/sw/source/ui/inc/numpara.hxx
index 246b47232424..69034bed122f 100644
--- a/sw/source/ui/inc/numpara.hxx
+++ b/sw/source/ui/inc/numpara.hxx
@@ -47,6 +47,10 @@
---------------------------------------------------------------------------*/
class SwParagraphNumTabPage : public SfxTabPage
{
+ FixedLine aOutlineStartFL;
+ FixedText aOutlineLvFT;
+ ListBox aOutlineLvLB;
+
FixedText aNumberStyleFT;
ListBox aNumberStyleLB;
@@ -61,6 +65,10 @@ class SwParagraphNumTabPage : public SfxTabPage
FixedText aRestartFT;
NumericField aRestartNF;
+ // --> OD 2008-04-14 #outlinelevel#
+ const String msOutlineNumbering;
+ // <--
+
BOOL bModified : 1;
BOOL bCurNumrule : 1;
@@ -82,9 +90,10 @@ public:
virtual void Reset( const SfxItemSet& rSet );
void EnableNewStart();
+ void DisableOutline();
+ void DisableNumbering();
ListBox& GetStyleBox() {return aNumberStyleLB;};
-
};
diff --git a/sw/source/ui/inc/swuicnttab.hxx b/sw/source/ui/inc/swuicnttab.hxx
index 2ef8bb677954..7f7ec6cbebef 100644
--- a/sw/source/ui/inc/swuicnttab.hxx
+++ b/sw/source/ui/inc/swuicnttab.hxx
@@ -163,7 +163,7 @@ class SwTOXSelectTabPage : public SfxTabPage
//content
FixedLine aCreateFromFL; // content, user, illustration
CheckBox aFromHeadingsCB;
- PushButton aChapterDlgPB;
+// PushButton aChapterDlgPB; //#outline level,removed by zhaojianwei
CheckBox aAddStylesCB;
PushButton aAddStylesPB;
//user
@@ -234,7 +234,7 @@ class SwTOXSelectTabPage : public SfxTabPage
DECL_LINK(TOXTypeHdl, ListBox* );
DECL_LINK(TOXAreaHdl, ListBox* );
- DECL_LINK(ChapterHdl, PushButton* );
+// DECL_LINK(ChapterHdl, PushButton* ); //#outline level,removed by zhaojianwei
DECL_LINK(AddStylesHdl, PushButton* );
DECL_LINK(MenuEnableHdl, Menu*);
DECL_LINK(MenuExecuteHdl, Menu*);
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 680220b96be0..9eeaa42ccaa4 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -643,12 +643,14 @@ IMPL_LINK( SwMultiTOXTabDialog, ShowPreviewHdl, CheckBox *, pBox )
sal_Bool SwMultiTOXTabDialog::IsNoNum(SwWrtShell& rSh, const String& rName)
{
SwTxtFmtColl* pColl = rSh.GetParaStyle(rName);
- if(pColl && pColl->GetOutlineLevel() == NO_NUMBERING)
+ //if(pColl && pColl->GetOutlineLevel() == NO_NUMBERING) //#outline level,zhaojianwei
+ if(pColl && ! pColl->IsAssignedToListLevelOfOutlineStyle()) //<-end,zhaojianwei
return sal_True;
sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL);
if(nId != USHRT_MAX &&
- rSh.GetTxtCollFromPool(nId)->GetOutlineLevel() == NO_NUMBERING)
+ //rSh.GetTxtCollFromPool(nId)->GetOutlineLevel() == NO_NUMBERING) //#outline level,zhaojianwei
+ ! rSh.GetTxtCollFromPool(nId)->IsAssignedToListLevelOfOutlineStyle()) //<-end,zhaojianwei
return sal_True;
return sal_False;
@@ -966,7 +968,7 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrS
aCreateFromFL( this, SW_RES(FL_CREATEFROM )),
aFromHeadingsCB( this, SW_RES(CB_FROMHEADINGS )),
- aChapterDlgPB( this, SW_RES(PB_CHAPTERDLG )),
+// aChapterDlgPB( this, SW_RES(PB_CHAPTERDLG )),//#outline level,removed by zhaojianwei
aAddStylesCB( this, SW_RES(CB_ADDSTYLES )),
aAddStylesPB( this, SW_RES(PB_ADDSTYLES )),
@@ -1043,7 +1045,7 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(Window* pParent, const SfxItemSet& rAttrS
aTypeLB.SetSelectHdl(LINK(this, SwTOXSelectTabPage, TOXTypeHdl));
aAddStylesPB.SetClickHdl(LINK(this, SwTOXSelectTabPage, AddStylesHdl));
- aChapterDlgPB.SetClickHdl(LINK(this, SwTOXSelectTabPage, ChapterHdl));
+ //aChapterDlgPB.SetClickHdl(LINK(this, SwTOXSelectTabPage, ChapterHdl));//#outline level,removed by zhaojianwei
PopupMenu* pMenu = aAutoMarkPB.GetPopupMenu();
pMenu->SetActivateHdl(LINK(this, SwTOXSelectTabPage, MenuEnableHdl));
@@ -1221,7 +1223,7 @@ void SwTOXSelectTabPage::ApplyTOXDescription()
if(TOX_CONTENT == aCurType.eType)
{
aFromHeadingsCB.Check( 0 != (nCreateType & nsSwTOXElement::TOX_OUTLINELEVEL) );
- aChapterDlgPB.Enable(aFromHeadingsCB.IsChecked());
+ //aChapterDlgPB.Enable(aFromHeadingsCB.IsChecked());//#outline level,removed by zhaojianwei
aAddStylesCB.SetText(sAddStyleContent);
aAddStylesPB.Enable(aAddStylesCB.IsChecked());
}
@@ -1485,7 +1487,7 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox)
aAreaFL.Show( 0 != (nType & (TO_CONTENT|TO_ILLUSTRATION|TO_USER|TO_INDEX|TO_TABLE|TO_OBJECT)) );
aFromHeadingsCB.Show( 0 != (nType & (TO_CONTENT)) );
- aChapterDlgPB.Show( 0 != (nType & (TO_CONTENT)) );
+ // aChapterDlgPB.Show( 0 != (nType & (TO_CONTENT)) );//#outline level,removed by zhaojianwei
aAddStylesCB.Show( 0 != (nType & (TO_CONTENT|TO_USER)) );
aAddStylesPB.Show( 0 != (nType & (TO_CONTENT|TO_USER)) );
@@ -1517,13 +1519,14 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox)
aSortAlgorithmFT.Show(bEnableSortLanguage);
aSortAlgorithmLB.Show(bEnableSortLanguage);
- if(nType & TO_CONTENT)
- {
- Point aPos(aAddStylesPB.GetPosPixel());
- aPos.X() = aChapterDlgPB.GetPosPixel().X();
- aAddStylesPB.SetPosPixel(aPos);
- }
- else if( nType & TO_ILLUSTRATION )
+ //if(nType & TO_CONTENT) //#outline level,removed by zhaojianwei
+ //{
+ //Point aPos(aAddStylesPB.GetPosPixel());
+ //aPos.X() = aChapterDlgPB.GetPosPixel().X();
+ //aAddStylesPB.SetPosPixel(aPos);
+ //}
+ //else if( nType & TO_ILLUSTRATION )//<-removed end.
+ if( nType & TO_ILLUSTRATION ) //add by zhaojianwei
aCaptionSequenceLB.SelectEntry( SwStyleNameMapper::GetUIName(
RES_POOLCOLL_LABEL_ABB, aEmptyStr ));
else if( nType & TO_TABLE )
@@ -1534,7 +1537,7 @@ IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, ListBox*, pBox)
aAddStylesCB.SetText(sAddStyleUser);
// move left!
Point aPos(aAddStylesPB.GetPosPixel());
- aPos.X() = aChapterDlgPB.GetPosPixel().X();
+ // aPos.X() = aChapterDlgPB.GetPosPixel().X();
aPos.X() -= 2 * aAddStylesPB.GetSizePixel().Width();
aAddStylesPB.SetPosPixel(aPos);
}
@@ -1598,7 +1601,7 @@ IMPL_LINK(SwTOXSelectTabPage, CheckBoxHdl, CheckBox*, pBox )
pBox->Check(sal_True);
}
aAddStylesPB.Enable(aAddStylesCB.IsChecked());
- aChapterDlgPB.Enable(aFromHeadingsCB.IsChecked());
+ //aChapterDlgPB.Enable(aFromHeadingsCB.IsChecked());//#outline level,removed by zhaojianwei
}
if(TOX_USER == aCurType.eType)
{
@@ -1681,42 +1684,45 @@ IMPL_LINK(SwTOXSelectTabPage, TOXAreaHdl, ListBox*, pBox)
}
return 0;
}
-/* -----------------14.06.99 13:10-------------------
-
- --------------------------------------------------*/
-IMPL_LINK(SwTOXSelectTabPage, ChapterHdl, PushButton*, pButton)
-{
- SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog();
- SwWrtShell& rSh = pTOXDlg->GetWrtShell();
-
- SfxItemSet aTmp(rSh.GetView().GetPool(), FN_PARAM_1, FN_PARAM_1);
- SwOutlineTabDialog* pDlg = new SwOutlineTabDialog(pButton, &aTmp, rSh);
- if(RET_OK == pDlg->Execute())
- {
- CurTOXType aCurType = pTOXDlg->GetCurrentTOXType();
- SwForm* pForm = ((SwMultiTOXTabDialog*)GetTabDialog())->GetForm(aCurType);
- // jetzt muss ueberprueft werden, ob dem sdbcx::Index Ueberschriftenvorlagen
- // zugewiesen wurden
- String sStr;
- for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
- {
- sal_Bool bNum = !SwMultiTOXTabDialog::IsNoNum(rSh, pForm->GetTemplate( i + 1 ));
- if(bNum)
- {
- //es gibt getrennte Resourcebereiche fuer die Inhaltsverzeichnisse
- if(i < 5)
- SwStyleNameMapper::FillUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_TOX_CNTNT1 + i), sStr );
- else
- SwStyleNameMapper::FillUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_TOX_CNTNT6 + i - 5), sStr );
- pForm->SetTemplate( i + 1, sStr );
- }
- }
-
- }
- delete pDlg;
- return 0;
-}
+//#outline level, removed by zhaojianwei
+//It is no longer used!
+///* -----------------14.06.99 13:10-------------------
+//
+// --------------------------------------------------*/
+//IMPL_LINK(SwTOXSelectTabPage, ChapterHdl, PushButton*, pButton)
+//{
+// SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog();
+// SwWrtShell& rSh = pTOXDlg->GetWrtShell();
+//
+// SfxItemSet aTmp(rSh.GetView().GetPool(), FN_PARAM_1, FN_PARAM_1);
+// SwOutlineTabDialog* pDlg = new SwOutlineTabDialog(pButton, &aTmp, rSh);
+//
+// if(RET_OK == pDlg->Execute())
+// {
+// CurTOXType aCurType = pTOXDlg->GetCurrentTOXType();
+// SwForm* pForm = ((SwMultiTOXTabDialog*)GetTabDialog())->GetForm(aCurType);
+// // jetzt muss ueberprueft werden, ob dem sdbcx::Index Ueberschriftenvorlagen
+// // zugewiesen wurden
+// String sStr;
+// for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
+// {
+// sal_Bool bNum = !SwMultiTOXTabDialog::IsNoNum(rSh, pForm->GetTemplate( i + 1 ));
+// if(bNum)
+// {
+// //es gibt getrennte Resourcebereiche fuer die Inhaltsverzeichnisse
+// if(i < 5)
+// SwStyleNameMapper::FillUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_TOX_CNTNT1 + i), sStr );
+// else
+// SwStyleNameMapper::FillUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_TOX_CNTNT6 + i - 5), sStr );
+// pForm->SetTemplate( i + 1, sStr );
+// }
+// }
+//
+// }
+// delete pDlg;
+// return 0;
+//}
/* -----------------14.06.99 13:10-------------------
--------------------------------------------------*/
diff --git a/sw/source/ui/index/cnttab.src b/sw/source/ui/index/cnttab.src
index f921ad182daf..1bccc6c27765 100644
--- a/sw/source/ui/index/cnttab.src
+++ b/sw/source/ui/index/cnttab.src
@@ -226,13 +226,15 @@ TabPage TP_TOX_SELECT
Check = TRUE;
Text [ en-US ] = "Outline";
};
- PushButton PB_CHAPTERDLG
+// #outline level,removed by zhaojianwei
+/* PushButton PB_CHAPTERDLG
{
Pos = MAP_APPFONT ( 115 , 98 ) ;
Size = MAP_APPFONT ( 12 , 12 ) ;
Text = "~..." ;
TabStop = TRUE ;
};
+*/
CheckBox CB_ADDSTYLES
{
Pos = MAP_APPFONT ( 12 , 115 ) ;
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index b7892834f48b..57d652463a95 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -87,6 +87,9 @@
#include <unomid.h>
#include <IDocumentOutlineNodes.hxx>
+// --> OD 2008-04-14 #outlinelevel#
+#include <app.hrc>
+// <--
using namespace ::com::sun::star;
@@ -234,6 +237,9 @@ SwOutlineTabDialog::SwOutlineTabDialog(Window* pParent,
pChapterNumRules(SW_MOD()->GetChapterNumRules()),
bModified(rWrtSh.IsModified())
{
+ // --> OD 2008-04-14 #outlinelevel#
+ SetText( SW_RES( STR_OUTLINE_NUMBERING ) );
+ // <--
PushButton* pUserButton = GetUserButton();
pUserButton->SetText(SW_RES(ST_FORM));
pUserButton->SetHelpId(HID_OUTLINE_FORM);
@@ -265,9 +271,15 @@ SwOutlineTabDialog::SwOutlineTabDialog(Window* pParent,
SwTxtFmtColl &rTxtColl = rWrtSh.GetTxtFmtColl(i);
if(!rTxtColl.IsDefault())
{
- BYTE nOutLevel = rTxtColl.GetOutlineLevel();
- if(nOutLevel != NO_NUMBERING)
+ //BYTE nOutLevel = rTxtColl.GetOutlineLevel(); //<-#outline level, removed out by zhaojianwei
+ //if(nOutLevel != NO_NUMBERING)
+ //->added by zhaojianwei
+ if(rTxtColl.IsAssignedToListLevelOfOutlineStyle())
+ {
+ int nOutLevel = rTxtColl.GetAssignedOutlineStyleLevel();
aCollNames[ nOutLevel ] = rTxtColl.GetName();
+ }
+ //<-end
}
}
}
@@ -396,7 +408,8 @@ USHORT SwOutlineTabDialog::GetLevel(const String &rFmtName) const
if(aCollNames[i] == rFmtName)
return i;
}
- return NO_NUMBERING;
+ return MAXLEVEL;//NO_NUMBERING; //#outline level,zhaojianwei
+
}
/* -----------------07.07.98 16:30-------------------
*
@@ -422,13 +435,34 @@ short SwOutlineTabDialog::Ok()
SwTxtFmtColl &rTxtColl = rWrtSh.GetTxtFmtColl(i);
if( !rTxtColl.IsDefault() )
{
- rTxtColl.SetOutlineLevel( (BYTE)GetLevel(rTxtColl.GetName()));
+ //rTxtColl.SetOutlineLevel( (BYTE)GetLevel(rTxtColl.GetName()));//#outline level,removed by zhaojianwei
const SfxPoolItem & rItem =
rTxtColl.GetFmtAttr(RES_PARATR_NUMRULE, FALSE);
- if ((BYTE)GetLevel(rTxtColl.GetName()) == NO_NUMBERING)
+ //if ((BYTE)GetLevel(rTxtColl.GetName()) == NO_NUMBERING) //#outline level,removed by zhaojianwei
+ //{
+ // if (static_cast<const SwNumRuleItem &>(rItem).GetValue() ==
+ // pOutlineRule->GetName())
+ // {
+ // rTxtColl.ResetFmtAttr(RES_PARATR_NUMRULE);
+ // }
+ //}
+ //else
+ //{
+ // if (static_cast<const SwNumRuleItem &>(rItem).GetValue() !=
+ // pOutlineRule->GetName())
+ // {
+ // SwNumRuleItem aItem(pOutlineRule->GetName());
+ // rTxtColl.SetFmtAttr(aItem);
+ // }
+ //}
+ if ((BYTE)GetLevel(rTxtColl.GetName()) == MAXLEVEL) //add by zhaojianwei
{
+ if(rTxtColl.IsAssignedToListLevelOfOutlineStyle())
+ {
+ rTxtColl.DeleteAssignmentToListLevelOfOutlineStyle();
+ }
if (static_cast<const SwNumRuleItem &>(rItem).GetValue() ==
pOutlineRule->GetName())
{
@@ -437,13 +471,15 @@ short SwOutlineTabDialog::Ok()
}
else
{
+ rTxtColl.AssignToListLevelOfOutlineStyle(GetLevel(rTxtColl.GetName()));
+
if (static_cast<const SwNumRuleItem &>(rItem).GetValue() !=
pOutlineRule->GetName())
{
SwNumRuleItem aItem(pOutlineRule->GetName());
rTxtColl.SetFmtAttr(aItem);
}
- }
+ } //<-end,zhaojianwei
}
}
@@ -455,27 +491,74 @@ short SwOutlineTabDialog::Ok()
SwTxtFmtColl* pColl = rWrtSh.FindTxtFmtCollByName( sHeadline );
if( !pColl )
{
- if( !aCollNames[i].Len() )
+ //if( !aCollNames[i].Len() ) //#outline level,removed by zhaojianwei
+ //{
+ // SwTxtFmtColl* pTxtColl = rWrtSh.GetTxtCollFromPool(
+ // static_cast< USHORT >(RES_POOLCOLL_HEADLINE1 + i) );
+ // pTxtColl->SetOutlineLevel( NO_NUMBERING );
+ // pTxtColl->ResetFmtAttr(RES_PARATR_NUMRULE);
+ //}
+ //else if(aCollNames[i] != sHeadline)
+ //{
+ // SwTxtFmtColl* pTxtColl = rWrtSh.GetParaStyle(
+ // aCollNames[i], SwWrtShell::GETSTYLE_CREATESOME);
+ // if(pTxtColl)
+ // {
+ // pTxtColl->SetOutlineLevel( static_cast< BYTE >(i) );
+
+ // SwNumRuleItem aItem(pOutlineRule->GetName());
+ // pTxtColl->SetFmtAttr(aItem);
+ // }
+ //}
+ if(aCollNames[i] != sHeadline)//->added by zhaojianwei
{
SwTxtFmtColl* pTxtColl = rWrtSh.GetTxtCollFromPool(
- static_cast< USHORT >(RES_POOLCOLL_HEADLINE1 + i) );
- pTxtColl->SetOutlineLevel( NO_NUMBERING );
+ static_cast< USHORT >(RES_POOLCOLL_HEADLINE1 + i) );
+ pTxtColl->DeleteAssignmentToListLevelOfOutlineStyle();
pTxtColl->ResetFmtAttr(RES_PARATR_NUMRULE);
- }
- else if(aCollNames[i] != sHeadline)
- {
- SwTxtFmtColl* pTxtColl = rWrtSh.GetParaStyle(
- aCollNames[i], SwWrtShell::GETSTYLE_CREATESOME);
- if(pTxtColl)
+
+ if( aCollNames[i].Len() )
{
- pTxtColl->SetOutlineLevel( static_cast< BYTE >(i) );
+ pTxtColl = rWrtSh.GetParaStyle(
+ aCollNames[i], SwWrtShell::GETSTYLE_CREATESOME);
+ if(pTxtColl)
+ {
+ pTxtColl->AssignToListLevelOfOutlineStyle(i);
+ SwNumRuleItem aItem(pOutlineRule->GetName());
+ pTxtColl->SetFmtAttr(aItem);
+ }
+ }
+ }//<--end,zhaojianwei
+ }
+ }
- SwNumRuleItem aItem(pOutlineRule->GetName());
- pTxtColl->SetFmtAttr(aItem);
+ //#outline level,add by zhaojianwei
+ /* When a paragraph style is assigned to a list level of the outline style,
+ the outline level attribute and the list style attribute of its existing
+ child paragraph styles have to be set to 0 respectively "".*/
+ nCount = rWrtSh.GetTxtFmtCollCount();
+ for( i = 0; i < nCount; ++i )
+ {
+ SwTxtFmtColl &rTxtColl = rWrtSh.GetTxtFmtColl(i);
+ if( !rTxtColl.IsDefault() )
+ {
+ SwTxtFmtColl *pDerFrom = ( SwTxtFmtColl* )rTxtColl.DerivedFrom();
+ if( pDerFrom->IsAssignedToListLevelOfOutlineStyle())
+ {
+ if(rTxtColl.GetItemState( RES_PARATR_NUMRULE, FALSE ) == SFX_ITEM_DEFAULT )
+ {
+ SwNumRuleItem aItem(aEmptyStr);
+ rTxtColl.SetFmtAttr( aItem );
+ }
+ if(rTxtColl.GetItemState( RES_PARATR_OUTLINELEVEL, FALSE ) == SFX_ITEM_DEFAULT )
+ {
+ int nOutlineLevel = 0;;
+ rTxtColl.SetAttrOutlineLevel( nOutlineLevel );
}
}
}
}
+ //<-end,zhaojianwei
rWrtSh.SetOutlineNumRule( *pNumRule);
@@ -910,7 +993,7 @@ void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell)
{
nTmp = static_cast<USHORT>(pSh->getIDocumentOutlineNodesAccess()->getOutlineLevel(nOutlinePos));
}
- aLevelLB.SelectEntryPos(nTmp);
+ aLevelLB.SelectEntryPos(nTmp-1);//nTmp);//#outline level,zhaojianwei
// Zeichenvorlagen sammeln
aCharFmtLB.Clear();
diff --git a/sw/source/ui/misc/outline.src b/sw/source/ui/misc/outline.src
index 574de4bb7dac..5857e3a10fec 100644
--- a/sw/source/ui/misc/outline.src
+++ b/sw/source/ui/misc/outline.src
@@ -104,7 +104,10 @@ TabDialog DLG_TAB_OUTLINE
{
OutputSize = TRUE ;
SVLook = TRUE ;
- Text [ en-US ] = "Outline Numbering" ;
+ // --> OD 2008-04-14 #outlinelevel#
+ // dialog title is now given by resource STR_OUTLINE_NUMBERING
+// Text [ en-US ] = "Outline Numbering" ;
+ // <--
Moveable = TRUE ;
TabControl 1
{
diff --git a/sw/source/ui/uiview/view.hrc b/sw/source/ui/uiview/view.hrc
index dabfedc3466a..f3061d2e1b3f 100644
--- a/sw/source/ui/uiview/view.hrc
+++ b/sw/source/ui/uiview/view.hrc
@@ -42,6 +42,7 @@
#define STR_NOGLOS1 (RC_VIEW_BEGIN + 1)
#define STR_NOGLOS2 (RC_VIEW_BEGIN + 2)
#define STR_NUM_LEVEL (RC_VIEW_BEGIN + 3)
+#define STR_NUM_OUTLINE (RC_VIEW_BEGIN + 4)
#define STR_ERROR_NOLANG (RC_VIEW_BEGIN + 6)
diff --git a/sw/source/ui/uiview/view.src b/sw/source/ui/uiview/view.src
index b3c4cf968e94..47ffd8817777 100644
--- a/sw/source/ui/uiview/view.src
+++ b/sw/source/ui/uiview/view.src
@@ -152,6 +152,12 @@ String STR_NUM_LEVEL
{
Text [ en-US ] = "Level " ;
};
+//#outline level,zhaojianwei
+String STR_NUM_OUTLINE
+{
+ Text [ en-US ] = "Outline ";
+};//<-end,zhaojianwei
+// <--
String STR_ERROR_NOLANG
{
Text [ en-US ] = "No language is selected in the proofed section." ;
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index be87729e2296..2932b54a6d02 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -152,6 +152,8 @@
// #include <frmmgr.hxx>
// #endif
+#include <ndtxt.hxx> //#outline level,added by zhaojianwei
+
#include <comphelper/processfactory.hxx>
#include <svx/svxdlg.hxx>
@@ -168,6 +170,7 @@
static String sLstPg;
static USHORT nPageCnt = 0;
const char __FAR_DATA sStatusDelim[] = " : ";
+const char __FAR_DATA sStatusComma[] = " , ";//#outlinelevel, define a Variable for "," add by zhaojianwei
using ::rtl::OUString;
using namespace sfx2;
@@ -1410,8 +1413,51 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
}
}
}
+
+ //#outline level, removed by zhaojianwei
+ //const SwNumRule* pNumRule = rShell.GetCurNumRule();
+ //if (pNumRule) // Cursor in Numerierung
+ //{
+ // BYTE nNumLevel = rShell.GetNumLevel();
+ // if( IsShowNum(nNumLevel) && MAXLEVEL >
+ // ( nNumLevel = GetRealLevel( nNumLevel )) )
+ // {
+ // if( sStr.Len() )
+ // sStr.AppendAscii(sStatusDelim);
+ // sStr += SW_RESSTR(STR_NUM_LEVEL);
+ // sStr += String::CreateFromInt32( nNumLevel + 1 );
+ // if(!pNumRule->IsAutoRule())
+ // {
+ // SfxItemSet aSet(GetPool(),
+ // RES_PARATR_NUMRULE, RES_PARATR_NUMRULE);
+ // rShell.GetCurAttr(aSet);
+ // /* const SfxPoolItem* pItem; */
+ // if(SFX_ITEM_AVAILABLE <=
+ // aSet.GetItemState(RES_PARATR_NUMRULE, TRUE
+ // /*, &pItem */ ))
+ // {
+ // const String& rNumStyle =
+ // ((const SfxStringItem &)
+ // aSet.Get(RES_PARATR_NUMRULE)).GetValue();
+ // /* #i5116# GetItemState does not necessarily
+ // change pItem */
+ // // ((const SfxStringItem*)pItem)->GetValue();
+ // if(rNumStyle.Len())
+ // {
+ // sStr.AppendAscii(sStatusDelim);
+ // sStr += rNumStyle;
+ // }
+ // }
+ // }
+ // }
+ //}//<-removed end ,zhaojianwei
+
+ //-->#outline level,added by zhaojianwei
const SwNumRule* pNumRule = rShell.GetCurNumRule();
- if (pNumRule) // Cursor in Numerierung
+ const bool bOutlineNum = pNumRule ? pNumRule->IsOutlineRule() : 0;
+ //((SwTxtFmtColl*)rShell.GetCrsr()->GetNode()->GetTxtNode()->GetFmtColl())->IsAssignedToListLevelOfOutlineStyle();
+
+ if (pNumRule && !bOutlineNum ) // Cursor in Numerierung
{
BYTE nNumLevel = rShell.GetNumLevel();
// --> OD 2008-04-02 #refactorlists#
@@ -1420,10 +1466,6 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
if ( nNumLevel < MAXLEVEL )
// <--
{
- if( sStr.Len() )
- sStr.AppendAscii(sStatusDelim);
- sStr += SW_RESSTR(STR_NUM_LEVEL);
- sStr += String::CreateFromInt32( nNumLevel + 1 );
if(!pNumRule->IsAutoRule())
{
SfxItemSet aSet(GetPool(),
@@ -1442,13 +1484,35 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
// ((const SfxStringItem*)pItem)->GetValue();
if(rNumStyle.Len())
{
- sStr.AppendAscii(sStatusDelim);
+ if( sStr.Len() )
+ sStr.AppendAscii(sStatusDelim);
sStr += rNumStyle;
}
}
}
+ if( sStr.Len() )
+ sStr.AppendAscii(sStatusDelim);
+ sStr += SW_RESSTR(STR_NUM_LEVEL);
+ sStr += String::CreateFromInt32( nNumLevel + 1 );
+
}
}
+ const int nOutlineLevel = rShell.GetCurrentParaOutlineLevel();
+ if( nOutlineLevel != 0 )
+ {
+ if( sStr.Len() )
+ sStr.AppendAscii(sStatusComma);
+ if( bOutlineNum )
+ {
+ sStr += SW_RESSTR(STR_OUTLINE_NUMBERING);
+ sStr.AppendAscii(sStatusDelim);
+ sStr += SW_RESSTR(STR_NUM_LEVEL);
+ }
+ else
+ sStr += SW_RESSTR(STR_NUM_OUTLINE);
+ sStr += String::CreateFromInt32( nOutlineLevel);
+ }
+ //<-end ,zhaojianwei
if( rShell.HasReadonlySel() )
{
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 5d10463062f9..a98e8ade9824 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -664,7 +664,6 @@ void SwWrtShell::LaunchOLEObj( long nVerb )
}
}
-
void SwWrtShell::MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset )
{
try
@@ -1087,7 +1086,7 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
// no numbering rule can be retrieved from the paragraph style.
bool bContinueFoundNumRule( false );
bool bActivateOutlineRule( false );
- sal_uInt8 nActivateOutlineLvl( MAXLEVEL ); // only relevant, if <bActivateOutlineRule> == TRUE
+ int nActivateOutlineLvl( MAXLEVEL ); // only relevant, if <bActivateOutlineRule> == TRUE
SwTxtFmtColl * pColl = GetCurTxtFmtColl();
if ( pColl )
{
@@ -1142,11 +1141,14 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
{
// check, if numbering of the outline level of the pararaph
// style is active. If not, activate this outline level.
- nActivateOutlineLvl = pColl->GetOutlineLevel();
- ASSERT( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL,
+ //nActivateOutlineLvl = pColl->GetOutlineLevel(); //#outline level,zhaojianwei
+ //ASSERT( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL,
+ nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
+ ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(), //<-end,zhaojianwei
"<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
- if ( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL &&
- pCollRule->Get( nActivateOutlineLvl ).GetNumberingType()
+ //if ( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL && //#outline level,zhaojianwei
+ if ( pColl->IsAssignedToListLevelOfOutlineStyle() && //<-end,zhaojianwei
+ pCollRule->Get( static_cast<USHORT>(nActivateOutlineLvl) ).GetNumberingType()
== SVX_NUM_NUMBER_NONE )
{
// activate outline numbering
@@ -1163,7 +1165,8 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
// activate outline numbering, because from the precondition
// it's known, that <SwEdit::HasNumber()> == FALSE
bActivateOutlineRule = true;
- nActivateOutlineLvl = pColl->GetOutlineLevel();
+ //nActivateOutlineLvl = pColl->GetOutlineLevel(); //#outline level,zhaojianwei
+ nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei
}
}
else if ( !pNumRule )
@@ -1171,17 +1174,21 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
// activate outline numbering, because from the precondition
// it's known, that <SwEdit::HasNumber()> == FALSE
bActivateOutlineRule = true;
- nActivateOutlineLvl = pColl->GetOutlineLevel();
+ //nActivateOutlineLvl = pColl->GetOutlineLevel(); //#outline level,zhaojianwei
+ nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei,need further consideration
}
else
{
// check, if numbering of the outline level of the pararaph
// style is active. If not, activate this outline level.
- nActivateOutlineLvl = pColl->GetOutlineLevel();
- ASSERT( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL,
+ //nActivateOutlineLvl = pColl->GetOutlineLevel();
+ nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//#outline level,zhaojianwei
+ //ASSERT( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL,
+ ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(),//#outline level,zhaojianwei
"<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
- if ( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL &&
- pCollRule->Get( nActivateOutlineLvl ).GetNumberingType()
+ //if ( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL &&
+ if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&//#outline level,zhaojianwei
+ pCollRule->Get( static_cast<USHORT>(nActivateOutlineLvl) ).GetNumberingType()
== SVX_NUM_NUMBER_NONE )
{
// activate outline numbering
@@ -1242,9 +1249,9 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
{
// --> OD 2005-10-26 #b6340308# - use above retrieve outline
// level, if outline numbering has to be activated.
- sal_Int8 nLevel = bActivateOutlineRule
- ? nActivateOutlineLvl
- : sal::static_int_cast<sal_Int8, sal_Int32>(pTxtNode->GetActualListLevel());
+ int nLevel = bActivateOutlineRule ////#outline level,zhaojianwei,need more consideration
+ ? nActivateOutlineLvl
+ : pTxtNode->GetActualListLevel();
// <--
if (nLevel < 0)
@@ -1253,7 +1260,7 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
if (nLevel >= MAXLEVEL)
nLevel = MAXLEVEL - 1;
- SwNumFmt aFmt(aNumRule.Get(nLevel));
+ SwNumFmt aFmt(aNumRule.Get(static_cast<USHORT>(nLevel)));
if (bNum)
aFmt.SetNumberingType(SVX_NUM_ARABIC);
@@ -1267,10 +1274,10 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
aFmt.SetBulletFont( pFnt );
}
// <--
- aFmt.SetBulletChar( numfunc::GetBulletChar(nLevel));
+ aFmt.SetBulletChar( numfunc::GetBulletChar(static_cast<BYTE>(nLevel)));
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
}
- aNumRule.Set(nLevel, aFmt);
+ aNumRule.Set(static_cast<USHORT>(nLevel), aFmt);
}
}
// <--