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 |
else |
732 |
mbCareLastParaEndInToc = true; |
733 |
|
734 |
if (mpPosAfterTOC) |
735 |
{ |
736 |
*pPaM = *mpPosAfterTOC; |
737 |
delete mpPosAfterTOC; |
738 |
mpPosAfterTOC = 0; |
739 |
} |
740 |
} |
741 |
break; |
742 |
case 37://REF |
743 |
if (mbLoadingTOCCache && !mbLoadingTOCHyperlink) |
744 |
{ |
745 |
pCtrlStck->SetAttr(*pPaM->GetPoint(),RES_TXTATR_INETFMT); |
746 |
} |
747 |
break; |
748 |
//End of modifications, by ZF |
714 |
case 88: |
749 |
case 88: |
|
|
750 |
//Modify here for i119963, by ZF, 2012-06-13 |
751 |
if (mbLoadingTOCHyperlink) |
752 |
mbLoadingTOCHyperlink = false; |
753 |
//End of modifications, by ZF |
715 |
pCtrlStck->SetAttr(*pPaM->GetPoint(),RES_TXTATR_INETFMT); |
754 |
pCtrlStck->SetAttr(*pPaM->GetPoint(),RES_TXTATR_INETFMT); |
|
|
755 |
|
716 |
break; |
756 |
break; |
717 |
#endif |
757 |
#endif |
718 |
case 36: |
758 |
case 36: |
Lines 732-741
Link Here
|
732 |
{ |
772 |
{ |
733 |
switch (nFieldCode) |
773 |
switch (nFieldCode) |
734 |
{ |
774 |
{ |
735 |
#if defined(WW_NATIVE_TOC) |
775 |
//#if defined(WW_NATIVE_TOC) |
736 |
case 8: // allow recursive field in TOC... |
776 |
case 8: // allow recursive field in TOC... |
737 |
case 13: // allow recursive field in TOC... |
777 |
case 13: // allow recursive field in TOC... |
738 |
#endif |
778 |
//#endif |
739 |
case 36: |
779 |
case 36: |
740 |
case 68: |
780 |
case 68: |
741 |
case 79: |
781 |
case 79: |
Lines 2123-2128
Link Here
|
2123 |
case -2: |
2163 |
case -2: |
2124 |
if( !sOrigName.Len() ) |
2164 |
if( !sOrigName.Len() ) |
2125 |
sOrigName = aReadParam.GetResult(); |
2165 |
sOrigName = aReadParam.GetResult(); |
|
|
2166 |
|
2126 |
break; |
2167 |
break; |
2127 |
} |
2168 |
} |
2128 |
} |
2169 |
} |
Lines 2138-2145
Link Here
|
2138 |
return FLD_TEXT; |
2179 |
return FLD_TEXT; |
2139 |
} |
2180 |
} |
2140 |
#endif |
2181 |
#endif |
|
|
2182 |
//Modify here for i119963, by ZF, 2012-06-13 |
2183 |
//loading page reference field in TOC |
2184 |
if (mbLoadingTOCCache ) |
2185 |
{ |
2186 |
//Step 1. Insert page ref representation as plain text |
2187 |
//Step 2. If there is no hyperlink settings for current toc, assign link to current ref area |
2188 |
if ( !mbLoadingTOCHyperlink) |
2189 |
{ |
2190 |
String sURL,sTarget; |
2191 |
if( sName.Len() ) |
2192 |
( sURL += INET_MARK_TOKEN ) += sName; |
2193 |
SwFmtINetFmt aURL( sURL, sTarget ); |
2194 |
String sLinkStyle = String::CreateFromAscii("Index Link"); |
2195 |
sal_uInt16 nPoolId = |
2196 |
SwStyleNameMapper::GetPoolIdFromUIName( sLinkStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT ); |
2197 |
aURL.SetVisitedFmt(sLinkStyle); |
2198 |
aURL.SetINetFmt(sLinkStyle); |
2199 |
aURL.SetVisitedFmtId(nPoolId); |
2200 |
aURL.SetINetFmtId(nPoolId); |
2201 |
pCtrlStck->NewAttr( *pPaM->GetPoint(), aURL ); |
2202 |
} |
2141 |
|
2203 |
|
|
|
2204 |
return FLD_TEXT; |
2205 |
} |
2206 |
//End of modifications, by ZF |
2142 |
|
2207 |
|
|
|
2208 |
|
2143 |
SwGetRefField aFld( |
2209 |
SwGetRefField aFld( |
2144 |
(SwGetRefFieldType*)rDoc.GetSysFldType( RES_GETREFFLD ), sName, |
2210 |
(SwGetRefFieldType*)rDoc.GetSysFldType( RES_GETREFFLD ), sName, |
2145 |
REF_BOOKMARK, 0, REF_PAGE ); |
2211 |
REF_BOOKMARK, 0, REF_PAGE ); |
Lines 2840-2845
Link Here
|
2840 |
|
2906 |
|
2841 |
eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr ) |
2907 |
eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr ) |
2842 |
{ |
2908 |
{ |
|
|
2909 |
//Modify here for i119963, by ZF, 2012-06-13 |
2910 |
mbLoadingTOCCache = true; |
2911 |
//End of modifications, by ZF |
2843 |
#if defined(WW_NATIVE_TOC) |
2912 |
#if defined(WW_NATIVE_TOC) |
2844 |
if (1) { |
2913 |
if (1) { |
2845 |
::rtl::OUString aBookmarkName=::rtl::OUString::createFromAscii("_TOC"); |
2914 |
::rtl::OUString aBookmarkName=::rtl::OUString::createFromAscii("_TOC"); |
Lines 2979-2984
Link Here
|
2979 |
case TOX_CONTENT: |
3048 |
case TOX_CONTENT: |
2980 |
{ |
3049 |
{ |
2981 |
bool bIsHyperlink = false; |
3050 |
bool bIsHyperlink = false; |
|
|
3051 |
bool bShowPage = true; |
2982 |
// TOX_OUTLINELEVEL setzen wir genau dann, wenn |
3052 |
// TOX_OUTLINELEVEL setzen wir genau dann, wenn |
2983 |
// die Parameter \o in 1 bis 9 liegen |
3053 |
// die Parameter \o in 1 bis 9 liegen |
2984 |
// oder der Parameter \f existiert |
3054 |
// oder der Parameter \f existiert |
Lines 3088-3093
Link Here
|
3088 |
case 'n': // don't print page numbers |
3158 |
case 'n': // don't print page numbers |
3089 |
{ |
3159 |
{ |
3090 |
// read START and END param |
3160 |
// read START and END param |
|
|
3161 |
bShowPage = false; |
3091 |
sal_uInt16 nStart, nEnd; |
3162 |
sal_uInt16 nStart, nEnd; |
3092 |
if( !aReadParam.GetTokenSttFromTo( &nStart, &nEnd, |
3163 |
if( !aReadParam.GetTokenSttFromTo( &nStart, &nEnd, |
3093 |
WW8ListManager::nMaxLevel ) ) |
3164 |
WW8ListManager::nMaxLevel ) ) |
Lines 3149-3156
Link Here
|
3149 |
*/ |
3220 |
*/ |
3150 |
} |
3221 |
} |
3151 |
} |
3222 |
} |
3152 |
|
3223 |
//Modify here for i119963, by ZF, 2012-06-13 |
3153 |
if (bIsHyperlink) |
3224 |
//For loading the expression of TOC field, we need to mapping its parameters to TOX entries tokens |
|
|
3225 |
//also include the hyperlinks and page references |
3226 |
//Former codes: |
3227 |
/* |
3228 |
if (bIsHyperlink) |
3154 |
{ |
3229 |
{ |
3155 |
SwForm aForm(pBase->GetTOXForm()); |
3230 |
SwForm aForm(pBase->GetTOXForm()); |
3156 |
sal_uInt16 nEnd = aForm.GetFormMax()-1; |
3231 |
sal_uInt16 nEnd = aForm.GetFormMax()-1; |
Lines 3171-3177
Link Here
|
3171 |
// <- #i21237# |
3246 |
// <- #i21237# |
3172 |
pBase->SetTOXForm(aForm); |
3247 |
pBase->SetTOXForm(aForm); |
3173 |
} |
3248 |
} |
|
|
3249 |
*/ |
3174 |
|
3250 |
|
|
|
3251 |
SwFormToken aLinkStart(TOKEN_LINK_START); |
3252 |
SwFormToken aLinkEnd(TOKEN_LINK_END); |
3253 |
aLinkStart.sCharStyleName = String::CreateFromAscii("Index Link"); |
3254 |
aLinkEnd.sCharStyleName = String::CreateFromAscii("Index Link"); |
3255 |
SwForm aForm(pBase->GetTOXForm()); |
3256 |
sal_uInt16 nEnd = aForm.GetFormMax()-1; |
3257 |
|
3258 |
// -> #i21237# |
3259 |
for(sal_uInt16 nLevel = 1; (bIsHyperlink || bShowPage) && nLevel <= nEnd; ++nLevel) |
3260 |
{ |
3261 |
SwFormTokens aPattern = aForm.GetPattern(nLevel); |
3262 |
if (bIsHyperlink) |
3263 |
aPattern.insert(aPattern.begin(), aLinkStart); |
3264 |
else if (bShowPage) |
3265 |
{ |
3266 |
for (SwFormTokens::iterator aItr = aPattern.begin();aItr!= aPattern.end();aItr++) |
3267 |
{ |
3268 |
if (aItr->eTokenType == TOKEN_PAGE_NUMS) |
3269 |
{ |
3270 |
aPattern.insert(aItr,aLinkStart); |
3271 |
break; |
3272 |
} |
3273 |
} |
3274 |
} |
3275 |
aPattern.push_back(aLinkEnd); |
3276 |
|
3277 |
aForm.SetPattern(nLevel, aPattern); |
3278 |
|
3279 |
} |
3280 |
|
3281 |
// <- #i21237# |
3282 |
pBase->SetTOXForm(aForm); |
3283 |
//End of modifications, by ZF |
3284 |
|
3175 |
if (!nMaxLevel) |
3285 |
if (!nMaxLevel) |
3176 |
nMaxLevel = WW8ListManager::nMaxLevel; |
3286 |
nMaxLevel = WW8ListManager::nMaxLevel; |
3177 |
pBase->SetLevel(nMaxLevel); |
3287 |
pBase->SetLevel(nMaxLevel); |
Lines 3288-3294
Link Here
|
3288 |
} // ToxBase fertig |
3398 |
} // ToxBase fertig |
3289 |
|
3399 |
|
3290 |
// Update fuer TOX anstossen |
3400 |
// Update fuer TOX anstossen |
3291 |
rDoc.SetUpdateTOX(true); |
3401 |
//Modify here for i119963, by ZF, 2012-06-13 |
|
|
3402 |
//Commont out following TOC update statement, for the content inside TOC field was parsing directly from document |
3403 |
//rDoc.SetUpdateTOX(true); |
3404 |
//End of modification of TOC contents cacsh parsing improvement, by ZF |
3292 |
|
3405 |
|
3293 |
// #i21237# |
3406 |
// #i21237# |
3294 |
// propagate tab stops from paragraph styles used in TOX to |
3407 |
// propagate tab stops from paragraph styles used in TOX to |
Lines 3297-3302
Link Here
|
3297 |
|
3410 |
|
3298 |
//#i10028# inserting a toc implicltly acts like a parabreak |
3411 |
//#i10028# inserting a toc implicltly acts like a parabreak |
3299 |
//in word and writer |
3412 |
//in word and writer |
|
|
3413 |
|
3414 |
if (pPaM->End() && pPaM->End()->nNode.GetNode().GetTxtNode() && pPaM->End()->nNode.GetNode().GetTxtNode()->Len() != 0) |
3415 |
{ |
3416 |
mbCareFirstParaEndInToc = true; |
3417 |
} |
3418 |
|
3300 |
if (pPaM->GetPoint()->nContent.GetIndex()) |
3419 |
if (pPaM->GetPoint()->nContent.GetIndex()) |
3301 |
AppendTxtNode(*pPaM->GetPoint()); |
3420 |
AppendTxtNode(*pPaM->GetPoint()); |
3302 |
|
3421 |
|
Lines 3325-3339
Link Here
|
3325 |
// Setze Anfang in Stack |
3444 |
// Setze Anfang in Stack |
3326 |
pReffedStck->NewAttr( *pPos, aFltTOX ); |
3445 |
pReffedStck->NewAttr( *pPos, aFltTOX ); |
3327 |
|
3446 |
|
|
|
3447 |
|
3448 |
|
3328 |
rDoc.InsertTableOf(*pPaM->GetPoint(), *aFltTOX.GetBase()); |
3449 |
rDoc.InsertTableOf(*pPaM->GetPoint(), *aFltTOX.GetBase()); |
3329 |
|
3450 |
|
|
|
3451 |
|
3330 |
//inserting a toc inserts a section before this point, so adjust pos |
3452 |
//inserting a toc inserts a section before this point, so adjust pos |
3331 |
//for future page/section segment insertion |
3453 |
//for future page/section segment insertion |
|
|
3454 |
//Modify here for i119963, by ZF, 2012-06-13 |
3455 |
//The TOC field representation contents should be inserted into TOC section, but not after TOC section. |
3456 |
//So we need update the document position when loading TOC representation and after loading TOC; |
3457 |
//Former codes: |
3458 |
/* |
3332 |
SwPaM aRegion(*pPaM); |
3459 |
SwPaM aRegion(*pPaM); |
3333 |
aRegion.Move(fnMoveBackward); |
3460 |
aRegion.Move(fnMoveBackward); |
|
|
3461 |
*/ |
3462 |
if (mpPosAfterTOC) |
3463 |
delete mpPosAfterTOC; |
3464 |
mpPosAfterTOC = new SwPaM(*pPaM); |
3465 |
(*pPaM).Move(fnMoveBackward); |
3466 |
SwPaM aRegion(*pPaM); |
3467 |
//End of modifications, by ZF |
3334 |
ASSERT(rDoc.GetCurTOX(*aRegion.GetPoint()), "Misunderstood how toc works"); |
3468 |
ASSERT(rDoc.GetCurTOX(*aRegion.GetPoint()), "Misunderstood how toc works"); |
3335 |
if (SwTOXBase* pBase2 = (SwTOXBase*)rDoc.GetCurTOX(*aRegion.GetPoint())) |
3469 |
if (SwTOXBase* pBase2 = (SwTOXBase*)rDoc.GetCurTOX(*aRegion.GetPoint())) |
3336 |
{ |
3470 |
{ |
|
|
3471 |
//Modify here for i119963, by ZF, 2012-06-13 |
3472 |
pBase2->SetMSTOCExpression(rStr); |
3473 |
//End of modification, by ZF |
3337 |
if(nIndexCols>1) |
3474 |
if(nIndexCols>1) |
3338 |
{ |
3475 |
{ |
3339 |
// Set the column number for index |
3476 |
// Set the column number for index |
Lines 3353-3359
Link Here
|
3353 |
|
3490 |
|
3354 |
if (!maApos.back()) //a para end in apo doesn't count |
3491 |
if (!maApos.back()) //a para end in apo doesn't count |
3355 |
bWasParaEnd = true; |
3492 |
bWasParaEnd = true; |
3356 |
return FLD_OK; |
3493 |
//Modify here for i119963, by ZF, 2012-06-13 |
|
|
3494 |
//Reture FLD_TEXT, instead of FLD_OK |
3495 |
//FLD_TEXT means the following content, commonly indicate the field representation content should be parsed |
3496 |
//FLD_OK means the current field loading is finished. The rest part should be ignored. |
3497 |
//Former codes: |
3498 |
//return FLD_OK; |
3499 |
//End of modifications, by ZF |
3500 |
return FLD_TEXT; |
3357 |
} |
3501 |
} |
3358 |
|
3502 |
|
3359 |
eF_ResT SwWW8ImplReader::Read_F_Shape(WW8FieldDesc* /*pF*/, String& /*rStr*/) |
3503 |
eF_ResT SwWW8ImplReader::Read_F_Shape(WW8FieldDesc* /*pF*/, String& /*rStr*/) |
Lines 3412-3417
Link Here
|
3412 |
if( sMark.Len() && '"' == sMark.GetChar( sMark.Len()-1 )) |
3556 |
if( sMark.Len() && '"' == sMark.GetChar( sMark.Len()-1 )) |
3413 |
sMark.Erase( sMark.Len() - 1 ); |
3557 |
sMark.Erase( sMark.Len() - 1 ); |
3414 |
|
3558 |
|
|
|
3559 |
//Modify here for i119963, by ZF, 2012-06-13 |
3560 |
if (mbLoadingTOCCache) |
3561 |
{ |
3562 |
mbLoadingTOCHyperlink = true;//on loading a TOC field nested hyperlink field |
3563 |
} |
3564 |
//End of modifications, by ZF |
3565 |
|
3415 |
} |
3566 |
} |
3416 |
break; |
3567 |
break; |
3417 |
case 't': |
3568 |
case 't': |
Lines 3437-3442
Link Here
|
3437 |
( sURL += INET_MARK_TOKEN ) += sMark; |
3588 |
( sURL += INET_MARK_TOKEN ) += sMark; |
3438 |
|
3589 |
|
3439 |
SwFmtINetFmt aURL( sURL, sTarget ); |
3590 |
SwFmtINetFmt aURL( sURL, sTarget ); |
|
|
3591 |
//Modify here for i119963, by ZF, 2012-06-13 |
3592 |
//If on loading TOC field, change the default style into the "index link" |
3593 |
if (mbLoadingTOCCache) |
3594 |
{ |
3595 |
String sLinkStyle = String::CreateFromAscii("Index Link"); |
3596 |
sal_uInt16 nPoolId = |
3597 |
SwStyleNameMapper::GetPoolIdFromUIName( sLinkStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT ); |
3598 |
aURL.SetVisitedFmt(sLinkStyle); |
3599 |
aURL.SetINetFmt(sLinkStyle); |
3600 |
aURL.SetVisitedFmtId(nPoolId); |
3601 |
aURL.SetINetFmtId(nPoolId); |
3602 |
} |
3603 |
//End of modifications, by ZF |
3440 |
|
3604 |
|
3441 |
//As an attribute this needs to be closed, and that'll happen from |
3605 |
//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 |
3606 |
//EndExtSprm in conjunction with the maFieldStack If there are are flyfrms |