Index: main/sw/inc/doc.hxx =================================================================== --- main/sw/inc/doc.hxx (revision 1374901) +++ main/sw/inc/doc.hxx (working copy) @@ -881,8 +881,11 @@ virtual SwDrawFrmFmt* Insert(const SwPaM &rRg, SdrObject& rDrawObj, const SfxItemSet* pFlyAttrSet, SwFrmFmt*); virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj, const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, SwFrmFmt*); + //Modify here for #119405, by chengjh, 2012-08-16 + //Add a para for the char attribute exp... virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem&, - const SetAttrMode nFlags); + const SetAttrMode nFlags,bool bExpandCharToPara=false); + //End virtual bool InsertItemSet (const SwPaM &rRg, const SfxItemSet&, const SetAttrMode nFlags); virtual void ReRead(SwPaM&, const String& rGrfName, const String& rFltName, const Graphic* pGraphic, const GraphicObject* pGrfObj); Index: main/sw/inc/IDocumentContentOperations.hxx =================================================================== --- main/sw/inc/IDocumentContentOperations.hxx (revision 1374901) +++ main/sw/inc/IDocumentContentOperations.hxx (working copy) @@ -179,8 +179,11 @@ hinzugefuegt. Wenn das Attribut nicht eingefuegt werden konnte, liefert die Methode sal_False. */ + //Modify here for #119405, by chengjh, 2012-08-16 + //Add a para for the char attribute exp... virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem&, - const sal_uInt16 nFlags) = 0; + const sal_uInt16 nFlags,bool bExpandCharToPara=false) = 0; + //End /** */ Index: main/sw/inc/ndtxt.hxx =================================================================== --- main/sw/inc/ndtxt.hxx (revision 1374901) +++ main/sw/inc/ndtxt.hxx (working copy) @@ -216,6 +216,9 @@ // SMARTTAGS void SetSmartTags( SwWrongList* pNew, bool bDelete = true ); SwWrongList* GetSmartTags(); + //Modify here for #119405, by easyfan, 2012-05-24 + bool TryCharSetExpandToNum(const SfxItemSet& pCharSet); + //End of modification, by easyfan // // End: Data collected during idle time Index: main/sw/source/core/doc/docfmt.cxx =================================================================== --- main/sw/source/core/doc/docfmt.cxx (revision 1374901) +++ main/sw/source/core/doc/docfmt.cxx (working copy) @@ -551,7 +551,9 @@ static bool lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet, - const SetAttrMode nFlags, SwUndoAttr *const pUndo) +//Modify here for #119405, by easyfan, 2012-05-24 + const SetAttrMode nFlags, SwUndoAttr *const pUndo,bool bExpandCharToPara=false) +//End of modification, by easyfan { // teil die Sets auf (fuer Selektion in Nodes) const SfxItemSet* pCharSet = 0; @@ -964,6 +966,26 @@ // lediglich Selektion in einem Node. if( pStt->nNode == pEnd->nNode ) { + //Modify here for #119405, by easyfan, 2012-05-24 + //The data parameter flag: bExpandCharToPara, comes from the data member of SwDoc, + //Which is set in SW MS word Binary filter WW8ImplRreader. With this flag on, means that + //current setting attribute set is a character range properties set and comes from a MS word + //binary file, And the setting range include a paragraph end position (0X0D); + //More specifications, as such property inside the character range properties set recorded in + //MS word binary file are dealed and inserted into data model (SwDoc) one by one, so we + //only dealing the scenario that the char properties set with 1 item inside; + + if (bExpandCharToPara && pCharSet && pCharSet->Count() ==1 ) + { + SwTxtNode* pCurrentNd = pStt->nNode.GetNode().GetTxtNode(); + + if (pCurrentNd) + { + pCurrentNd->TryCharSetExpandToNum(*pCharSet); + + } + } + //End of modification, by easyfan DELETECHARSETS return bRet; } @@ -1067,13 +1089,45 @@ ++nNodes; } + //Modify here for #119405, by easyfan, 2012-05-24 + //The data parameter flag: bExpandCharToPara, comes from the data member of SwDoc, + //Which is set in SW MS word Binary filter WW8ImplRreader. With this flag on, means that + //current setting attribute set is a character range properties set and comes from a MS word + //binary file, And the setting range include a paragraph end position (0X0D); + //More specifications, as such property inside the character range properties set recorded in + //MS word binary file are dealed and inserted into data model (SwDoc) one by one, so we + //only dealing the scenario that the char properties set with 1 item inside; + if (bExpandCharToPara && pCharSet && pCharSet->Count() ==1) + { + SwPosition aStartPos (*rRg.Start()); + SwPosition aEndPos (*rRg.End()); + + if (aEndPos.nNode.GetNode().GetTxtNode() && aEndPos.nContent != aEndPos.nNode.GetNode().GetTxtNode()->Len()) + aEndPos.nNode--; + + for (;aStartPos<=aEndPos;aStartPos.nNode++) + { + SwTxtNode* pCurrentNd = aStartPos.nNode.GetNode().GetTxtNode(); + + if (pCurrentNd) + { + pCurrentNd->TryCharSetExpandToNum(*pCharSet); + + } + + } + } + //End of modification, by easyfan + DELETECHARSETS return (nNodes != 0) || bRet; } - +//Modify here for #119405, by chengjh, 2012-08-16 +//Add a para for the char attribute exp... bool SwDoc::InsertPoolItem( const SwPaM &rRg, const SfxPoolItem &rHt, - const SetAttrMode nFlags ) + const SetAttrMode nFlags, bool bExpandCharToPara) +//End { SwDataChanged aTmp( rRg, 0 ); SwUndoAttr* pUndoAttr = 0; @@ -1085,7 +1139,9 @@ SfxItemSet aSet( GetAttrPool(), rHt.Which(), rHt.Which() ); aSet.Put( rHt ); - bool bRet = lcl_InsAttr( this, rRg, aSet, nFlags, pUndoAttr ); + //Modify here for #119405, by easyfan, 2012-05-24 + bool bRet = lcl_InsAttr( this, rRg, aSet, nFlags, pUndoAttr,bExpandCharToPara ); + //End of modification, by easyfan if (GetIDocumentUndoRedo().DoesUndo()) { Index: main/sw/source/core/txtnode/thints.cxx =================================================================== --- main/sw/source/core/txtnode/thints.cxx (revision 1374901) +++ main/sw/source/core/txtnode/thints.cxx (working copy) @@ -1607,6 +1607,79 @@ } } +//Modify here for #119405, by easyfan, 2012-05-24 +//In MS Word, the font underline setting of the paragraph end position wont affect the formatting of numbering, so we ignore it +bool lcl_IsIgnoredCharFmtForNumbering(const sal_uInt16 nWhich) +{ + return (nWhich == RES_CHRATR_UNDERLINE); +} + +//In MS Word, following properties of the paragraph end position wont affect the formatting of bullets, so we ignore them: +//Font underline; +//Font Italic of Western, CJK and CTL; +//Font Bold of Wertern, CJK and CTL; +bool lcl_IsIgnoredCharFmtForBullets(const sal_uInt16 nWhich) +{ + return (nWhich == RES_CHRATR_UNDERLINE || nWhich == RES_CHRATR_POSTURE || nWhich == RES_CHRATR_WEIGHT + || nWhich == RES_CHRATR_CJK_POSTURE || nWhich == RES_CHRATR_CJK_WEIGHT + || nWhich == RES_CHRATR_CTL_POSTURE || nWhich == RES_CHRATR_CTL_WEIGHT); +} + +//Condition for expanding char set to character style of specified number rule level: +//The item inside the set should not conflict to any exist and non-default item inside paragraph properties set (SwCntntNode::SwPAttrSet); +//The node should have applied a number rule; +//The node should be counted in a list, if not, make it to be; +//The item should not conflict to any exist and non-default item inside the character of specified number rule level; +//The item should not be ignored depend on the exact number rule type; +bool SwTxtNode::TryCharSetExpandToNum(const SfxItemSet& aCharSet) +{ + bool bRet = false; + SfxItemIter aIter( aCharSet ); + const SfxPoolItem* pItem = aIter.FirstItem(); + const sal_uInt16 nWhich = pItem->Which(); + xub_StrLen nIdx = 0; + + const SfxPoolItem& rInnerItem = GetAttr(nWhich,false); + + if (!IsDefaultItem(&rInnerItem) && !IsInvalidItem(&rInnerItem)) + return bRet; + + if ( !IsInList() && GetNumRule() && GetListId().Len() > 0 ) + { + return bRet; + } + + SwNumRule* pCurrNum = GetNumRule(false); + + int nLevel = GetActualListLevel(); + + if (nLevel != -1 && pCurrNum) + { + const SwNumFmt* pCurrNumFmt = pCurrNum->GetNumFmt(static_cast(nLevel)); + if (pCurrNumFmt) + { + if (pCurrNumFmt->IsItemize() && lcl_IsIgnoredCharFmtForBullets(nWhich)) + return bRet; + if (pCurrNumFmt->IsEnumeration() && lcl_IsIgnoredCharFmtForNumbering(nWhich)) + return bRet; + SwCharFmt* pCurrCharFmt =pCurrNumFmt->GetCharFmt(); + + if (pCurrCharFmt && pCurrCharFmt->GetItemState(nWhich,false) != SFX_ITEM_SET) + { + pCurrCharFmt->SetFmtAttr(*pItem); + SwNumFmt aNewNumFmt(*pCurrNumFmt); + aNewNumFmt.SetCharFmt(pCurrCharFmt); + pCurrNum->Set(nLevel,aNewNumFmt); + bRet = true; + } + } + } + + + return bRet; +} +//End of modification, by easyfan + // setze diese Attribute am TextNode. Wird der gesamte Bereich umspannt, // dann setze sie nur im AutoAttrSet (SwCntntNode:: SetAttr) sal_Bool SwTxtNode::SetAttr( const SfxItemSet& rSet, xub_StrLen nStt, Index: main/sw/source/filter/inc/fltshell.hxx =================================================================== --- main/sw/source/filter/inc/fltshell.hxx (revision 1374901) +++ main/sw/source/filter/inc/fltshell.hxx (working copy) @@ -72,7 +72,12 @@ sal_Bool bLocked; sal_Bool bCopied; sal_Bool bConsumedByField; - + //Modify here for #119405, by easyfan, 2012-05-24 + sal_Int32 mnStartCP; + sal_Int32 mnEndCP; + bool bIsParaEnd; + //End of modification, by easyfan + SW_DLLPUBLIC SwFltStackEntry(const SwPosition & rStartPos, SfxPoolItem* pHt ); SW_DLLPUBLIC SwFltStackEntry(const SwFltStackEntry& rEntry); SW_DLLPUBLIC ~SwFltStackEntry(); @@ -80,6 +85,17 @@ void SetStartPos(const SwPosition & rStartPos); SW_DLLPUBLIC void SetEndPos( const SwPosition & rEndPos); SW_DLLPUBLIC sal_Bool MakeRegion(SwDoc* pDoc, SwPaM& rRegion, sal_Bool bCheck ); + //Modify here for #119405, by easyfan, 2012-05-24 + void SetStartCP(sal_Int32 nCP) {mnStartCP = nCP;} + void SetEndCP(sal_Int32 nCP) {mnEndCP = nCP;} + sal_Int32 GetStartCP() const {return mnStartCP;} + sal_Int32 GetEndCP() const {return mnEndCP;} + //End of modification, by easyfan + //Modify here for #119405, by chengjh, 2012-08-16 + bool IsAbleMakeRegion(); + bool IsParaEnd(){ return bIsParaEnd;} + void SetIsParaEnd(bool bArg){ bIsParaEnd = bArg;} + //End }; class SW_DLLPUBLIC SwFltControlStack @@ -91,6 +107,11 @@ sal_uLong nFieldFlags; KeyCode aEmptyKeyCode; // fuer Bookmarks +//Modify for #119405 by chengjh, 2012-08-16 +private: + bool bHasSdOD; + bool bSdODChecked; +//End protected: SwDoc* pDoc; @@ -98,6 +119,16 @@ void MoveAttrs( const SwPosition& rPos ); virtual void SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry* pEntry); + //Modify here for #119405, by easyfan, 2012-05-24 + virtual sal_Int32 GetCurrAttrCP() const {return -1;} + virtual bool IsParaEndInCPs(sal_Int32 nStart,sal_Int32 nEnd,bool bSdOD=true) const {return false;} + //End of modification, by easyfan + //Modify for #119405 by chengjh, 2012-08-16 + //Clear the para end position recorded in reader intermittently for the least impact on loading performance + virtual void ClearParaEndPosition(){}; + virtual bool CheckSdOD(sal_Int32 nStart,sal_Int32 nEnd){return false;} + bool HasSdOD(); + //End public: enum Flags Index: main/sw/source/filter/ww1/fltshell.cxx =================================================================== --- main/sw/source/filter/ww1/fltshell.cxx (revision 1374901) +++ main/sw/source/filter/ww1/fltshell.cxx (working copy) @@ -89,7 +89,9 @@ // ------ Stack-Eintrag fuer die gesamten - Attribute vom Text ----------- SwFltStackEntry::SwFltStackEntry(const SwPosition& rStartPos, SfxPoolItem* pHt ) : nMkNode(rStartPos.nNode, -1), - nPtNode(nMkNode) + //Modify here for #119405, by easyfan, 2012-05-24 + nPtNode(nMkNode),mnStartCP(-1),mnEndCP(-1),bIsParaEnd(false) + //End of modification, by easyfan { // Anfang vom Bereich merken nMkCntnt = rStartPos.nContent.GetIndex(); @@ -109,6 +111,11 @@ bOld = rEntry.bOld; bLocked = bCopied = sal_True; // when rEntry were NOT bLocked we would never have been called bConsumedByField = rEntry.bConsumedByField; + //Modify here for #119405, by chengjh, 2012-08-16 + mnStartCP= rEntry.mnStartCP; + mnEndCP = rEntry.mnEndCP; + bIsParaEnd = rEntry.bIsParaEnd; + //End } @@ -130,21 +137,36 @@ nPtNode = rEndPos.nNode.GetIndex()-1; nPtCntnt = rEndPos.nContent.GetIndex(); } +//Modify here for #119405, by chengjh, 2012-08-16 +//The only position of 0x0D will not be able to make regin in the old logic +//because it is beyond the length of para...need special consideration here. +bool SwFltStackEntry::IsAbleMakeRegion() +{ + SwCntntNode *const pCntntNode( + SwNodeIndex(nMkNode, +1).GetNode().GetCntntNode()); + if ((nMkNode.GetIndex() == nPtNode.GetIndex()) && (nMkCntnt == nPtCntnt) + && ((0 != nPtCntnt) || (pCntntNode && (0 != pCntntNode->Len()))) + && ((RES_TXTATR_FIELD != pAttr->Which()) + && !(bIsParaEnd && pCntntNode && pCntntNode->IsTxtNode() && 0 != pCntntNode->Len() ))) + { + return false; + } + return true; +} +//End sal_Bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, sal_Bool bCheck ) { // does this range actually contain something? // empty range is allowed if at start of empty paragraph // fields are special: never have range, so leave them - SwCntntNode *const pCntntNode( - SwNodeIndex(nMkNode, +1).GetNode().GetCntntNode()); - if ((nMkNode.GetIndex() == nPtNode.GetIndex()) && (nMkCntnt == nPtCntnt) - && ((0 != nPtCntnt) || (pCntntNode && (0 != pCntntNode->Len()))) - && (RES_TXTATR_FIELD != pAttr->Which())) + //Modify here for #119405, by chengjh, 2012-08-16 + //Revised the code and move the code segment to defined function + if ( !IsAbleMakeRegion() ) { return sal_False; } - + //End // !!! Die Content-Indizies beziehen sich immer auf den Node !!! rRegion.GetPoint()->nNode = nMkNode.GetIndex() + 1; SwCntntNode* pCNd = GetCntntNode(pDoc, rRegion.GetPoint()->nNode, sal_True); @@ -170,6 +192,10 @@ SwFltControlStack::SwFltControlStack(SwDoc* pDo, sal_uLong nFieldFl) : nFieldFlags(nFieldFl), pDoc(pDo), bIsEndStack(false) + //Modify for #119405 by chengjh, 2012-08-16 + ,bHasSdOD(true),bSdODChecked(false) + //End + { } @@ -223,6 +249,9 @@ void SwFltControlStack::NewAttr(const SwPosition& rPos, const SfxPoolItem & rAttr ) { SwFltStackEntry *pTmp = new SwFltStackEntry(rPos, rAttr.Clone() ); + //Modify here for #119405, by easyfan, 2012-05-24 + pTmp->SetStartCP(GetCurrAttrCP()); + //End of modification, by easyfan sal_uInt16 nWhich = pTmp->pAttr->Which(); SetAttr(rPos, nWhich);// Ende von evtl. gleichen Attributen auf dem Stack // Setzen, damit sich die Attribute nicht auf @@ -239,6 +268,16 @@ delete *aElement; maEntries.erase(aElement); } + //Modify for #119405 by chengjh, 2012-08-16 + //Clear the para end position recorded in reader intermittently for the least impact on loading performance + //Because the attributes handled based on the unit of para + if ( Count() == 0 ) + { + ClearParaEndPosition(); + bHasSdOD = true; + bSdODChecked = false; + } + //End } // SwFltControlStack::StealAttr() loescht Attribute des angegebenen Typs vom Stack. @@ -326,6 +365,9 @@ if (bF) { pEntry->bConsumedByField = consumedByField; pEntry->SetEndPos(rPos); + //Modify here for #119405, by easyfan, 2012-05-24 + pEntry->SetEndCP(GetCurrAttrCP()); + //End of modification, by easyfan } continue; } @@ -409,7 +451,33 @@ return rTmpStart <= rTmpEnd; // gueltig ? } +//Modify for #119405 by chengjh, 2012-08-16 +//***This function will check whether there is existing individual attribute positon for 0x0D***/ +//The check will happen only once for a paragraph during loading +bool SwFltControlStack::HasSdOD() +{ + sal_uInt16 nCnt = static_cast< sal_uInt16 >(Count()); + SwFltStackEntry* pEntry = 0; + + bool bRet = false; + + for (sal_uInt16 i=0; i < nCnt; i++) + { + pEntry = (*this)[ i ]; + if ( pEntry && pEntry->mnStartCP == pEntry->mnEndCP ) + { + if ( CheckSdOD(pEntry->mnStartCP,pEntry->mnEndCP) ) + { + bRet = true; + break; + } + } + } + + return bRet; +} +//End void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry* pEntry) { SwPaM aRegion( rTmpPos ); @@ -593,10 +661,37 @@ } break; default: - if (pEntry->MakeRegion(pDoc, aRegion, sal_False)) - { - pDoc->InsertPoolItem(aRegion, *pEntry->pAttr, 0); - } + { + //Modify here for #119405, by chengjh, 2012-08-16 + //Revised for more complex situations should be considered + if ( !bSdODChecked ) + { + bHasSdOD = HasSdOD(); + bSdODChecked = true; + } + sal_Int32 nStart = pEntry->GetStartCP(); + sal_Int32 nEnd = pEntry->GetEndCP(); + if (nStart != -1 && nEnd != -1 && nEnd >= nStart ) + { + pEntry->SetIsParaEnd( IsParaEndInCPs(nStart,nEnd,bHasSdOD) ); + } + //End + if (pEntry->MakeRegion(pDoc, aRegion, sal_False)) + { + //Modify here for #119405, by easyfan, 2012-05-24 + sal_Int32 nStart = pEntry->GetStartCP(); + sal_Int32 nEnd = pEntry->GetEndCP(); + //Refined 2012-08-16 + if (pEntry->IsParaEnd()) + { + pDoc->InsertPoolItem(aRegion, *pEntry->pAttr, 0,true); + }else + { + pDoc->InsertPoolItem(aRegion, *pEntry->pAttr, 0); + } + //End + } + } break; } } Index: main/sw/source/filter/ww8/ww8par.cxx =================================================================== --- main/sw/source/filter/ww8/ww8par.cxx (revision 1374901) +++ main/sw/source/filter/ww8/ww8par.cxx (working copy) @@ -902,6 +902,30 @@ return pRet; } +//Modify here for #119405, by easyfan, 2012-05-24 +sal_Int32 SwWW8FltControlStack::GetCurrAttrCP() const +{ + return rReader.GetCurrAttrCP(); +} +bool SwWW8FltControlStack::IsParaEndInCPs(sal_Int32 nStart,sal_Int32 nEnd,bool bSdOD) const +{ + return rReader.IsParaEndInCPs(nStart,nEnd,bSdOD); +} +//End of modification, by easyfan +//Modify for #119405 by chengjh, 2012-08-16 +//Clear the para end position recorded in reader intermittently for the least impact on loading performance +void SwWW8FltControlStack::ClearParaEndPosition() +{ + if ( Count() != 0 ) + return; + + rReader.ClearParaEndPosition(); +} +bool SwWW8FltControlStack::CheckSdOD(sal_Int32 nStart,sal_Int32 nEnd) +{ + return rReader.IsParaEndInCPs(nStart,nEnd); +} +//End void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry* pEntry) { @@ -3010,7 +3034,38 @@ return nNext; } - +//Modify here for #119405, by easyfan, 2012-05-24 +//Revised 2012.8.16 for the complex attribute presentation of 0x0D in MS +bool SwWW8ImplReader::IsParaEndInCPs(sal_Int32 nStart, sal_Int32 nEnd,bool bSdOD) const +{ + //Modify for #119405 by chengjh, 2012-08-16 + //Revised for performance consideration + if (nStart == -1 || nEnd == -1 || nEnd < nStart ) + return false; + + for (cp_vector::const_reverse_iterator aItr = maEndParaPos.rbegin(); aItr!= maEndParaPos.rend(); aItr++) + //End + { + //Revised 2012.8.16,to the 0x0D,the attribute will have two situations + //*********within***********exact******// + //*********but also sample with only left and the position of 0x0d is the edge of the right side***********// + if ( bSdOD && ( (nStart < *aItr && nEnd > *aItr) || ( nStart == nEnd && *aItr == nStart)) ) + return true; + else if ( !bSdOD && (nStart < *aItr && nEnd >= *aItr) ) + return true; + } + + return false; +} +//End of modification, by easyfan +//Modify for #119405 by chengjh, 2012-08-16 +//Clear the para end position recorded in reader intermittently for the least impact on loading performance +void SwWW8ImplReader::ClearParaEndPosition() +{ + if ( maEndParaPos.size() > 0 ) + maEndParaPos.clear(); +} +//End void SwWW8ImplReader::ReadAttrs(WW8_CP& rNext, WW8_CP& rTxtPos, bool& rbStartLine) { if( rTxtPos >= rNext ) @@ -3018,6 +3073,9 @@ do { + //Modify here for #119405, by easyfan, 2012-05-24 + maCurrAttrCP = rTxtPos; + //End of modification, by easyfan rNext = ReadTextAttr( rTxtPos, rbStartLine ); } while( rTxtPos >= rNext ); @@ -3108,7 +3166,14 @@ // create a new txtnode and join the two paragraphs together if (bStartLine && !pPreviousNode) // Zeilenende + { + //Modify here for #119405, by easyfan, 2012-05-24 + //We will record the CP of a paragraph end ('0x0D'), if current loading contents is from main stream; + if (mbOnLoadingMain) + maEndParaPos.push_back(l-1); + //End of modification, by easyfan AppendTxtNode(*pPaM->GetPoint()); + } if (pPreviousNode && bStartLine) { @@ -3270,6 +3335,10 @@ nIdctHint(0), bBidi(false), bReadTable(false) + //Modify here for #119405, by easyfan, 2012-05-24 + ,maCurrAttrCP(-1), + mbOnLoadingMain(false) + //End of modification, by easyfan { pStrm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); nWantedVersion = nVersionPara; @@ -4102,7 +4171,13 @@ } else //ordinary case { + //Modify here for #119405, by easyfan, 2012-05-24 + mbOnLoadingMain = true; + //End of modification, by easyfan ReadText(0, pWwFib->ccpText, MAN_MAINTEXT); + //Modify here for #119405, by easyfan, 2012-05-24 + mbOnLoadingMain = false; + //End of modification, by easyfan } ::SetProgressState(nProgress, mpDocShell); // Update Index: main/sw/source/filter/ww8/ww8par.hxx =================================================================== --- main/sw/source/filter/ww8/ww8par.hxx (revision 1374901) +++ main/sw/source/filter/ww8/ww8par.hxx (working copy) @@ -235,6 +235,15 @@ protected: virtual void SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry* pEntry); + //Modify here for #119405, by easyfan, 2012-05-24 + virtual sal_Int32 GetCurrAttrCP() const; + virtual bool IsParaEndInCPs(sal_Int32 nStart,sal_Int32 nEnd,bool bSdOD=true) const; + //End of modification, by easyfan + //Modify for #119405 by chengjh, 2012-08-16 + //Clear the para end position recorded in reader intermittently for the least impact on loading performance + virtual void ClearParaEndPosition(); + virtual bool CheckSdOD(sal_Int32 nStart,sal_Int32 nEnd); + //End public: SwWW8FltControlStack(SwDoc* pDo, sal_uLong nFieldFl, SwWW8ImplReader& rReader_ ) @@ -789,6 +798,10 @@ //----------------------------------------- // Storage-Reader //----------------------------------------- +//Modify here for #119405, by easyfan, 2012-05-24 +typedef std::vector cp_vector; +//End of modification, by easyfan + class SwWW8ImplReader { private: @@ -1091,6 +1104,11 @@ bool bReadTable; boost::shared_ptr mpTableEndPaM; + //Modify here for #119405, by easyfan, 2012-05-24 + cp_vector maEndParaPos; + WW8_CP maCurrAttrCP; + bool mbOnLoadingMain:1; + //End of modification, by easyfan //--------------------------------------------- const SprmReadInfo& GetSprmReadInfo(sal_uInt16 nId) const; @@ -1422,8 +1440,15 @@ sal_uInt16 GetToggleBiDiAttrFlags() const; void SetToggleAttrFlags(sal_uInt16 nFlags); void SetToggleBiDiAttrFlags(sal_uInt16 nFlags); + //Modify here for #119405, by easyfan, 2012-05-24 + WW8_CP GetCurrAttrCP() const {return maCurrAttrCP;} + bool IsParaEndInCPs(sal_Int32 , sal_Int32,bool bSdOD=true) const; + //End of modification, by easyfan + //Modify for #119405 by chengjh, 2012-08-16 + //Clear the para end position recorded in reader intermittently for the least impact on loading performance + void ClearParaEndPosition(); + //End - long Read_Ftn(WW8PLCFManResult* pRes); sal_uInt16 End_Ftn(); long Read_Field(WW8PLCFManResult* pRes); Index: main/sw/source/filter/ww8/ww8par3.cxx =================================================================== --- main/sw/source/filter/ww8/ww8par3.cxx (revision 1374901) +++ main/sw/source/filter/ww8/ww8par3.cxx (working copy) @@ -1022,7 +1022,24 @@ // Style an das NumFormat haengen // aNumFmt.SetCharFmt( pFmt ); - } + } + //Modify for #119405 by chengjh, 2012-08-16 + //Ensure the default char fmt is initialized for any level of num ruler if no customized attr + else + { + SwCharFmt* pFmt = aNumFmt.GetCharFmt(); + if ( !pFmt) + { + String aName( sPrefix.Len() ? sPrefix : rNumRule.GetName() ); + (aName += 'z') += String::CreateFromInt32( nLevel ); + + pFmt = rDoc.MakeCharFmt(aName, (SwCharFmt*)rDoc.GetDfltCharFmt()); + bNewCharFmtCreated = true; + rCharFmt[ nLevel ] = pFmt; + aNumFmt.SetCharFmt( pFmt ); + } + } + //End // // ggfs. Bullet Font an das NumFormat haengen //