Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

700 lines
20 KiB

  1. /* LSDNTEXT.C */
  2. #include "lsdntext.h"
  3. #include "lsidefs.h"
  4. #include "lsc.h"
  5. #include "lsdnode.h"
  6. #include "iobj.h"
  7. #include "dninfo.h"
  8. #include "getfmtst.h"
  9. #include "setfmtst.h"
  10. #include "chnutils.h"
  11. #include "dnutils.h"
  12. #include "break.h"
  13. static LSERR ResetDcpCore(PLSC plsc, PLSDNODE plsdn, LSCP cpFirstNew,
  14. LSDCP dcpNew, BOOL fMerge);
  15. /* L S D N S E T T E X T D U P*/
  16. /*----------------------------------------------------------------------------
  17. %%Function: LsdnSetTextDup
  18. %%Contact: igorzv
  19. Parameters:
  20. plsc - (IN) ptr to line services context
  21. plsdn - (IN) Pointer to the dnode
  22. dup - (IN) dup to be set
  23. Set dup in dnode
  24. ----------------------------------------------------------------------------*/
  25. LSERR LsdnSetTextDup(PLSC plsc, PLSDNODE plsdn, long dup)
  26. {
  27. Unreferenced(plsc); /* to avoid warning in shiping version */
  28. Assert(FIsLSC(plsc));
  29. Assert(FIsLSDNODE(plsdn));
  30. Assert(FIsDnodeReal(plsdn));
  31. Assert(IobjTextFromLsc(&plsc->lsiobjcontext) == IdObjFromDnode(plsdn));
  32. Assert(dup >= 0);
  33. plsdn->u.real.dup = dup;
  34. return lserrNone;
  35. }
  36. /* L S D N M O D I F Y T E X T D U P*/
  37. /*----------------------------------------------------------------------------
  38. %%Function: LsdnModifyTextDup
  39. %%Contact: igorzv
  40. Parameters:
  41. plsc - (IN) ptr to line services context
  42. plsdn - (IN) Pointer to the dnode
  43. ddup - (IN) ddup
  44. modify dup in dnode
  45. ----------------------------------------------------------------------------*/
  46. LSERR LsdnModifyTextDup(PLSC plsc, PLSDNODE plsdn, long ddup)
  47. {
  48. Unreferenced(plsc); /* to avoid warning in shiping version */
  49. Assert(FIsLSC(plsc));
  50. Assert(FIsLSDNODE(plsdn));
  51. Assert(FIsDnodeReal(plsdn));
  52. Assert(IobjTextFromLsc(&plsc->lsiobjcontext) == IdObjFromDnode(plsdn));
  53. plsdn->u.real.dup += ddup;
  54. Assert(plsdn->u.real.dup >= 0);
  55. return lserrNone;
  56. }
  57. /* L S D N G E T O B J D I M */
  58. /*----------------------------------------------------------------------------
  59. %%Function: LsdnGetObjDim
  60. %%Contact: igorzv
  61. Parameters:
  62. plsc - (IN) ptr to line services context
  63. plsdn - (IN) Pointer to the dnode
  64. pobjdim - (OUT) dimensions of DNODE
  65. return objdim of dnode
  66. ----------------------------------------------------------------------------*/
  67. LSERR LsdnGetObjDim(PLSC plsc, PLSDNODE plsdn, POBJDIM pobjdim )
  68. {
  69. Unreferenced(plsc); /* to avoid warning in shiping version */
  70. Assert(FIsLSC(plsc));
  71. Assert(FIsLSDNODE(plsdn));
  72. Assert(FIsDnodeReal(plsdn));
  73. Assert(IobjTextFromLsc(&plsc->lsiobjcontext) == IdObjFromDnode(plsdn));
  74. *pobjdim = plsdn->u.real.objdim;
  75. return lserrNone;
  76. }
  77. /* L S D N G E T C P F I R S T*/
  78. /*----------------------------------------------------------------------------
  79. %%Function: LsdnGetObjDim
  80. %%Contact: igorzv
  81. Parameters:
  82. plsc - (IN) ptr to line services context
  83. plsdn - (IN) Pointer to the dnode
  84. pcpFirst - (OUT) cpFirst of this DNODE
  85. return cpFirst of dnode
  86. ----------------------------------------------------------------------------*/
  87. LSERR LsdnGetCpFirst(PLSC plsc, PLSDNODE plsdn, LSCP* pcpFirst )
  88. {
  89. Unreferenced(plsc); /* to avoid warning in shiping version */
  90. Assert(FIsLSC(plsc));
  91. Assert(FIsLSDNODE(plsdn));
  92. Assert(FIsDnodeReal(plsdn));
  93. Assert(IobjTextFromLsc(&plsc->lsiobjcontext) == IdObjFromDnode(plsdn));
  94. *pcpFirst = plsdn->cpFirst;
  95. return lserrNone;
  96. }
  97. /* L S D N G E T P L S R U N*/
  98. /*----------------------------------------------------------------------------
  99. %%Function: LsdnGetPlsrun
  100. %%Contact: igorzv
  101. Parameters:
  102. plsc - (IN) ptr to line services context
  103. plsdn - (IN) Pointer to the dnode
  104. pplsrun - (OUT) plsrun of this DNODE
  105. return cpFirst of dnode
  106. ----------------------------------------------------------------------------*/
  107. LSERR LsdnGetPlsrun(PLSC plsc, PLSDNODE plsdn, PLSRUN* pplsrun )
  108. {
  109. Unreferenced(plsc); /* to avoid warning in shiping version */
  110. Assert(FIsLSC(plsc));
  111. Assert(FIsLSDNODE(plsdn));
  112. Assert(FIsDnodeReal(plsdn));
  113. Assert(IobjTextFromLsc(&plsc->lsiobjcontext) == IdObjFromDnode(plsdn));
  114. *pplsrun = plsdn->u.real.plsrun;
  115. return lserrNone;
  116. }
  117. /* L S D N M O D I F Y S I M P L E W I D T H*/
  118. /*----------------------------------------------------------------------------
  119. %%Function: LsdnModifySimpleWidth
  120. %%Contact: igorzv
  121. Parameters:
  122. plsc - (IN) ptr to line services context
  123. plsdn - (IN) Pointer to the dnode
  124. ddur - (IN) ddur
  125. modify dur in dnode
  126. ----------------------------------------------------------------------------*/
  127. LSERR LsdnModifySimpleWidth(PLSC plsc, PLSDNODE plsdn, long ddur)
  128. {
  129. Assert(FIsLSC(plsc));
  130. Assert(FIsLSDNODE(plsdn));
  131. Unreferenced(plsc);
  132. if (ddur != 0)
  133. {
  134. if (plsdn->klsdn == klsdnReal)
  135. {
  136. ModifyDnodeDurFmt(plsdn, ddur);
  137. Assert(plsdn->u.real.objdim.dur >= 0);
  138. }
  139. else /* pen */
  140. {
  141. ModifyPenBorderDurFmt(plsdn, ddur);
  142. }
  143. AdvanceCurrentUrSubl(plsdn->plssubl, ddur);
  144. /* after such changes in dnode location of chunk should be recalculatted */
  145. InvalidateChunkLocation(PlschunkcontextFromSubline(plsdn->plssubl));
  146. }
  147. return lserrNone;
  148. }
  149. /* L S D N S E T S I M P L E W I D T H*/
  150. /*----------------------------------------------------------------------------
  151. %%Function: LsdnSetySimpleWidth
  152. %%Contact: igorzv
  153. Parameters:
  154. plsc - (IN) ptr to line services context
  155. plsdn - (IN) Pointer to the dnode
  156. dur - (IN) new dur
  157. modify dur in dnode
  158. ----------------------------------------------------------------------------*/
  159. LSERR LsdnSetSimpleWidth(PLSC plsc, PLSDNODE plsdn, long dur)
  160. {
  161. long ddur;
  162. Assert(FIsLSC(plsc));
  163. Assert(FIsLSDNODE(plsdn));
  164. Assert(dur >= 0);
  165. Unreferenced(plsc);
  166. if (plsdn->klsdn == klsdnReal)
  167. {
  168. ddur = dur - plsdn->u.real.objdim.dur;
  169. SetDnodeDurFmt(plsdn, dur);
  170. }
  171. else /* pen */
  172. {
  173. ddur = dur - plsdn->u.pen.dur;
  174. SetPenBorderDurFmt(plsdn, dur);
  175. }
  176. AdvanceCurrentUrSubl(plsdn->plssubl, ddur);
  177. /* after such changes in dnode location of chunk should be recalculatted */
  178. InvalidateChunkLocation(PlschunkcontextFromSubline(plsdn->plssubl));
  179. return lserrNone;
  180. }
  181. /* L S D N F I N C H I L D L I S T*/
  182. /*----------------------------------------------------------------------------
  183. %%Function: LsdnFInChildList
  184. %%Contact: igorzv
  185. Parameters:
  186. plsc - (IN) ptr to line services context
  187. plsdn - (IN) Pointer to the dnode
  188. pfInChildList - (OUT) is this in a low level subline
  189. Used for switching off hyphenation in child list
  190. ----------------------------------------------------------------------------*/
  191. LSERR LsdnFInChildList(PLSC plsc, PLSDNODE plsdn, BOOL* pfInChildList)
  192. {
  193. Assert(FIsLSC(plsc));
  194. Assert(FIsLSDNODE(plsdn));
  195. Unreferenced(plsc); /* to avoid warning in shiping version */
  196. *pfInChildList = ! (FIsSubLineMain(SublineFromDnode(plsdn)));
  197. return lserrNone;
  198. }
  199. /* L S D N S E T H Y P H E N A T E D*/
  200. /*----------------------------------------------------------------------------
  201. %%Function: LsdnSetHyphenated
  202. %%Contact: igorzv
  203. Parameters:
  204. plsc - (IN) ptr to line services context
  205. Set thet current line has been hyphenated
  206. ----------------------------------------------------------------------------*/
  207. LSERR LsdnSetHyphenated(PLSC plsc)
  208. {
  209. Assert(FIsLSC(plsc));
  210. plsc->fHyphenated = fTrue;
  211. return lserrNone;
  212. }
  213. /* L S D N R E S E T W I T H I N P R E V I O U S D N O D E S*/
  214. /*----------------------------------------------------------------------------
  215. %%Function: LsdnResetWidthInPreviousDnodes
  216. %%Contact: igorzv
  217. Parameters:
  218. plsc - (IN) ptr to line services context
  219. plsdn - (IN) dnode
  220. durChangePrev - (IN) durChangePrev (don't change if 0)
  221. durChangePrevPrev - (IN) durChangePrevPrev (don't change if 0)
  222. Used at SetBreak time for hyphen/nonreqhyphen cases
  223. ----------------------------------------------------------------------------*/
  224. LSERR LsdnResetWidthInPreviousDnodes(PLSC plsc, PLSDNODE plsdn,
  225. long durChangePrev, long durChangePrevPrev)
  226. {
  227. Assert(FIsLSC(plsc));
  228. Assert(FIsLSDNODE(plsdn));
  229. Assert(FBreakingAllowed(plsc)); /* this procedure are called only in breaking time */
  230. Assert(FIsDnodeReal(plsdn));
  231. Assert(IdObjFromDnode(plsdn) == IobjTextFromLsc(&plsc->lsiobjcontext)); /* only text can do this */
  232. Unreferenced(plsc); /* to avoid warning in shiping version */
  233. /* change dnode */
  234. ModifyDnodeDurFmt(plsdn, -(durChangePrev + durChangePrevPrev));
  235. /* change previous dnode */
  236. if (durChangePrev != 0)
  237. {
  238. Assert(plsdn->plsdnPrev != NULL);
  239. Assert(FIsDnodeReal(plsdn->plsdnPrev));
  240. /* only with text we can do this */
  241. Assert(IdObjFromDnode(plsdn->plsdnPrev) == IobjTextFromLsc(&plsc->lsiobjcontext));
  242. ModifyDnodeDurFmt(plsdn->plsdnPrev, durChangePrev);
  243. }
  244. /* change dnode before previous */
  245. if (durChangePrevPrev != 0)
  246. {
  247. Assert(plsdn->plsdnPrev != NULL);
  248. Assert(plsdn->plsdnPrev->plsdnPrev != NULL);
  249. Assert(FIsDnodeReal(plsdn->plsdnPrev->plsdnPrev));
  250. /* only with text we can do this */
  251. Assert(IdObjFromDnode(plsdn->plsdnPrev->plsdnPrev) == IobjTextFromLsc(&plsc->lsiobjcontext));
  252. ModifyDnodeDurFmt(plsdn->plsdnPrev->plsdnPrev, durChangePrevPrev);
  253. }
  254. /* this procedure doesn't change resulting pen position */
  255. /* after such changes in dnode location of chunk should be recalculatted */
  256. InvalidateChunkLocation(PlschunkcontextFromSubline(plsdn->plssubl));
  257. return lserrNone;
  258. }
  259. /* L S D N G E T U R P E N A T B E G I N N I N G O F C H U N K*/
  260. /*----------------------------------------------------------------------------
  261. %%Function: LsdnGetUrPenAtBeginningOfChunk
  262. %%Contact: igorzv
  263. Parameters:
  264. plsc - (IN) ptr to line services context
  265. plsdn - (IN) first dnode in chunk
  266. purPen - (OUT) position of the begining of the chunk
  267. purColumnMax - (OUT) width of column
  268. Used by SnapGrid
  269. ----------------------------------------------------------------------------*/
  270. LSERR LsdnGetUrPenAtBeginningOfChunk(PLSC plsc, PLSDNODE plsdn,
  271. long* purPen, long* purColumnMax)
  272. {
  273. PLSSUBL plssubl = SublineFromDnode(plsdn);
  274. POINTUV point;
  275. Assert(FIsLSC(plsc));
  276. Assert(FIsLSDNODE(plsdn));
  277. *purColumnMax = plsc->lsgridcontext.urColumn;
  278. GetCurrentPointSubl(plssubl, point);
  279. return GetUrPenAtBeginingOfLastChunk(plssubl->plschunkcontext, plsdn,
  280. GetCurrentDnodeSubl(plssubl), &point, purPen);
  281. }
  282. /* L S D N R E S E T D C P M E R G E*/
  283. /*----------------------------------------------------------------------------
  284. %%Function: LsdnResetDcpMerge
  285. %%Contact: igorzv
  286. Parameters:
  287. plsc - (IN) ptr to line services context
  288. plsdn - (IN) dnode
  289. cpFirstNew - (IN) new cpFirst to put in the dnode
  290. dcpNew - (IN) new dcp to put in the dnode
  291. Reset amount of characters in the dnode due to shaping glyph together
  292. ----------------------------------------------------------------------------*/
  293. LSERR LsdnResetDcpMerge(PLSC plsc, PLSDNODE plsdn, LSCP cpFirstNew, LSDCP dcpNew)
  294. {
  295. return ResetDcpCore(plsc, plsdn, cpFirstNew, dcpNew, fTrue);
  296. }
  297. /* L S D N R E S E T D C P */
  298. /*----------------------------------------------------------------------------
  299. %%Function: LsdnResetDcp
  300. %%Contact: igorzv
  301. Parameters:
  302. plsc - (IN) ptr to line services context
  303. plsdn - (IN) dnode
  304. dcpNew - (IN) new dcp to put in the dnode
  305. Cut amount of characters in the dnode.
  306. ----------------------------------------------------------------------------*/
  307. LSERR LsdnResetDcp(PLSC plsc, PLSDNODE plsdn, LSDCP dcpNew)
  308. {
  309. return ResetDcpCore(plsc, plsdn, plsdn->cpFirst, dcpNew, fFalse);
  310. }
  311. /* R E S E T D C P C O R E*/
  312. /*----------------------------------------------------------------------------
  313. %%Function: ResetDcpCore
  314. %%Contact: igorzv
  315. Parameters:
  316. plsc - (IN) ptr to line services context
  317. plsdn - (IN) dnode
  318. cpFirstNew - (IN) new cpFirst to put in the dnode
  319. dcpNew - (IN) new dcp to put in the dnode
  320. fMerge - (IN) characters from the next dnode moves to previous
  321. Internal procedure which implements both LsdnResetDcpMerge and LsdnResetDcp
  322. ----------------------------------------------------------------------------*/
  323. static LSERR ResetDcpCore(PLSC plsc, PLSDNODE plsdn, LSCP cpFirstNew,
  324. LSDCP dcpNew, BOOL fMerge)
  325. {
  326. LSERR lserr;
  327. PLSDNODE plsdnPrev;
  328. PLSDNODE plsdnNext;
  329. PLSDNODE plsdnPrevNonBorder;
  330. PLSDNODE plsdnFirstDelete;
  331. PLSDNODE plsdnLastDelete;
  332. PLSDNODE plsdnBorder;
  333. Assert(FIsLSDNODE(plsdn));
  334. Assert(FIsDnodeReal(plsdn));
  335. /* if everything stays the same return right away */
  336. if ((cpFirstNew == plsdn->cpFirst) && (dcpNew == plsdn->dcp))
  337. return lserrNone;
  338. /* after such changes in dnodes chunk should be recollected */
  339. InvalidateChunk(PlschunkcontextFromSubline(plsdn->plssubl));
  340. lserr = plsc->lscbk.pfnResetRunContents(plsc->pols, plsdn->u.real.plsrun, plsdn->cpFirst,
  341. plsdn->dcp, cpFirstNew, dcpNew);
  342. if (lserr != lserrNone)
  343. return lserr;
  344. plsdn->cpFirst = cpFirstNew;
  345. plsdn->dcp = dcpNew;
  346. if (plsdn->cpFirst + (LSCP) plsdn->dcp > plsdn->cpLimOriginal)
  347. plsdn->cpLimOriginal = plsdn->cpFirst + plsdn->dcp;
  348. if (dcpNew == 0) /* delete this dnode */
  349. {
  350. /* check that objdim has been zeroed */
  351. Assert(DurFromDnode(plsdn) == 0);
  352. Assert(DvrFromDnode(plsdn) == 0);
  353. plsdnPrev = plsdn->plsdnPrev;
  354. plsdnNext = plsdn->plsdnNext;
  355. if (fMerge)
  356. {
  357. plsdnPrevNonBorder = plsdnPrev;
  358. Assert(FIsLSDNODE(plsdnPrevNonBorder));
  359. while(FIsDnodeBorder(plsdnPrevNonBorder))
  360. {
  361. plsdnPrevNonBorder = plsdnPrevNonBorder->plsdnPrev;
  362. Assert(FIsLSDNODE(plsdnPrevNonBorder));
  363. }
  364. /* set cpLimOriginal */
  365. plsdnPrevNonBorder->cpLimOriginal = plsdn->cpLimOriginal;
  366. plsdnBorder = plsdnPrevNonBorder->plsdnNext;
  367. while(FIsDnodeBorder(plsdnBorder))
  368. {
  369. plsdnBorder->cpFirst = plsdn->cpLimOriginal;
  370. plsdnBorder->cpLimOriginal = plsdn->cpLimOriginal;
  371. plsdnBorder = plsdnBorder->plsdnNext;
  372. Assert(FIsLSDNODE(plsdnBorder));
  373. }
  374. Assert(plsdnBorder == plsdn);
  375. }
  376. if ((plsdnPrev != NULL && FIsDnodeOpenBorder(plsdnPrev))
  377. && (plsdnNext == NULL
  378. || (FIsDnodeBorder(plsdnNext) && !FIsDnodeOpenBorder(plsdnNext))
  379. )
  380. )
  381. /* we should delete empty borders */
  382. {
  383. plsdnFirstDelete = plsdnPrev;
  384. if (plsdnNext != NULL)
  385. {
  386. plsdnLastDelete = plsdnNext;
  387. AdvanceCurrentUrSubl(SublineFromDnode(plsdnFirstDelete),
  388. -DurFromDnode(plsdnFirstDelete));
  389. AdvanceCurrentUrSubl(SublineFromDnode(plsdnLastDelete),
  390. -DurFromDnode(plsdnLastDelete));
  391. }
  392. else
  393. {
  394. plsdnLastDelete = plsdn;
  395. AdvanceCurrentUrSubl(SublineFromDnode(plsdnFirstDelete),
  396. -DurFromDnode(plsdnFirstDelete));
  397. }
  398. plsdnPrev = plsdnFirstDelete->plsdnPrev;
  399. plsdnNext = plsdnLastDelete->plsdnNext;
  400. }
  401. else
  402. {
  403. plsdnFirstDelete = plsdn;
  404. plsdnLastDelete = plsdn;
  405. }
  406. /*set links */
  407. if (plsdnPrev != NULL)
  408. {
  409. Assert(FIsLSDNODE(plsdnPrev));
  410. plsdnPrev->plsdnNext = plsdnNext;
  411. }
  412. if (plsdnNext != NULL)
  413. {
  414. Assert(FIsLSDNODE(plsdnNext));
  415. plsdnNext->plsdnPrev = plsdnPrev;
  416. }
  417. else
  418. {
  419. /* this dnode was the last one so we need to change state */
  420. SetCurrentDnodeSubl(plsdn->plssubl, plsdnPrev);
  421. }
  422. /* break link with next and destroy */
  423. plsdnLastDelete->plsdnNext = NULL;
  424. lserr = DestroyDnodeList (&plsc->lscbk, plsc->pols, &plsc->lsiobjcontext,
  425. plsdnFirstDelete, plsc->fDontReleaseRuns);
  426. if (lserr != lserrNone)
  427. return lserr;
  428. }
  429. return lserrNone;
  430. }
  431. /* L S D N G E T B O R D E R A F T E R */
  432. /*----------------------------------------------------------------------------
  433. %%Function: LsdnCheckAvailableSpace
  434. %%Contact: igorzv
  435. Parameters:
  436. plsc - (IN) ptr to line services context
  437. plsdn - (IN) dnode to find closing border for
  438. pdurBorder - (OUT) dur of the border after this DNODE
  439. ----------------------------------------------------------------------------*/
  440. LSERR LsdnGetBorderAfter(PLSC plsc, PLSDNODE plsdn,
  441. long* pdurBorder)
  442. {
  443. Unreferenced(plsc); /* to avoid warning in shiping version */
  444. Assert(FIsLSC(plsc));
  445. Assert(FIsLSDNODE(plsdn));
  446. *pdurBorder = 0;
  447. if (FDnodeHasBorder(plsdn))
  448. {
  449. *pdurBorder = DurBorderFromDnodeInside(plsdn);
  450. }
  451. return lserrNone;
  452. }
  453. /* L S D N G E T G E T L E F T I N D E N T D U R */
  454. /*----------------------------------------------------------------------------
  455. %%Function: LsdnGetLeftIndentDur
  456. %%Contact: igorzv
  457. Parameters:
  458. plsc - (IN) ptr to line services context
  459. pdurLeft - (OUT) dur of the left margin
  460. ----------------------------------------------------------------------------*/
  461. LSERR LsdnGetLeftIndentDur(PLSC plsc, long* pdurLeft)
  462. {
  463. Assert(FIsLSC(plsc));
  464. *pdurLeft = plsc->lsadjustcontext.urLeftIndent;
  465. return lserrNone;
  466. }
  467. /* L S D N S E T S T O P R */
  468. /*----------------------------------------------------------------------------
  469. %%Function: LsdnSetStopr
  470. %%Contact: igorzv
  471. Parameters:
  472. plsc - (IN) ptr to line services context
  473. plsdn - (IN) dnode
  474. stopres - (IN) kind of hard break
  475. Set flag correspondent to a type of hard break into dnode
  476. ----------------------------------------------------------------------------*/
  477. LSERR LsdnSetStopr(PLSC plsc, PLSDNODE plsdn, STOPRES stopres)
  478. {
  479. Unreferenced(plsc); /* to avoid warning in shiping version */
  480. Assert(FIsLSC(plsc));
  481. Assert(FIsLSDNODE(plsdn));
  482. Assert(!plsdn->fEndOfColumn && !plsdn->fEndOfPage && !plsdn->fEndOfSection &&
  483. !plsdn->fEndOfPara && !plsdn->fAltEndOfPara && !plsdn->fSoftCR);
  484. switch (stopres)
  485. {
  486. case stoprEndColumn:
  487. plsdn->fEndOfColumn = fTrue;
  488. break;
  489. case stoprEndPage:
  490. plsdn->fEndOfPage = fTrue;
  491. break;
  492. case stoprEndSection:
  493. plsdn->fEndOfSection = fTrue;
  494. break;
  495. case stoprEndPara:
  496. plsdn->fEndOfPara = fTrue;
  497. break;
  498. case stoprAltEndPara:
  499. plsdn->fAltEndOfPara = fTrue;
  500. break;
  501. case stoprSoftCR:
  502. plsdn->fSoftCR = fTrue;
  503. break;
  504. default:
  505. NotReached();
  506. }
  507. return lserrNone;
  508. }
  509. /* L S D N F C A N B E F O R E N E X T C H U N K */
  510. /*----------------------------------------------------------------------------
  511. %%Function: LsdnFCanBreakBeforeNextChunk
  512. %%Contact: igorzv
  513. Parameters:
  514. plsc - (IN) ptr to line services context
  515. plsdn - (IN) Last DNODE of the current chunk
  516. pfCanBreakBeforeNextChunk-(OUT) Can break before next chunk ?
  517. Called by text during find previous break when it's going to set break after last text dnode.
  518. Procedure forwards this question to the next after text object
  519. ----------------------------------------------------------------------------*/
  520. LSERR LsdnFCanBreakBeforeNextChunk(PLSC plsc, PLSDNODE plsdn, BOOL* pfCanBreakBeforeNextChunk)
  521. {
  522. Assert(FIsLSC(plsc));
  523. Assert(FIsLSDNODE(plsdn));
  524. return FCanBreakBeforeNextChunkCore (plsc, plsdn, pfCanBreakBeforeNextChunk);
  525. }
  526. /* L S D N F S T O P P E D A F T E R C H U N K */
  527. /*----------------------------------------------------------------------------
  528. %%Function: LsdnFStoppedAfterChunk
  529. %%Contact: igorzv
  530. Parameters:
  531. plsc - (IN) ptr to line services context
  532. plsdn - (IN) Last DNODE of the current chunk
  533. pfStoppedAfterChunk-(OUT) Splat or Hidden Text, producing fmtrStopped after chunk?
  534. Called by text during find previous break when breaking rules prohibit text to break after last dnode,
  535. but is must do this because of splat.
  536. ----------------------------------------------------------------------------*/
  537. LSERR LsdnFStoppedAfterChunk(PLSC plsc, PLSDNODE plsdn, BOOL* pfStoppedAfterChunk)
  538. {
  539. PLSDNODE plsdnNext;
  540. Unreferenced(plsc); /* to avoid warning in shiping version */
  541. Assert(FIsLSC(plsc));
  542. Assert(FIsLSDNODE(plsdn));
  543. if (!FIsSubLineMain(SublineFromDnode(plsdn)))
  544. *pfStoppedAfterChunk = fFalse;
  545. else
  546. {
  547. plsdnNext = plsdn->plsdnNext;
  548. if (plsdnNext == NULL || FIsDnodeSplat(plsdnNext))
  549. *pfStoppedAfterChunk = fTrue;
  550. else
  551. *pfStoppedAfterChunk = fFalse;
  552. }
  553. return lserrNone;
  554. }