Fix CssCalculator, EpubTest, HWPFile

Checked:
- Apple
- HtmlFile2
- DesktopEditor\raster\Metafile
- EpubFile
- Fb2File
- HWPFile
- OFDFile
This commit is contained in:
Kirill Polyakov
2026-04-02 23:18:03 +03:00
parent bd245cd62a
commit 47fed9cb63
12 changed files with 18 additions and 19 deletions

View File

@ -23,7 +23,7 @@ namespace NSCSS
case NSCSS::Inch:
return dValue / (double)ushDPI;
case NSCSS::Peak:
return dValue * 6. / (double)ushDPI; // 1 inch = 6 picas
return dValue * 6. / (double)ushDPI; // 1 inch = 6 peak
case NSCSS::Twips:
return dValue * 1440. / (double)ushDPI;
default:
@ -122,7 +122,7 @@ namespace NSCSS
case NSCSS::Point:
return dValue * 12.; // 12 = 72 / 6
case NSCSS::Pixel:
return dValue * (double)ushDPI / 6.; // 1 inch = 6 picas
return dValue * (double)ushDPI / 6.; // 1 inch = 6 peak
case NSCSS::Cantimeter:
return dValue * 0.423; // 0.423 = 2.54 / 6
case NSCSS::Millimeter:

View File

@ -23,7 +23,7 @@ namespace NS_STATIC_FUNCTIONS
std::string sEncoding;
if (true)
{
// determine encoding
//determining the encoding
const std::string::size_type& posCharset = sContent.find("@charset");
if (std::string::npos != posCharset)

View File

@ -392,8 +392,8 @@ namespace NSCSS
std::wstring wsNewValue = wsValue;
const bool bImportant{CutImportant(wsNewValue)}; //TODO:: sometimes we know that "!important" definitely won't occur
// perhaps should add another method
const bool bImportant{CutImportant(wsNewValue)};
if (m_bImportant && !bImportant)
return false;

View File

@ -29,7 +29,6 @@ int main()
std::vector<std::wstring> arFiles = NSDirectory::GetFiles(NSFile::GetProcessDirectory() + L"/../../../Files");
clock_t tTime1 = clock();
//Russian characters are not displayed in the console
for (const std::wstring& sFileName : arFiles)
{
clock_t tTimeBegin = clock();

View File

@ -19,7 +19,7 @@ EAccent GetAccent(int nValue)
}
}
//Only found in hwpx
//Occurs only in hwpx
EAccent GetAccent(const std::string& sValue)
{
if (sValue.empty() || "NONE" == sValue)

View File

@ -52,14 +52,14 @@ CCtrl* CHWPRecordCtrlHeader::Parse(int nTagNum, int nLevel, int nSize, CHWPStrea
pCtrl = new CCtrlEqEdit(sCtrlID, nSize - oBuffer.GetDistanceToLastPos(), oBuffer, 0, nVersion);
else if (L"dhgp" == sCtrlID)
{
// TODO:: Return to this later
int nTempSize = nSize - oBuffer.GetDistanceToLastPos();
oBuffer.Skip(nTempSize);
}
else if (L"cot%" == sCtrlID)
{
// TODO:: Return to this later
// When content is read as UTF_16LE, the following content remains the same
// ¥TableOfContents:set:140:ContentsMake:uint:17 ContentsStyles:wstring:0: ContentsLevel:int:5 ContentsAutoTabRight:int:0 ContentsLeader:int:3 ContentsHyperlink:bool:1
int nTempSize = nSize - oBuffer.GetDistanceToLastPos();
oBuffer.Skip(nTempSize);
}

View File

@ -160,8 +160,8 @@ CHWPRecordParaShape::CHWPRecordParaShape(CHWPDocInfo& oDocInfo, CXMLReader& oRea
m_bConnect(false), m_bIgnoreMargin(false), m_bParaTailShape(false), m_nIndent(0), m_nMarginLeft(0),
m_nMarginRight(0), m_nMarginPrev(0), m_nMarginNext(0)
{
//In HWPX data in this node is written as node-type data
//In HWPML data in this node is written as argument-type data
//In HWPX, node data is written not only in arguments but also in nested nodes.
//In HWPML, node data is written in arguments.
if (EHanType::HWPX == eType)
{

View File

@ -93,7 +93,7 @@ CHwpRecordTabDef::CHwpRecordTabDef(CHWPDocInfo& oDocInfo, CXMLReader& oReader, E
}
END_READ_ATTRIBUTES(oReader)
// The following structure is only found in HWPX format
// The following structure is occurs only in HWPX format
if (EHanType::HWPX != eType)
return;

View File

@ -74,7 +74,7 @@ inline ELineStyle1 GetLineStyle1(const std::string& sValue, EHanType eType)
if (GetValueName(EValue::SlimThickSlim, eType) == sValue)
return ELineStyle1::SLIM_THICK_SLIM;
// Other values are only found in hwpx
// Other values are occurs only in hwpx
if (EHanType::HWPX != eType)
return ELineStyle1::SOLID;

View File

@ -294,7 +294,7 @@ bool CHWPFile::Unzip(CHWPStream& oInput, CHWPStream& oBuffer)
return DEFLATE_OK == nRes || DEFLATE_STREAM_END == nRes;
}
// Since consistent behavior is required across all OSes,
// Since identical behavior is required across all OSes,
// we use our own randomizer
class CRandomizer

View File

@ -65,7 +65,7 @@ CCtrlField::CCtrlField(const HWP_STRING& sCtrlID, CXMLReader& oReader, EHanType
if (!wsName.empty() && EFieldType::Bookmark == m_eType)
AddStringParam(L"bookmarkname", wsName);
// Only found in HWPX
// Occurs only in HWPX
if (EHanType::HWPX == eType)
{
WHILE_READ_NEXT_NODE_WITH_ONE_NAME(oReader, "hp:parameters")

View File

@ -85,7 +85,7 @@ CShadow::CShadow(CXMLReader& oReader, EHanType eType)
else if (GetAttributeName(EAttribute::RotationStyle, eType) == sAttributeName)
m_nRotation = (int)oReader.GetBool();
// The following attributes are only found in HWPML
// The following attributes are occurs only in HWPML
else if (EHanType::HWPML != eType)
continue;
else if ("SkewX" == sAttributeName)
@ -99,7 +99,7 @@ CShadow::CShadow(CXMLReader& oReader, EHanType eType)
}
END_READ_ATTRIBUTES(oReader)
// The following nodes are only found in HWPX
// The following nodes are occurs only in HWPX
if (EHanType::HWPX != eType)
return;
@ -231,7 +231,7 @@ CReflect::CReflect(CXMLReader& oReader, EHanType eType)
else if (GetAttributeName(EAttribute::FadeDirection, eType) == sAttributeName)
m_fOffsetDirection = oReader.GetDouble();
// The following attributes are only found in HWPML
// The following attributes are occurs only in HWPML
else if (EHanType::HWPML != eType)
continue;
else if ("SkewX" == sAttributeName)
@ -253,7 +253,7 @@ CReflect::CReflect(CXMLReader& oReader, EHanType eType)
}
END_READ_ATTRIBUTES(oReader)
// The following nodes are only found in HWPX
// The following nodes are occurs only in HWPX
if (EHanType::HWPX != eType)
return;