windows-nt/Source/XPSP1/NT/windows/richedit/lssrc/lsenum.c
2020-09-26 16:20:57 +08:00

47 lines
941 B
C

#include "lsenum.h"
#include "lsc.h"
#include "lsline.h"
#include "prepdisp.h"
#include "enumcore.h"
// %%Function: LsEnumLine
// %%Contact: victork
//
/*
* Enumerates the formatted line (main subline) (from the given point is fGeometry needed).
*/
LSERR WINAPI LsEnumLine(PLSLINE plsline, BOOL fReverseOrder, BOOL fGeometryNeeded, const POINT* pptorg)
{
PLSC plsc;
LSERR lserr;
if (!FIsLSLINE(plsline)) return lserrInvalidParameter;
plsc = plsline->lssubl.plsc;
Assert(FIsLSC(plsc));
if (plsc->lsstate != LsStateFree) return lserrContextInUse;
if (fGeometryNeeded)
{
lserr = PrepareLineForDisplayProc(plsline);
plsc->lsstate = LsStateFree;
if (lserr != lserrNone) return lserr;
}
plsc->lsstate = LsStateEnumerating;
lserr = EnumSublineCore(&(plsline->lssubl), fReverseOrder, fGeometryNeeded,
pptorg, plsline->upStartAutonumberingText);
plsc->lsstate = LsStateFree;
return lserr;
}