From 91701ed58d70ec8cd8eb6e1edc6c10455fc8f639 Mon Sep 17 00:00:00 2001 From: Daria Ermakova Date: Mon, 6 Apr 2026 13:49:45 +0300 Subject: [PATCH] add horizontal rule --- MsBinaryFile/DocFile/VMLShapeMapping.cpp | 48 ++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/MsBinaryFile/DocFile/VMLShapeMapping.cpp b/MsBinaryFile/DocFile/VMLShapeMapping.cpp index 896e0b742e..1ee5a5f5f7 100644 --- a/MsBinaryFile/DocFile/VMLShapeMapping.cpp +++ b/MsBinaryFile/DocFile/VMLShapeMapping.cpp @@ -302,6 +302,9 @@ namespace DocFileFormat bool bFilled = true; bool hasTextbox = false; bool layoutInCell = true; //anmeldebogenfos.doc + bool HorizRule = false; + bool StandardHR = false; + bool NoshadeHR = false; bool b3D = false; bool bShadow = false; bool bPicturePresent = false; @@ -400,6 +403,18 @@ namespace DocFileFormat { layoutInCell = booleans->fLayoutInCell; } + if (booleans->fUsefHorizRule) + { + HorizRule = booleans->fHorizRule; + } + if (booleans->fUsefStandardHR) + { + StandardHR = booleans->fStandardHR; + } + if (booleans->fUsefNoshadeHR) + { + NoshadeHR = booleans->fNoshadeHR; + } } break; // GEOMETRY @@ -747,6 +762,27 @@ namespace DocFileFormat } } }break; + case ODRAW::pctHR: + { + int pctValue = (int)iter->op; + + if (pctValue > 0) + { + std::wstring pctStr = std::to_wstring(pctValue); + m_pXmlWriter->WriteAttribute(L"o:hrpct", pctStr); + } + + }break; + case ODRAW::alignHR: + { + switch (iter->op) + { + case 0: m_pXmlWriter->WriteAttribute(L"o:hralign", L"left"); break; + case 1: m_pXmlWriter->WriteAttribute(L"o:hralign", L"center"); break; + case 2: m_pXmlWriter->WriteAttribute(L"o:hralign", L"right"); break; + } + + }break; // OLE case ODRAW::pictureId: { @@ -1058,6 +1094,18 @@ namespace DocFileFormat m_pXmlWriter->WriteAttribute(L"coordsize", (FormatUtils::SizeTToWideString(*xCoord) + L"," + FormatUtils::SizeTToWideString(*yCoord))); } } + if (HorizRule) + { + m_pXmlWriter->WriteAttribute(L"o:hr", L"t"); + } + if (StandardHR) + { + m_pXmlWriter->WriteAttribute(L"o:hrstd", L"t"); + } + if (NoshadeHR) + { + m_pXmlWriter->WriteAttribute(L"o:hrnoshade", L"t"); + } int nCode = 0; if (pShape->GetShapeType())