From 38f20032f483ef5d8bb09914a0346e96ca59c57b Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Wed, 18 Aug 2021 17:41:45 +0300 Subject: [PATCH] Fix bug 51525 --- DesktopEditor/raster/Metafile/svg/SVGFramework.h | 16 ++++++++++++++++ DesktopEditor/xml/src/xmldom.cpp | 7 +++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/DesktopEditor/raster/Metafile/svg/SVGFramework.h b/DesktopEditor/raster/Metafile/svg/SVGFramework.h index 99254a5e3b..14b28a6588 100644 --- a/DesktopEditor/raster/Metafile/svg/SVGFramework.h +++ b/DesktopEditor/raster/Metafile/svg/SVGFramework.h @@ -5692,6 +5692,22 @@ public: m_oUs.SetViewBox(m_nWidth, m_nHeight, m_oViewBox, m_Metrics); SetDefaultSizes (); + + m_oStyle.SetDefault(); + m_oStyle.ClearFillColor(); + std::wstring css = oXml.GetAttribute(L"style"); + if (!css.empty()) + { + m_oFontStyle.SetStyle (css, true); + m_oStyle.SetStyle (css, true, m_oUs, m_model, m_oColTable); + } + else + { + m_oFontStyle.UpdateStyle (oXml); + m_oStyle.UpdateStyle (oXml, m_oUs, m_model, m_oColTable); + } + + m_oStyles.Push(m_oStyle); } else if (L"g" == strXmlNode) { diff --git a/DesktopEditor/xml/src/xmldom.cpp b/DesktopEditor/xml/src/xmldom.cpp index 6f63dd50e1..98227a09cc 100644 --- a/DesktopEditor/xml/src/xmldom.cpp +++ b/DesktopEditor/xml/src/xmldom.cpp @@ -706,8 +706,11 @@ namespace XmlUtils std::wstring sRes; if (!GetAttributeIfExist(strAttributeName, sRes)) { - if (!GetTextIfExist(sRes)) - sRes = strDefaultValue; + CXmlNode oTemp; + if (GetNode(strAttributeName, oTemp)) + sRes = oTemp.GetText(); + else + sRes = strDefaultValue; } return sRes; }