Lines 320-326
Link Here
|
320 |
//"_Toc*" and "_Hlt*" are unnecessary |
320 |
//"_Toc*" and "_Hlt*" are unnecessary |
321 |
const String* pName = pB->GetName(); |
321 |
const String* pName = pB->GetName(); |
322 |
#if !defined(WW_NATIVE_TOC) |
322 |
#if !defined(WW_NATIVE_TOC) |
323 |
if( !pName || pName->EqualsIgnoreCaseAscii( "_Toc", 0, 4 ) |
323 |
//Modify here for i119963, by ZF, 2012-06-13 |
|
|
324 |
//Now, as we read the TOC field completely, we also need the hyperlinks inside keep available. |
325 |
//So the hidden bookmarks inside for hyperlink jumping also should be kept. |
326 |
//former codes: |
327 |
//if( !pName || (pName->EqualsIgnoreCaseAscii( "_Toc", 0, 4 ) && maLinkSet.find(*pName)==maLinkSet.end()) |
328 |
if( !pName |
329 |
//End of modification, by ZF |
324 |
|| pName->EqualsIgnoreCaseAscii( "_Hlt", 0, 4 ) ) |
330 |
|| pName->EqualsIgnoreCaseAscii( "_Hlt", 0, 4 ) ) |
325 |
return 0; |
331 |
return 0; |
326 |
#endif |
332 |
#endif |
Lines 662-668
Link Here
|
662 |
sal_uInt16 nRet = 0; |
668 |
sal_uInt16 nRet = 0; |
663 |
WW8PLCFx_FLD* pF = pPlcxMan->GetFld(); |
669 |
WW8PLCFx_FLD* pF = pPlcxMan->GetFld(); |
664 |
ASSERT(pF, "WW8PLCFx_FLD - Pointer nicht da"); |
670 |
ASSERT(pF, "WW8PLCFx_FLD - Pointer nicht da"); |
665 |
if (!pF || !pF->EndPosIsFieldEnd()) |
671 |
WW8_CP nCP = 0; |
|
|
672 |
if (!pF || !pF->EndPosIsFieldEnd(nCP)) |
666 |
return nRet; |
673 |
return nRet; |
667 |
|
674 |
|
668 |
const SvtFilterOptions* pOpt = SvtFilterOptions::Get(); |
675 |
const SvtFilterOptions* pOpt = SvtFilterOptions::Get(); |
Lines 711-718
Link Here
|
711 |
} |
718 |
} |
712 |
break; |
719 |
break; |
713 |
#else |
720 |
#else |
|
|
721 |
//Modify here for i119963, by ZF, 2012-06-13 |
722 |
//Doing corresponding status management for TOC field, index field, hyperlink field and page reference field |
723 |
case 13://TOX |
724 |
case 8://index |
725 |
if (mbLoadingTOCCache) |
726 |
{ |
727 |
maTOXEndCps.insert(nCP); |
728 |
mbLoadingTOCCache = false; |
729 |
if (pPaM->End() && pPaM->End()->nNode.GetNode().GetTxtNode() && pPaM->End()->nNode.GetNode().GetTxtNode()->Len() == 0) |
730 |
JoinNode(*pPaM); |
731 |
|
732 |
if (mpPosAfterTOC) |
733 |
{ |
734 |
*pPaM = *mpPosAfterTOC; |
735 |
delete mpPosAfterTOC; |
736 |
mpPosAfterTOC = 0; |
737 |
} |
738 |
} |
739 |
break; |
740 |
case 37://REF |
741 |
if (mbLoadingTOCCache && !mbLoadingTOCHyperlink) |
742 |
{ |
743 |
pCtrlStck->SetAttr(*pPaM->GetPoint(),RES_TXTATR_INETFMT); |
744 |
} |
745 |
break; |
746 |
//End of modifications, by ZF |
714 |
case 88: |
747 |
case 88: |
|
|
748 |
//Modify here for i119963, by ZF, 2012-06-13 |
749 |
if (mbLoadingTOCHyperlink) |
750 |
mbLoadingTOCHyperlink = false; |
751 |
//End of modifications, by ZF |
715 |
pCtrlStck->SetAttr(*pPaM->GetPoint(),RES_TXTATR_INETFMT); |
752 |
pCtrlStck->SetAttr(*pPaM->GetPoint(),RES_TXTATR_INETFMT); |
|
|
753 |
|
716 |
break; |
754 |
break; |
717 |
#endif |
755 |
#endif |
718 |
case 36: |
756 |
case 36: |
Lines 732-741
Link Here
|
732 |
{ |
770 |
{ |
733 |
switch (nFieldCode) |
771 |
switch (nFieldCode) |
734 |
{ |
772 |
{ |
735 |
#if defined(WW_NATIVE_TOC) |
773 |
//#if defined(WW_NATIVE_TOC) |
736 |
case 8: // allow recursive field in TOC... |
774 |
case 8: // allow recursive field in TOC... |
737 |
case 13: // allow recursive field in TOC... |
775 |
case 13: // allow recursive field in TOC... |
738 |
#endif |
776 |
//#endif |
739 |
case 36: |
777 |
case 36: |
740 |
case 68: |
778 |
case 68: |
741 |
case 79: |
779 |
case 79: |
Lines 2123-2128
Link Here
|
2123 |
case -2: |
2161 |
case -2: |
2124 |
if( !sOrigName.Len() ) |
2162 |
if( !sOrigName.Len() ) |
2125 |
sOrigName = aReadParam.GetResult(); |
2163 |
sOrigName = aReadParam.GetResult(); |
|
|
2164 |
|
2126 |
break; |
2165 |
break; |
2127 |
} |
2166 |
} |
2128 |
} |
2167 |
} |
Lines 2138-2145
Link Here
|
2138 |
return FLD_TEXT; |
2177 |
return FLD_TEXT; |
2139 |
} |
2178 |
} |
2140 |
#endif |
2179 |
#endif |
|
|
2180 |
//Modify here for i119963, by ZF, 2012-06-13 |
2181 |
//loading page reference field in TOC |
2182 |
if (mbLoadingTOCCache ) |
2183 |
{ |
2184 |
//Step 1. Insert page ref representation as plain text |
2185 |
//Step 2. If there is no hyperlink settings for current toc, assign link to current ref area |
2186 |
if ( !mbLoadingTOCHyperlink) |
2187 |
{ |
2188 |
String sURL,sTarget; |
2189 |
if( sName.Len() ) |
2190 |
( sURL += INET_MARK_TOKEN ) += sName; |
2191 |
SwFmtINetFmt aURL( sURL, sTarget ); |
2192 |
String sLinkStyle = String::CreateFromAscii("Index Link"); |
2193 |
sal_uInt16 nPoolId = |
2194 |
SwStyleNameMapper::GetPoolIdFromUIName( sLinkStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT ); |
2195 |
aURL.SetVisitedFmt(sLinkStyle); |
2196 |
aURL.SetINetFmt(sLinkStyle); |
2197 |
aURL.SetVisitedFmtId(nPoolId); |
2198 |
aURL.SetINetFmtId(nPoolId); |
2199 |
pCtrlStck->NewAttr( *pPaM->GetPoint(), aURL ); |
2200 |
} |
2141 |
|
2201 |
|
|
|
2202 |
return FLD_TEXT; |
2203 |
} |
2204 |
//End of modifications, by ZF |
2142 |
|
2205 |
|
|
|
2206 |
|
2143 |
SwGetRefField aFld( |
2207 |
SwGetRefField aFld( |
2144 |
(SwGetRefFieldType*)rDoc.GetSysFldType( RES_GETREFFLD ), sName, |
2208 |
(SwGetRefFieldType*)rDoc.GetSysFldType( RES_GETREFFLD ), sName, |
2145 |
REF_BOOKMARK, 0, REF_PAGE ); |
2209 |
REF_BOOKMARK, 0, REF_PAGE ); |
Lines 2840-2845
Link Here
|
2840 |
|
2904 |
|
2841 |
eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr ) |
2905 |
eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr ) |
2842 |
{ |
2906 |
{ |
|
|
2907 |
//Modify here for i119963, by ZF, 2012-06-13 |
2908 |
mbLoadingTOCCache = true; |
2909 |
//End of modifications, by ZF |
2843 |
#if defined(WW_NATIVE_TOC) |
2910 |
#if defined(WW_NATIVE_TOC) |
2844 |
if (1) { |
2911 |
if (1) { |
2845 |
::rtl::OUString aBookmarkName=::rtl::OUString::createFromAscii("_TOC"); |
2912 |
::rtl::OUString aBookmarkName=::rtl::OUString::createFromAscii("_TOC"); |
Lines 2979-2984
Link Here
|
2979 |
case TOX_CONTENT: |
3046 |
case TOX_CONTENT: |
2980 |
{ |
3047 |
{ |
2981 |
bool bIsHyperlink = false; |
3048 |
bool bIsHyperlink = false; |
|
|
3049 |
bool bShowPage = true; |
2982 |
// TOX_OUTLINELEVEL setzen wir genau dann, wenn |
3050 |
// TOX_OUTLINELEVEL setzen wir genau dann, wenn |
2983 |
// die Parameter \o in 1 bis 9 liegen |
3051 |
// die Parameter \o in 1 bis 9 liegen |
2984 |
// oder der Parameter \f existiert |
3052 |
// oder der Parameter \f existiert |
Lines 3088-3093
Link Here
|
3088 |
case 'n': // don't print page numbers |
3156 |
case 'n': // don't print page numbers |
3089 |
{ |
3157 |
{ |
3090 |
// read START and END param |
3158 |
// read START and END param |
|
|
3159 |
bShowPage = false; |
3091 |
sal_uInt16 nStart, nEnd; |
3160 |
sal_uInt16 nStart, nEnd; |
3092 |
if( !aReadParam.GetTokenSttFromTo( &nStart, &nEnd, |
3161 |
if( !aReadParam.GetTokenSttFromTo( &nStart, &nEnd, |
3093 |
WW8ListManager::nMaxLevel ) ) |
3162 |
WW8ListManager::nMaxLevel ) ) |
Lines 3149-3156
Link Here
|
3149 |
*/ |
3218 |
*/ |
3150 |
} |
3219 |
} |
3151 |
} |
3220 |
} |
3152 |
|
3221 |
//Modify here for i119963, by ZF, 2012-06-13 |
3153 |
if (bIsHyperlink) |
3222 |
//For loading the expression of TOC field, we need to mapping its parameters to TOX entries tokens |
|
|
3223 |
//also include the hyperlinks and page references |
3224 |
//Former codes: |
3225 |
/* |
3226 |
if (bIsHyperlink) |
3154 |
{ |
3227 |
{ |
3155 |
SwForm aForm(pBase->GetTOXForm()); |
3228 |
SwForm aForm(pBase->GetTOXForm()); |
3156 |
sal_uInt16 nEnd = aForm.GetFormMax()-1; |
3229 |
sal_uInt16 nEnd = aForm.GetFormMax()-1; |
Lines 3171-3177
Link Here
|
3171 |
// <- #i21237# |
3244 |
// <- #i21237# |
3172 |
pBase->SetTOXForm(aForm); |
3245 |
pBase->SetTOXForm(aForm); |
3173 |
} |
3246 |
} |
|
|
3247 |
*/ |
3174 |
|
3248 |
|
|
|
3249 |
SwFormToken aLinkStart(TOKEN_LINK_START); |
3250 |
SwFormToken aLinkEnd(TOKEN_LINK_END); |
3251 |
aLinkStart.sCharStyleName = String::CreateFromAscii("Index Link"); |
3252 |
aLinkEnd.sCharStyleName = String::CreateFromAscii("Index Link"); |
3253 |
SwForm aForm(pBase->GetTOXForm()); |
3254 |
sal_uInt16 nEnd = aForm.GetFormMax()-1; |
3255 |
|
3256 |
// -> #i21237# |
3257 |
for(sal_uInt16 nLevel = 1; (bIsHyperlink || bShowPage) && nLevel <= nEnd; ++nLevel) |
3258 |
{ |
3259 |
SwFormTokens aPattern = aForm.GetPattern(nLevel); |
3260 |
if (bIsHyperlink) |
3261 |
aPattern.insert(aPattern.begin(), aLinkStart); |
3262 |
else if (bShowPage) |
3263 |
{ |
3264 |
for (SwFormTokens::iterator aItr = aPattern.begin();aItr!= aPattern.end();aItr++) |
3265 |
{ |
3266 |
if (aItr->eTokenType == TOKEN_PAGE_NUMS) |
3267 |
{ |
3268 |
aPattern.insert(aItr,aLinkStart); |
3269 |
break; |
3270 |
} |
3271 |
} |
3272 |
} |
3273 |
aPattern.push_back(aLinkEnd); |
3274 |
|
3275 |
aForm.SetPattern(nLevel, aPattern); |
3276 |
|
3277 |
} |
3278 |
|
3279 |
// <- #i21237# |
3280 |
pBase->SetTOXForm(aForm); |
3281 |
//End of modifications, by ZF |
3282 |
|
3175 |
if (!nMaxLevel) |
3283 |
if (!nMaxLevel) |
3176 |
nMaxLevel = WW8ListManager::nMaxLevel; |
3284 |
nMaxLevel = WW8ListManager::nMaxLevel; |
3177 |
pBase->SetLevel(nMaxLevel); |
3285 |
pBase->SetLevel(nMaxLevel); |
Lines 3288-3294
Link Here
|
3288 |
} // ToxBase fertig |
3396 |
} // ToxBase fertig |
3289 |
|
3397 |
|
3290 |
// Update fuer TOX anstossen |
3398 |
// Update fuer TOX anstossen |
3291 |
rDoc.SetUpdateTOX(true); |
3399 |
//Modify here for i119963, by ZF, 2012-06-13 |
|
|
3400 |
//Commont out following TOC update statement, for the content inside TOC field was parsing directly from document |
3401 |
//rDoc.SetUpdateTOX(true); |
3402 |
//End of modification of TOC contents cacsh parsing improvement, by ZF |
3292 |
|
3403 |
|
3293 |
// #i21237# |
3404 |
// #i21237# |
3294 |
// propagate tab stops from paragraph styles used in TOX to |
3405 |
// propagate tab stops from paragraph styles used in TOX to |
Lines 3327-3339
Link Here
|
3327 |
|
3438 |
|
3328 |
rDoc.InsertTableOf(*pPaM->GetPoint(), *aFltTOX.GetBase()); |
3439 |
rDoc.InsertTableOf(*pPaM->GetPoint(), *aFltTOX.GetBase()); |
3329 |
|
3440 |
|
|
|
3441 |
|
3330 |
//inserting a toc inserts a section before this point, so adjust pos |
3442 |
//inserting a toc inserts a section before this point, so adjust pos |
3331 |
//for future page/section segment insertion |
3443 |
//for future page/section segment insertion |
|
|
3444 |
//Modify here for i119963, by ZF, 2012-06-13 |
3445 |
//The TOC field representation contents should be inserted into TOC section, but not after TOC section. |
3446 |
//So we need update the document position when loading TOC representation and after loading TOC; |
3447 |
//Former codes: |
3448 |
/* |
3332 |
SwPaM aRegion(*pPaM); |
3449 |
SwPaM aRegion(*pPaM); |
3333 |
aRegion.Move(fnMoveBackward); |
3450 |
aRegion.Move(fnMoveBackward); |
|
|
3451 |
*/ |
3452 |
if (mpPosAfterTOC) |
3453 |
delete mpPosAfterTOC; |
3454 |
mpPosAfterTOC = new SwPaM(*pPaM); |
3455 |
(*pPaM).Move(fnMoveBackward); |
3456 |
SwPaM aRegion(*pPaM); |
3457 |
//End of modifications, by ZF |
3334 |
ASSERT(rDoc.GetCurTOX(*aRegion.GetPoint()), "Misunderstood how toc works"); |
3458 |
ASSERT(rDoc.GetCurTOX(*aRegion.GetPoint()), "Misunderstood how toc works"); |
3335 |
if (SwTOXBase* pBase2 = (SwTOXBase*)rDoc.GetCurTOX(*aRegion.GetPoint())) |
3459 |
if (SwTOXBase* pBase2 = (SwTOXBase*)rDoc.GetCurTOX(*aRegion.GetPoint())) |
3336 |
{ |
3460 |
{ |
|
|
3461 |
//Modify here for i119963, by ZF, 2012-06-13 |
3462 |
pBase2->SetMSTOCExpression(rStr); |
3463 |
//End of modification, by ZF |
3337 |
if(nIndexCols>1) |
3464 |
if(nIndexCols>1) |
3338 |
{ |
3465 |
{ |
3339 |
// Set the column number for index |
3466 |
// Set the column number for index |
Lines 3353-3359
Link Here
|
3353 |
|
3480 |
|
3354 |
if (!maApos.back()) //a para end in apo doesn't count |
3481 |
if (!maApos.back()) //a para end in apo doesn't count |
3355 |
bWasParaEnd = true; |
3482 |
bWasParaEnd = true; |
3356 |
return FLD_OK; |
3483 |
//Modify here for i119963, by ZF, 2012-06-13 |
|
|
3484 |
//Reture FLD_TEXT, instead of FLD_OK |
3485 |
//FLD_TEXT means the following content, commonly indicate the field representation content should be parsed |
3486 |
//FLD_OK means the current field loading is finished. The rest part should be ignored. |
3487 |
//Former codes: |
3488 |
//return FLD_OK; |
3489 |
//End of modifications, by ZF |
3490 |
return FLD_TEXT; |
3357 |
} |
3491 |
} |
3358 |
|
3492 |
|
3359 |
eF_ResT SwWW8ImplReader::Read_F_Shape(WW8FieldDesc* /*pF*/, String& /*rStr*/) |
3493 |
eF_ResT SwWW8ImplReader::Read_F_Shape(WW8FieldDesc* /*pF*/, String& /*rStr*/) |
Lines 3412-3417
Link Here
|
3412 |
if( sMark.Len() && '"' == sMark.GetChar( sMark.Len()-1 )) |
3546 |
if( sMark.Len() && '"' == sMark.GetChar( sMark.Len()-1 )) |
3413 |
sMark.Erase( sMark.Len() - 1 ); |
3547 |
sMark.Erase( sMark.Len() - 1 ); |
3414 |
|
3548 |
|
|
|
3549 |
//Modify here for i119963, by ZF, 2012-06-13 |
3550 |
if (mbLoadingTOCCache) |
3551 |
{ |
3552 |
mbLoadingTOCHyperlink = true;//on loading a TOC field nested hyperlink field |
3553 |
} |
3554 |
//End of modifications, by ZF |
3555 |
|
3415 |
} |
3556 |
} |
3416 |
break; |
3557 |
break; |
3417 |
case 't': |
3558 |
case 't': |
Lines 3437-3442
Link Here
|
3437 |
( sURL += INET_MARK_TOKEN ) += sMark; |
3578 |
( sURL += INET_MARK_TOKEN ) += sMark; |
3438 |
|
3579 |
|
3439 |
SwFmtINetFmt aURL( sURL, sTarget ); |
3580 |
SwFmtINetFmt aURL( sURL, sTarget ); |
|
|
3581 |
//Modify here for i119963, by ZF, 2012-06-13 |
3582 |
//If on loading TOC field, change the default style into the "index link" |
3583 |
if (mbLoadingTOCCache) |
3584 |
{ |
3585 |
String sLinkStyle = String::CreateFromAscii("Index Link"); |
3586 |
sal_uInt16 nPoolId = |
3587 |
SwStyleNameMapper::GetPoolIdFromUIName( sLinkStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT ); |
3588 |
aURL.SetVisitedFmt(sLinkStyle); |
3589 |
aURL.SetINetFmt(sLinkStyle); |
3590 |
aURL.SetVisitedFmtId(nPoolId); |
3591 |
aURL.SetINetFmtId(nPoolId); |
3592 |
} |
3593 |
//End of modifications, by ZF |
3440 |
|
3594 |
|
3441 |
//As an attribute this needs to be closed, and that'll happen from |
3595 |
//As an attribute this needs to be closed, and that'll happen from |
3442 |
//EndExtSprm in conjunction with the maFieldStack If there are are flyfrms |
3596 |
//EndExtSprm in conjunction with the maFieldStack If there are are flyfrms |