MCPcopy Create free account
hub / github.com/KDE/labplot / readBorders

Method readBorders

src/3rdparty/QXlsx/source/xlsxstyles.cpp:973–1002  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

971}
972
973bool Styles::readBorders(QXmlStreamReader &reader)
974{
975 Q_ASSERT(reader.name() == QLatin1String("borders"));
976
977 const auto& attributes = reader.attributes();
978 const auto hasCount = attributes.hasAttribute(QLatin1String("count"));
979 const auto count = hasCount ? attributes.value(QLatin1String("count")).toInt() : -1;
980 while (!reader.atEnd() && !(reader.tokenType() == QXmlStreamReader::EndElement
981 && reader.name() == QLatin1String("borders"))) {
982 reader.readNextStartElement();
983 if (reader.tokenType() == QXmlStreamReader::StartElement) {
984 if (reader.name() == QLatin1String("border")) {
985 Format border;
986 readBorder(reader, border);
987 m_bordersList.append(border);
988 m_bordersHash.insert(border.borderKey(), border);
989 if (border.isValid())
990 border.setBorderIndex(m_bordersList.size()-1);
991 }
992 }
993 }
994
995 if (reader.hasError())
996 qWarning()<<reader.errorString();
997
998 if (hasCount && (count != m_bordersList.size()))
999 qWarning("error read borders");
1000
1001 return true;
1002}
1003
1004bool Styles::readBorder(QXmlStreamReader &reader, Format &border)
1005{

Callers

nothing calls this directly

Calls 9

atEndMethod · 0.80
appendMethod · 0.80
insertMethod · 0.80
borderKeyMethod · 0.80
setBorderIndexMethod · 0.80
nameMethod · 0.45
valueMethod · 0.45
isValidMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected