Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1970 - New text entities in KET-format #2093

Draft
wants to merge 50 commits into
base: master
Choose a base branch
from
Draft

Conversation

even1024
Copy link
Collaborator

@even1024 even1024 commented Jul 8, 2024

Generic request

  • PR name follows the pattern #1234 – issue name
  • branch name does not contain '#'
  • base branch (master or release/xx) is correct
  • PR is linked with the issue
  • task status changed to "Code review"
  • code follows product standards
  • regression tests updated

@@ -71,10 +71,38 @@ void printMappings(Array<int>& mapping)
}

MoleculeJsonSaver::MoleculeJsonSaver(Output& output)
: _output(output), _pmol(nullptr), _pqmol(nullptr), add_stereo_desc(false), pretty_json(false), use_native_precision(false)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by default ket version 1 should be used in json saver

writer.EndObject();
}

void MoleculeJsonSaver::saveText(JsonWriter& writer, const KETTextObject& text_obj)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to saveTextV2

@@ -639,6 +661,47 @@ void MoleculeCdxmlLoader::_parseCDXMLPage(BaseCDXElement& elem)
_has_scheme = true;
}
}
else if (page_elem->value() == "colortable")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add constant for colortable

{
for (auto color_elem = page_elem->firstChildElement(); color_elem->hasContent(); color_elem = color_elem->nextSiblingElement())
{
if (color_elem->name() == "color")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add constant for color

for (auto color_prop = color_elem->firstProperty(); color_prop->hasContent(); color_prop = color_prop->next())
{
auto cval = static_cast<int>(std::stof(color_prop->value()) * 0xFF);
if (color_prop->name() == "r")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add constant for r

cdxml_color |= cval << 16;
else if (color_prop->name() == "g")
cdxml_color |= cval << 8;
else if (color_prop->name() == "b")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add constant for b

}
}
}
else if (page_elem->value() == "fonttable")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add constnat font fonttable

{
for (auto font_elem = page_elem->firstChildElement(); font_elem->hasContent(); font_elem = font_elem->nextSiblingElement())
{
if (font_elem->name() == "font")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add constant for font

{
std::string text_element = text_style->name();
// "s" = parts
if (text_element == "s")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add constant s

if (text_element == "s")
{
std::string style_text = text_style->getText();
if (style_text == "+")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add constant +

Copy link
Collaborator

@AlexanderSavelyev AlexanderSavelyev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no tests for ket v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants