📄 lineinfo.cpp
字号:
// LineInfo.cpp: implementation of the LineInfo class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "hwpre.h"
#include "LineInfo.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
LineInfo::LineInfo()
{
LineNum = 0;
first = NULL;
last = NULL;
next = NULL;
Top = 0;
Bottom = 0;
}
LineInfo::~LineInfo()
{
if(DotsStatics != NULL) {
//delete [] DotsStatics;
DotsStatics = NULL;
}
WordFragmentInfo * wfi,* wft;
wfi = first;
while (wfi != NULL) {
wft = wfi;
wfi = wfi->next;
delete wft;
}
first =NULL;
last = NULL;
}
WordFragmentInfo::WordFragmentInfo()
{
parentLine = NULL;
prior = NULL;
next = NULL;
left= 0;
right= 0;
top= 0;
bottom= 0;
blackDotsInArea= 0;
}
WordFragmentInfo::~WordFragmentInfo()
{
//
}
WordFragmentInfo::WordFragmentInfo(LineInfo * info)
{
parentLine = info;
top = info->Top;
bottom = info->Bottom;
prior = NULL;
next = NULL;
left= 0;
right= 0;
blackDotsInArea= 0;
}
WordFragmentInfo::WordFragmentInfo(LineInfo * info, int left, int right)
{
parentLine = info;
top = info->Top;
bottom = info->Bottom;
this->left = left;
this->right = right;
prior = NULL;
next = NULL;
blackDotsInArea= 0;
}
BOOL WordFragmentInfo::IsPunctuation(int minWidth, int minDensity)
{
double density;
if(this->Width_1() > 0)
density = (double)blackDotsInArea / this->Width_1();
else
density = 0;
if(this->Width_1() < minWidth && density < minDensity)
return TRUE;
else
return FALSE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -