summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/doc.hxx11
-rw-r--r--sw/inc/ndtxt.hxx12
-rw-r--r--sw/inc/numrule.hxx12
-rw-r--r--sw/source/core/doc/doc.cxx24
-rw-r--r--sw/source/core/doc/docnum.cxx323
-rw-r--r--sw/source/core/doc/number.cxx18
-rw-r--r--sw/source/core/docnode/ndnum.cxx51
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx18
-rw-r--r--sw/source/filter/xml/DocSettingNames.hxx26
-rw-r--r--sw/source/filter/xml/makefile.mk15
-rw-r--r--sw/source/filter/xml/xmlimp.cxx202
11 files changed, 501 insertions, 211 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 691c60629a2e..5b4b2f68bf38 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: doc.hxx,v $
*
- * $Revision: 1.48 $
+ * $Revision: 1.49 $
*
- * last change: $Author: obo $ $Date: 2003-09-01 12:35:40 $
+ * last change: $Author: hbrinkm $ $Date: 2003-09-05 15:13:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -472,6 +472,8 @@ class SwDoc
sal_Bool bPurgeOLE : 1; // TRUE: Purge OLE-Objects
sal_Bool bKernAsianPunctuation : 1; // TRUE: kerning also for ASIAN punctuation
sal_Bool bReadlineChecked : 1; // TRUE: if the query was already shown
+ sal_Bool bOldNumbering : 1; // #111955# TRUE: use old numbering
+
#ifndef PRODUCT
sal_Bool bXMLExport : 1; // TRUE: during XML export
#endif
@@ -1484,6 +1486,11 @@ public:
String GetUniqueNumRuleName( const String* pChkStr = 0, sal_Bool bAutoNum = sal_True ) const;
void UpdateNumRule( const String& rName, sal_uInt32 nUpdPos );
void UpdateNumRule(); // alle invaliden Updaten
+ /* -> #111955# */
+ void UpdateNumRule( const SwNumRule & rRule, ULONG nUpdatePos,
+ BOOL bOutline = FALSE);
+ void UpdateNumRuleOld( const SwNumRule & rRule, ULONG nUpdatePos);
+ /* <- #111955# */
void ChgNumRuleFmts( const SwNumRule& rRule );
sal_Bool ReplaceNumRule( const SwPosition& rPos, const String& rOldRule,
const String& rNewRule );
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index ee37ed10dc2c..5db0476470c5 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ndtxt.hxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: hr $ $Date: 2003-07-16 18:08:14 $
+ * last change: $Author: hbrinkm $ $Date: 2003-09-05 15:13:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -277,10 +277,14 @@ public:
// Numerierung
const SwNodeNum* UpdateNum( const SwNodeNum& );
const SwNumRule *GetNumRule() const;
- const SwNodeNum* GetNum() const { return pNdNum; }
+ // #111955#
+ const SwNodeNum* GetNum(BOOL bOutline = FALSE) const
+ { return bOutline ? pNdOutl : pNdNum; }
// OutlineNumerierung
const SwNodeNum* UpdateOutlineNum( const SwNodeNum& );
- const SwNodeNum* GetOutlineNum() const { return pNdOutl; }
+ // #111955#
+ const SwNodeNum* GetOutlineNum() const { return GetNum(TRUE); }
+ BOOL IsOutlineNum() const;
void NumRuleChgd(); // Frames benachrichtigen
XubString GetNumString() const; // returnt Outline oder Num - String
long GetLeftMarginWithNum( BOOL bTxtLeft = FALSE ) const;
diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx
index befda665fb24..2a9010d0c2e7 100644
--- a/sw/inc/numrule.hxx
+++ b/sw/inc/numrule.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: numrule.hxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: vg $ $Date: 2003-06-10 13:16:59 $
+ * last change: $Author: hbrinkm $ $Date: 2003-09-05 15:13:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -252,6 +252,8 @@ class SwNodeNum
USHORT nSetValue; // vorgegeben Nummer
BYTE nMyLevel; // akt. Level
BOOL bStartNum; // Numerierung neu starten
+ BOOL bContNum; // #111955#
+ // TRUE -> in continuous numbering
public:
inline SwNodeNum( BYTE nLevel = NO_NUM, USHORT nSetVal = USHRT_MAX );
@@ -265,6 +267,12 @@ public:
BOOL IsStart() const { return bStartNum; }
void SetStart( BOOL bFlag = TRUE ) { bStartNum = bFlag; }
+ // -> #111955#
+ BOOL IsContinuousNum() const { return bContNum; }
+ void SetContinuousNum( BOOL bFlag = TRUE ) { bContNum = bFlag; }
+ // <- #111955#
+
+ BOOL HasSetValue() const { return USHRT_MAX != nSetValue; }
USHORT GetSetValue() const { return nSetValue; }
void SetSetValue( USHORT nVal ) { nSetValue = nVal; }
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index c1100cabd152..94c55f67569b 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: doc.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: obo $ $Date: 2003-09-01 12:36:24 $
+ * last change: $Author: hbrinkm $ $Date: 2003-09-05 15:11:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1236,5 +1236,25 @@ void SwDoc::AppendUndoForInsertFromDB( const SwPaM& rPam, BOOL bIsTable )
}
}
+// #111955#
+void SwDoc::SetOldNumbering(sal_Bool _bOldNumbering)
+{
+ if (bOldNumbering != _bOldNumbering)
+ {
+ bOldNumbering = _bOldNumbering;
+ SwNumRuleTbl& rNmTbl = GetNumRuleTbl();
+ for( USHORT n = 0; n < rNmTbl.Count(); ++n )
+ rNmTbl[n]->SetInvalidRule(TRUE);
+ UpdateNumRule();
+
+ if (bOldNumbering)
+ GetNodes().UpdateOutlineNodes();
+ else
+ {
+ if (pOutlineRule)
+ UpdateNumRule(*pOutlineRule, 0, TRUE);
+ }
+ }
+}
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 00aa246c9881..1f6c95dcc246 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docnum.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: obo $ $Date: 2003-09-04 11:46:01 $
+ * last change: $Author: hbrinkm $ $Date: 2003-09-05 15:11:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -804,20 +804,44 @@ void SwDoc::SetOutlineLSpace( BYTE nLevel, short nFirstLnOfst, USHORT nLSpace )
void SwNumRuleInfo::MakeList( SwDoc& rDoc )
{
- SwModify* pMod;
- const SfxPoolItem* pItem;
- USHORT i, nMaxItems = rDoc.GetAttrPool().GetItemCount( RES_PARATR_NUMRULE);
- for( i = 0; i < nMaxItems; ++i )
- if( 0 != (pItem = rDoc.GetAttrPool().GetItem( RES_PARATR_NUMRULE, i ) ) &&
- 0 != ( pMod = (SwModify*)((SwNumRuleItem*)pItem)->GetDefinedIn()) &&
- ((SwNumRuleItem*)pItem)->GetValue().Len() &&
- ((SwNumRuleItem*)pItem)->GetValue() == rName )
+ // -> #111955#
+ if (bOutline)
+ {
+ const SwOutlineNodes & rOutlineNodes = rDoc.GetNodes().GetOutLineNds();
+
+ for (int i = 0; i < rOutlineNodes.Count(); i++)
+ {
+ SwTxtNode & aNode = *((SwTxtNode *) rOutlineNodes[i]);
+
+ if (aNode.IsOutlineNum())
+ AddNode(aNode);
+ }
+ }
+ // <- #111955#
+ else
+ {
+ SwModify* pMod;
+ const SfxPoolItem* pItem;
+ USHORT i, nMaxItems = rDoc.GetAttrPool().GetItemCount
+ ( RES_PARATR_NUMRULE);
+ for( i = 0; i < nMaxItems; ++i )
{
- if( pMod->IsA( TYPE( SwFmt )) )
- pMod->GetInfo( *this );
- else if( ((SwTxtNode*)pMod)->GetNodes().IsDocNodes() )
- AddNode( *(SwTxtNode*)pMod );
+ pItem = rDoc.GetAttrPool().GetItem( RES_PARATR_NUMRULE, i );
+ if( 0 != pItem)
+ {
+ pMod = (SwModify*)((SwNumRuleItem*)pItem)->GetDefinedIn();
+ if (0 != pMod &&
+ ((SwNumRuleItem*)pItem)->GetValue().Len() &&
+ ((SwNumRuleItem*)pItem)->GetValue() == rName )
+ {
+ if( pMod->IsA( TYPE( SwFmt )) )
+ pMod->GetInfo( *this );
+ else if( ((SwTxtNode*)pMod)->GetNodes().IsDocNodes() )
+ AddNode( *(SwTxtNode*)pMod );
+ }
+ }
}
+ }
}
@@ -2187,11 +2211,271 @@ void SwDoc::UpdateNumRule()
for( USHORT n = 0; n < rNmTbl.Count(); ++n )
if( rNmTbl[ n ]->IsInvalidRule() )
UpdateNumRule( rNmTbl[ n ]->GetName(), ULONG_MAX );
+
+
}
-void SwDoc::UpdateNumRule( const String& rName, ULONG nUpdPos )
+// -> #111955#
+/**
+ Reset numbering to start values.
+
+ @param rNum the numbering to reset
+ @param rNumRule the numbering rule to take the start values
+ from
+ @param nStartLevel the level to start
+ @param bInitializedLevels array to mark reset levels in
+
+ All values in rNum that have a level >= nStartLevel are set to
+ their start level. The start level is looked up in rNumRule. For
+ all levels >= nStartLevel the accroding entry in bInitializedLevels
+ is set to true.
+*/
+void lcl_NodeNumReset(SwNodeNum & rNum, const SwNumRule & rNumRule,
+ int nStartLevel, bool * bInitializedLevels)
{
- SwNumRuleInfo aUpd( rName );
+ for (int i = nStartLevel; i < MAXLEVEL; i++)
+ {
+ rNum.GetLevelVal()[i] = rNumRule.Get(i).GetStart();
+ bInitializedLevels[i] = true;
+ }
+}
+
+/**
+ Update numbering for all nodes that have a certain numbering rule.
+
+ @param rName name of the numbering rule to search for
+ @param nUpdatePos document position to start at
+ */
+void SwDoc::UpdateNumRule( const String& rName, ULONG nUpdatePos )
+{
+ SwNumRule * pRule = FindNumRulePtr(rName);
+ ASSERT(pRule, "numrule not found");
+ if (pRule == NULL)
+ return;
+
+ UpdateNumRule(*pRule, nUpdatePos);
+}
+
+/**
+ Update numbering for all nodes that have a certain numbering rule.
+
+ @param rRule numbering rule to search for
+ @param nUpdatePos document position to start at
+ @param bOutline TRUE: update outline numbering
+ FALSE: update normal numbering
+ */
+void SwDoc::UpdateNumRule( const SwNumRule & rRule, ULONG nUpdatePos,
+ BOOL bOutline)
+{
+ /* If old numbering is activated use the old algorithm. */
+ if (IsOldNumbering())
+ {
+ UpdateNumRuleOld(rRule, nUpdatePos);
+
+ return;
+ }
+
+ /* Get all paragraphs with the given numbering rule from the
+ document. */
+ SwNumRuleInfo aNumRuleInfo(rRule.GetName());
+ aNumRuleInfo.MakeList(*this, bOutline);
+
+ /* If there are no matching paragraphs we are done. */
+ if (aNumRuleInfo.GetList().Count() == 0)
+ return;
+
+ /* ULONG_MAX -> process all paragraphs found */
+ if (nUpdatePos == ULONG_MAX)
+ nUpdatePos = 0;
+ else /* nUpdatePos is still the position in the document. Convert
+ to position in the list of found paragraphs. */
+ aNumRuleInfo.GetList().SearchKey(nUpdatePos, &nUpdatePos);
+
+ /* Temporal numbering holding the values to be changed in the
+ current node*/
+ SwNodeNum aNum(0);
+ /* Array for initialized levels.
+ bInitializedLevels[i] == true -> level i is initialized.
+ */
+ bool bInitializedLevels[MAXLEVEL];
+ /* flag for initialized continuous numbering. */
+ bool bInitialized = false;
+ /* counter for continuous numbering */
+ int nCount = 0;
+
+ /* If all paragraphs found are to be processed initialize all
+ levels with their start values.*/
+ if (nUpdatePos == 0)
+ {
+ for (int i = 0; i < MAXLEVEL; i++)
+ bInitializedLevels[i] = false;
+
+ lcl_NodeNumReset(aNum, rRule, 0, bInitializedLevels);
+
+ nCount = rRule.Get(0).GetStart();
+ bInitialized = true;
+ }
+ else /* If we start at a certain paragraph fill aNum/nCount with
+ values from that paragraph. Mark all levels as initalized,
+ including continuous numbering. */
+ {
+ for (int i = 0; i < MAXLEVEL; i++)
+ bInitializedLevels[i] = true;
+
+ aNum = aNumRuleInfo.GetList().GetObject(nUpdatePos)->
+ GetNum(bOutline);
+
+ nCount = aNum.GetLevelVal()[aNum.GetRealLevel()];
+ bInitialized = true;
+ }
+
+ /* The old level is the level of the first node to process. */
+ SwNodeNum * pNum = aNumRuleInfo.GetList().GetObject(nUpdatePos)->
+ GetNum();
+ BYTE nOldLevel = pNum ? pNum->GetLevel() : 0;
+
+ /* Iterate over all nodes to process. */
+ while(nUpdatePos < aNumRuleInfo.GetList().Count())
+ {
+ /* Get the current node. */
+ SwTxtNode * pTxtNode = aNumRuleInfo.GetList().GetObject(nUpdatePos);
+
+ /* If the current node has a conditional paragraph style,
+ ensure the current node gets the resulting style. */
+ if( RES_CONDTXTFMTCOLL == pTxtNode->GetFmtColl()->Which() )
+ pTxtNode->ChkCondColl();
+
+ ASSERT(0 != pTxtNode->GetNum(bOutline), "No numrule!");
+
+ if (! pTxtNode->GetNum(bOutline))
+ continue;
+
+ /* Get old numbering of the current node. */
+ const SwNodeNum * pOldNum = pTxtNode->GetNum(bOutline);
+
+ BYTE nLevel = pOldNum->GetRealLevel();
+
+ /* If numbering restarts at the current node ...*/
+ if (pOldNum->IsStart())
+ {
+ /* Fill aNum with start values of current level and
+ subsequent levels. */
+ lcl_NodeNumReset(aNum, rRule, nLevel, bInitializedLevels);
+
+ /* Fill nCount with start values for continuous numbering. */
+ nCount = rRule.Get(0).GetStart();
+ bInitialized = true;
+ }
+ /* If numbering restarts with a specific value ...*/
+ else if (pOldNum->HasSetValue())
+ {
+ /* Fill aNum with start values of current level and
+ subsequent levels. This also marks the current level as
+ initialized. Set specific value for current level. */
+ lcl_NodeNumReset(aNum, rRule, nLevel, bInitializedLevels);
+ aNum.GetLevelVal()[nLevel] = pOldNum->GetSetValue();
+
+ /* Fill nCount with the specific start value. */
+ nCount = pOldNum->GetSetValue();
+ bInitialized = true;
+ }
+ /* If the current node is the first in a row of nodes of its
+ level initialize the subsequent levels. */
+ else if (nOldLevel != nLevel)
+ {
+ lcl_NodeNumReset(aNum, rRule, nLevel + 1, bInitializedLevels);
+ }
+ nOldLevel = nLevel;
+
+ int i;
+
+ /* All previous levels are initialized. */
+ for (i = nLevel - 1; i >= 0; i--)
+ bInitializedLevels[i] = false;
+
+ /* If the level of the current node is initialized do not
+ increase the value for this level. Mark this level as
+ uninitialized. */
+ if (bInitializedLevels[nLevel])
+ bInitializedLevels[nLevel] = false;
+ else /* If the level of the current node was not initialized
+ increase the value for this level. */
+ aNum.GetLevelVal()[nLevel]++;
+
+ /* If the continuous numbering was initialized. mark it as
+ uninitialized and do not increase the value for the
+ continuous numbering. */
+ if (bInitialized)
+ bInitialized = false;
+ else /* If the continuous numbering was not initialized,
+ increase its value. */
+ nCount++;
+
+ /* If the current numbering is continuous set the value for
+ the current level to the value of the continous
+ numbering. Mark the current numbering as
+ continous. Otherwise mark the current numbering as
+ non-continuous. */
+ if (rRule.IsContinusNum())
+ {
+ aNum.GetLevelVal()[nLevel] = nCount;
+ aNum.SetContinuousNum();
+ }
+ else
+ {
+ aNum.SetContinuousNum(FALSE);
+ }
+
+ /* bChanged = true -> the current node's numbering has to be altered. */
+ bool bChanged = false;
+
+ /* the numbering to replace the current numbering */
+ SwNodeNum aTmpNum = *pOldNum;
+
+ if (aNum.IsContinuousNum() != aTmpNum.IsContinuousNum())
+ {
+ /* Continuous numbering has been activated or deactivated
+ -> change the numbering of the current node. */
+ aTmpNum.SetContinuousNum(aNum.IsContinuousNum());
+ aTmpNum.GetLevelVal()[nLevel] = nCount;
+ bChanged = true;
+ }
+
+ if (! bChanged)
+ {
+ /* For each level synchronize the local numbering (aNum)
+ with the numbering to be set in the current node
+ (aTmpNum). If there are differences propagate the value
+ fom aNum to aTmpNum. In this case the numbering of the
+ current node. */
+ for (i = 0; i < MAXLEVEL; i++)
+ {
+ if (aTmpNum.GetLevelVal()[i] != aNum.GetLevelVal()[i])
+ {
+ aTmpNum.GetLevelVal()[i] = aNum.GetLevelVal()[i];
+ bChanged = true;
+ }
+ }
+ }
+
+ /* If the current node's numbering is to be changed change the
+ according normal or outline numbering. */
+ if (bChanged)
+ {
+ if (bOutline)
+ pTxtNode->UpdateOutlineNum(aTmpNum);
+ else
+ pTxtNode->UpdateNum(aTmpNum);
+ }
+
+ nUpdatePos++;
+ }
+}
+
+// pre-SRC680-numbering
+void SwDoc::UpdateNumRuleOld( const SwNumRule & rRule, ULONG nUpdPos )
+{
+ SwNumRuleInfo aUpd( rRule.GetName() );
aUpd.MakeList( *this );
if( ULONG_MAX == nUpdPos )
@@ -2199,7 +2483,8 @@ void SwDoc::UpdateNumRule( const String& rName, ULONG nUpdPos )
else
aUpd.GetList().SearchKey( nUpdPos, &nUpdPos );
- SwNumRule* pRule = FindNumRulePtr( rName );
+ const SwNumRule* pRule = &rRule;
+
if( nUpdPos < aUpd.GetList().Count() )
{
USHORT nInitLevels = USHRT_MAX; // Bitfeld fuer die Levels!
@@ -2443,6 +2728,4 @@ void SwDoc::UpdateNumRule( const String& rName, ULONG nUpdPos )
if( pRule )
pRule->SetInvalidRule( FALSE );
}
-
-
-
+// <- #111955#
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index a16ef7e76eb4..5dcbbc9d685c 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: number.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: vg $ $Date: 2003-06-10 13:17:29 $
+ * last change: $Author: hbrinkm $ $Date: 2003-09-05 15:11:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -406,12 +406,14 @@ const SwFmtVertOrient* SwNumFmt::GetGraphicOrientation() const
BOOL SwNodeNum::operator==( const SwNodeNum& rNum ) const
{
- return nMyLevel == rNum.nMyLevel &&
- nSetValue == rNum.nSetValue &&
- bStartNum == rNum.bStartNum &&
- ( nMyLevel >= MAXLEVEL ||
- 0 == memcmp( nLevelVal, rNum.nLevelVal,
- sizeof( USHORT ) * (nMyLevel+1) ));
+ return
+ nMyLevel == rNum.nMyLevel &&
+ nSetValue == rNum.nSetValue &&
+ bStartNum == rNum.bStartNum &&
+ bContNum == rNum.bContNum && // #111955#
+ ( nMyLevel >= MAXLEVEL ||
+ 0 == memcmp( nLevelVal, rNum.nLevelVal,
+ sizeof( USHORT ) * (nMyLevel+1) ));
}
SwNumRule::SwNumRule( const String& rNm, SwNumRuleType eType, BOOL bAutoFlg )
diff --git a/sw/source/core/docnode/ndnum.cxx b/sw/source/core/docnode/ndnum.cxx
index 8631e101d2c2..58fbf740d506 100644
--- a/sw/source/core/docnode/ndnum.cxx
+++ b/sw/source/core/docnode/ndnum.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ndnum.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: vg $ $Date: 2003-04-17 13:56:42 $
+ * last change: $Author: hbrinkm $ $Date: 2003-09-05 15:11:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -316,7 +316,7 @@ BOOL lcl_UpdateOutline( const SwNodePtr& rpNd, void* pPara )
void SwNodes::UpdateOutlineNode( const SwNode& rNd, BYTE nOldLevel,
- BYTE nNewLevel )
+ BYTE nNewLevel )
{
const SwNodePtr pSrch = (SwNodePtr)&rNd;
USHORT nSttPos;
@@ -351,27 +351,40 @@ void SwNodes::UpdateOutlineNode( const SwNode& rNd, BYTE nOldLevel,
else if( !bSeekIdx ) // Update und Index nicht gefunden ??
return ;
- _OutlinePara aPara( *this, nSttPos, nOldLevel, nNewLevel );
- pOutlineNds->ForEach( nSttPos, pOutlineNds->Count(),
- lcl_UpdateOutline, &aPara );
-
-//FEATURE::CONDCOLL
+ if (GetDoc()->IsOldNumbering())
{
- SwCntntNode* pCNd;
- ULONG nSttNd = rNd.GetIndex();
- if( NO_NUMBERING != nNewLevel )
- ++nSttPos;
+ _OutlinePara aPara( *this, nSttPos, nOldLevel, nNewLevel );
+ pOutlineNds->ForEach( nSttPos, pOutlineNds->Count(),
+ lcl_UpdateOutline, &aPara );
+
+ //FEATURE::CONDCOLL
+ {
+ SwCntntNode* pCNd;
+ ULONG nSttNd = rNd.GetIndex();
+ if( NO_NUMBERING != nNewLevel )
+ ++nSttPos;
- ULONG nChkCount = ( nSttPos < pOutlineNds->Count()
+ ULONG nChkCount = ( nSttPos < pOutlineNds->Count()
? (*pOutlineNds)[ nSttPos ]->GetIndex()
: GetEndOfContent().GetIndex() )
- - nSttNd;
- for( ; nChkCount--; ++nSttNd )
- if( 0 != (pCNd = (*this)[ nSttNd ]->GetCntntNode() ) &&
- RES_CONDTXTFMTCOLL == pCNd->GetFmtColl()->Which() )
- pCNd->ChkCondColl();
+ - nSttNd;
+ for( ; nChkCount--; ++nSttNd )
+ if( 0 != (pCNd = (*this)[ nSttNd ]->GetCntntNode() ) &&
+ RES_CONDTXTFMTCOLL == pCNd->GetFmtColl()->Which() )
+ pCNd->ChkCondColl();
+ }
+ //FEATURE::CONDCOLL
+
+ }
+ else // #111955#
+ {
+ SwTxtNode & rTxtNd = (SwTxtNode &) rNd;
+ SwNodeNum aNum = rTxtNd.GetOutlineNum();
+ aNum.SetLevel(rTxtNd.GetTxtColl()->GetOutlineLevel());
+ rTxtNd.UpdateOutlineNum(aNum);
+
+ GetDoc()->UpdateNumRule(*GetDoc()->GetOutlineNumRule(), 0, TRUE);
}
-//FEATURE::CONDCOLL
// die Gliederungs-Felder Updaten
GetDoc()->GetSysFldType( RES_CHAPTERFLD )->UpdateFlds();
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 0327dfadc4a4..59d37888c43e 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ndtxt.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: vg $ $Date: 2003-05-26 08:14:13 $
+ * last change: $Author: hbrinkm $ $Date: 2003-09-05 15:11:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2256,6 +2256,9 @@ void SwTxtNode::GCAttr()
const SwNodeNum* SwTxtNode::UpdateNum( const SwNodeNum& rNum )
{
+ // #111955#
+ const SwNodeNum * pOldNum = pNdNum;
+
if( NO_NUMBERING == rNum.GetLevel() ) // kein Nummerierung mehr ?
{
if( !pNdNum )
@@ -2269,6 +2272,11 @@ const SwNodeNum* SwTxtNode::UpdateNum( const SwNodeNum& rNum )
else if( !( *pNdNum == rNum ))
*pNdNum = rNum;
}
+
+ // #111955#
+ if ((0 == pOldNum || 0 == pNdNum) && pOldNum != pNdNum)
+ GetDoc()->UpdateNumRule(*GetDoc()->GetOutlineNumRule(), 0, TRUE);
+
NumRuleChgd();
return pNdNum;
}
@@ -2326,6 +2334,12 @@ const SwNodeNum* SwTxtNode::UpdateOutlineNum( const SwNodeNum& rNum )
return pNdOutl;
}
+// #111955#
+BOOL SwTxtNode::IsOutlineNum() const
+{
+ return pNdOutl != NULL && pNdNum == NULL;
+}
+
SwTxtNode* SwTxtNode::_MakeNewTxtNode( const SwNodeIndex& rPos, BOOL bNext,
BOOL bChgFollow )
{
diff --git a/sw/source/filter/xml/DocSettingNames.hxx b/sw/source/filter/xml/DocSettingNames.hxx
new file mode 100644
index 000000000000..7f68c49c044d
--- /dev/null
+++ b/sw/source/filter/xml/DocSettingNames.hxx
@@ -0,0 +1,26 @@
+const char* aNmArr[] = {
+ "ForbiddenCharacters" ,
+ "IsKernAsianPunctuation" ,
+ "CharacterCompressionType" ,
+ "LinkUpdateMode" ,
+ "FieldAutoUpdate" ,
+ "ChartAutoUpdate" ,
+ "AddParaTableSpacing" ,
+ "AddParaTableSpacingAtStart" ,
+ "PrintAnnotationMode" ,
+ "PrintBlackFonts" ,
+ "PrintControls" ,
+ "PrintDrawings" ,
+ "PrintGraphics" ,
+ "PrintLeftPages" ,
+ "PrintPageBackground" ,
+ "PrintProspect" ,
+ "PrintReversed" ,
+ "PrintRightPages" ,
+ "PrintFaxName" ,
+ "PrintPaperFromSetup" ,
+ "PrintTables" ,
+ "PrintSingleJobs",
+ "UpdateFromTemplate",
+ "PrinterIndependentLayout"
+};
diff --git a/sw/source/filter/xml/makefile.mk b/sw/source/filter/xml/makefile.mk
index 324adf4763ed..8be6b2dff17b 100644
--- a/sw/source/filter/xml/makefile.mk
+++ b/sw/source/filter/xml/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.11 $
+# $Revision: 1.12 $
#
-# last change: $Author: vg $ $Date: 2003-04-17 15:05:58 $
+# last change: $Author: hbrinkm $ $Date: 2003-09-05 15:10:27 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -148,7 +148,16 @@ EXCEPTIONSFILES= \
$(SLO)$/xmlfonte.obj \
$(SLO)$/XMLRedlineImportHelper.obj
-# --- Tagets -------------------------------------------------------
+# --- Targets -------------------------------------------------------
+
+$(BIN)/makehash: makehash.cxx DocSettingNames.hxx
+ $(cc) $(CFLAGS) $(CFLAGSCC) -o $(BIN)/makehash makehash.cxx
+ chmod u+x $(BIN)/makehash
+
+$(INCCOM)/hash.hxx: $(BIN)/makehash
+ $(BIN)/makehash > $(INCCOM)/hash.hxx
+
+$(SLO)$/xmlimp.obj: $(INCCOM)/hash.hxx
.INCLUDE : target.mk
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 11315e325a49..e7e5da0cf633 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlimp.cxx,v $
*
- * $Revision: 1.68 $
+ * $Revision: 1.69 $
*
- * last change: $Author: hr $ $Date: 2003-04-28 15:24:54 $
+ * last change: $Author: hbrinkm $ $Date: 2003-09-05 15:09:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -991,153 +991,8 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
if( !xInfo.is() )
return;
- // static array of setting names which are not loaded.
- // This table is created with the iout commended procedure. This will
- // be need if anybody add more or change strings!!!
- /*
- program to calculate the best hash parameters for the property names.
------------------------------------------------------------------
-#include <stdio.h>
-#include <string.h>
-
- const char* aNmArr[] = {
- "ForbiddenCharacters" ,
- "IsKernAsianPunctuation" ,
- "CharacterCompressionType" ,
- "LinkUpdateMode" ,
- "FieldAutoUpdate" ,
- "ChartAutoUpdate" ,
- "AddParaTableSpacing" ,
- "AddParaTableSpacingAtStart" ,
- "PrintAnnotationMode" ,
- "PrintBlackFonts" ,
- "PrintControls" ,
- "PrintDrawings" ,
- "PrintGraphics" ,
- "PrintLeftPages" ,
- "PrintPageBackground" ,
- "PrintProspect" ,
- "PrintReversed" ,
- "PrintRightPages" ,
- "PrintFaxName" ,
- "PrintPaperFromSetup" ,
- "PrintTables" ,
- "PrintSingleJobs",
- "UpdateFromTemplate",
- "PrinterIndependentLayout"
- };
-#define TBL_MAX 100
-int aArr[ TBL_MAX ];
-int nPrime, nSub;
-
-unsigned long calc_hash( const char* p )
-{
- unsigned long ii = 0;
- while( *p )
- ii = (ii * nPrime) ^ ( *p++ - nSub );
- return ii;
-}
-int Chk_Unique_hashValue( unsigned short nTblSize )
-{
- memset( aArr, 0, sizeof( aArr ) );
- unsigned long ii;
- for( int n = 0; n < sizeof( aNmArr ) / sizeof( aNmArr[0] ); ++n )
- {
- ii = calc_hash( aNmArr[ n ] ) % nTblSize;
- if( aArr[ ii ] )
- break;
- aArr[ ii ] = 1;
- }
- return n == ( sizeof( aNmArr ) / sizeof( aNmArr[0] ) );
-}
-
-void Show_Result( unsigned short nTblSize )
-{
- printf( "\nTblSz = %d\n", nTblSize );
- for( int n = 0; n < sizeof( aNmArr ) / sizeof( aNmArr[0] ); ++n )
- {
- unsigned long ii = calc_hash( aNmArr[ n ] ) % nTblSize;
- printf( "%-30s -> %3d\n", aNmArr[ n ], ii );
- }
-}
-
-void main()
-{
- int nPrm = nPrime, nSb = nSub;
- unsigned short nLTbl = TBL_MAX, nTblSize;
-
- for( nSub = ' '; nSub < 127; ++nSub )
- for( nPrime = 13 ; nPrime < 99; ++nPrime )
- for( nTblSize = sizeof( aNmArr ) / sizeof( aNmArr[0] );
- nTblSize < TBL_MAX; ++nTblSize )
- if( Chk_Unique_hashValue( nTblSize ))
- {
- if( nLTbl > nTblSize )
- {
- nLTbl = nTblSize;
- nPrm = nPrime;
- nSb = nSub;
- }
- break;
- }
-
- nPrime = nPrm;
- nSub = nSb;
- nTblSize = nLTbl;
-
- Show_Result( nTblSize );
- printf( "\nPrime: %d, nSub: %d, TblSz = %d - %d", nPrime, nSub,
- sizeof( aNmArr ) / sizeof( aNmArr[0] ), nTblSize );
-}
------------------------------------------------------------------
- */
- static const struct {
- const sal_Char* pName;
- sal_uInt16 nLen;
- } aNotSetArr[40] = {
-/* 0*/ {0,0},
-/* 1*/ {RTL_CONSTASCII_STRINGPARAM( "PrintTables" )},
-/* 2*/ {RTL_CONSTASCII_STRINGPARAM( "ForbiddenCharacters" )},
-/* 3*/ {0,0},
-/* 4*/ {0,0},
-/* 5*/ {RTL_CONSTASCII_STRINGPARAM( "AddParaTableSpacingAtStart" )},
-/* 6*/ {0,0},
-/* 7*/ {RTL_CONSTASCII_STRINGPARAM( "CharacterCompressionType" )},
-/* 8*/ {0,0},
-/* 9*/ {RTL_CONSTASCII_STRINGPARAM( "PrintDrawings" )},
-/*10*/ {RTL_CONSTASCII_STRINGPARAM( "PrintRightPages" )},
-/*11*/ {RTL_CONSTASCII_STRINGPARAM( "PrintPageBackground" )},
-/*12*/ {RTL_CONSTASCII_STRINGPARAM( "LinkUpdateMode" )},
-/*13*/ {RTL_CONSTASCII_STRINGPARAM( "UpdateFromTemplate" )},
-/*14*/ {0,0},
-/*15*/ {RTL_CONSTASCII_STRINGPARAM( "PrintBlackFonts" )},
-/*16*/ {RTL_CONSTASCII_STRINGPARAM( "PrintSingleJobs" )},
-/*17*/ {RTL_CONSTASCII_STRINGPARAM( "ChartAutoUpdate" )},
-/*18*/ {RTL_CONSTASCII_STRINGPARAM( "IsKernAsianPunctuation" )},
-/*19*/ {RTL_CONSTASCII_STRINGPARAM( "AddParaTableSpacing" )},
-/*20*/ {0,0},
-/*21*/ {0,0},
-/*22*/ {0,0},
-/*23*/ {0,0},
-/*24*/ {RTL_CONSTASCII_STRINGPARAM( "PrintReversed" )},
-/*25*/ {RTL_CONSTASCII_STRINGPARAM( "FieldAutoUpdate" )},
-/*26*/ {RTL_CONSTASCII_STRINGPARAM( "PrintProspect" )},
-/*27*/ {0,0},
-/*28*/ {RTL_CONSTASCII_STRINGPARAM( "PrintControls" )},
-/*29*/ {0,0},
-/*30*/ {RTL_CONSTASCII_STRINGPARAM( "PrintAnnotationMode" )},
-/*31*/ {RTL_CONSTASCII_STRINGPARAM( "PrintGraphics" )},
-/*32*/ {RTL_CONSTASCII_STRINGPARAM( "PrinterIndependentLayout" )},
-/*33*/ {0,0},
-/*34*/ {0,0},
-/*35*/ {RTL_CONSTASCII_STRINGPARAM( "PrintPaperFromSetup" )},
-/*36*/ {RTL_CONSTASCII_STRINGPARAM( "PrintLeftPages" )},
-/*37*/ {RTL_CONSTASCII_STRINGPARAM( "PrintFaxName" )},
-/*38*/ {0,0},
-/*39*/ {0,0},
- };
- const ULONG nPrime = 51;
- const ULONG nSub = 51;
+ // #111955#
+#include <hash.hxx>
sal_Int32 nCount = aConfigProps.getLength();
const PropertyValue* pValues = aConfigProps.getConstArray();
@@ -1175,11 +1030,20 @@ void main()
{
xProps->setPropertyValue( pValues->Name, pValues->Value );
}
+<<<<<<< xmlimp.cxx
+
+ // did we find any of the non-default cases?
+ // #111955#
+ if( pValues->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("UseOldNumbering")) )
+ bUseOldNumbering = true;
+
+=======
// did we find any of the non-default cases?
if( pValues->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PrinterIndependentLayout")) )
bPrinterIndependentLayout = true;
+>>>>>>> 1.68
}
catch( Exception& )
{
@@ -1188,6 +1052,45 @@ void main()
}
pValues++;
}
+<<<<<<< xmlimp.cxx
+
+ // finally, treat the non-default cases
+ if( ! bUseOldNumbering)
+ {
+ Any aAny;
+ sal_Bool bOldNum = true;
+ aAny.setValue(&bOldNum, ::getBooleanCppuType());
+ xProps->setPropertyValue
+ (OUString( RTL_CONSTASCII_USTRINGPARAM("UseOldNumbering")),
+ aAny );
+ }
+
+ Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
+ Reference < XText > xText = xTextDoc->getText();
+ Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY);
+ ASSERT( xTextTunnel.is(), "missing XUnoTunnel for Cursor" );
+ if( xTextTunnel.is() )
+ {
+ SwXText *pText = (SwXText *)xTextTunnel->getSomething(
+ SwXText::getUnoTunnelId() );
+ ASSERT( pText, "SwXText missing" );
+ if( pText )
+ {
+ SwDoc *pDoc = pText->GetDoc();
+ if( pDoc )
+ {
+ // If the printer is known, then the OLE objects will
+ // already have correct sizes, and we don't have to call
+ // PrtOLENotify again. Otherwise we have to call it.
+ // The flag might be set from setting the printer, so it
+ // it is required to clear it.
+ SfxPrinter *pPrinter = pDoc->GetPrt( sal_False );
+ if( pPrinter )
+ pDoc->SetOLEPrtNotifyPending( !pPrinter->IsKnown() );
+ }
+ }
+ }
+=======
// finally, treat the non-default cases
if( ! bPrinterIndependentLayout )
@@ -1225,6 +1128,7 @@ void main()
}
}
}
+>>>>>>> 1.68
}