summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2014-02-03 13:32:52 +0100
committerFridrich Štrba <fridrich.strba@bluewin.ch>2014-02-03 13:32:52 +0100
commit17843d542375641f707d9737fa77fff5180ec031 (patch)
treeaf6b992f986a2bb6336cf10f2f8c40fa0f1ac3a9 /src/lib
parentf20f0bed4e545355f37f008cf311833c7907506a (diff)
Parse the quick-style pointers
Change-Id: I2d6b5a72c6c2764793992d1ca6363c831fa425b0
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/VSDXParser.cpp60
-rw-r--r--src/lib/VSDXTheme.cpp8
-rw-r--r--src/lib/tokens.txt10
3 files changed, 74 insertions, 4 deletions
diff --git a/src/lib/VSDXParser.cpp b/src/lib/VSDXParser.cpp
index 7708558..21e2d2c 100644
--- a/src/lib/VSDXParser.cpp
+++ b/src/lib/VSDXParser.cpp
@@ -821,6 +821,37 @@ void libvisio::VSDXParser::readStyleProperties(xmlTextReaderPtr reader)
if (XML_READER_TYPE_ELEMENT == tokenType)
readCharacter(reader);
break;
+ case XML_QUICKSTYLELINECOLOR:
+ if (XML_READER_TYPE_ELEMENT == tokenType)
+ {
+ long tmpValue;
+ ret = readLongData(tmpValue, reader);
+ if (!strokeColour)
+ strokeColour = m_currentTheme.getThemeColour((unsigned)tmpValue);
+ }
+ break;
+ case XML_QUICKSTYLEFILLCOLOR:
+ if (XML_READER_TYPE_ELEMENT == tokenType)
+ {
+ long tmpValue;
+ ret = readLongData(tmpValue, reader);
+ if (!fillColourFG)
+ fillColourFG = m_currentTheme.getThemeColour((unsigned)tmpValue);
+ if (!fillColourBG)
+ fillColourBG = m_currentTheme.getThemeColour((unsigned)tmpValue);
+ }
+ break;
+ case XML_QUICKSTYLESHADOWCOLOR:
+ if (XML_READER_TYPE_ELEMENT == tokenType)
+ {
+ long tmpValue;
+ ret = readLongData(tmpValue, reader);
+ if (!shadowColourFG)
+ shadowColourFG = m_currentTheme.getThemeColour((unsigned)tmpValue);
+ if (!shadowColourBG)
+ shadowColourBG = m_currentTheme.getThemeColour((unsigned)tmpValue);
+ }
+ break;
default:
break;
}
@@ -1139,6 +1170,35 @@ void libvisio::VSDXParser::readShapeProperties(xmlTextReaderPtr reader)
if (XML_READER_TYPE_ELEMENT == tokenType)
ret = readBoolData(m_shape.m_misc.m_hideText, reader);
break;
+ case XML_QUICKSTYLELINECOLOR:
+ if (XML_READER_TYPE_ELEMENT == tokenType)
+ {
+ long tmpValue;
+ ret = readLongData(tmpValue, reader);
+ if (!m_shape.m_lineStyle.colour)
+ m_shape.m_lineStyle.colour = m_currentTheme.getThemeColour((unsigned)tmpValue);
+ }
+ break;
+ case XML_QUICKSTYLEFILLCOLOR:
+ if (XML_READER_TYPE_ELEMENT == tokenType)
+ {
+ long tmpValue;
+ ret = readLongData(tmpValue, reader);
+ if (!m_shape.m_fillStyle.fgColour)
+ m_shape.m_fillStyle.fgColour = m_currentTheme.getThemeColour((unsigned)tmpValue);
+ if (!m_shape.m_fillStyle.bgColour)
+ m_shape.m_fillStyle.bgColour = m_currentTheme.getThemeColour((unsigned)tmpValue);
+ }
+ break;
+ case XML_QUICKSTYLESHADOWCOLOR:
+ if (XML_READER_TYPE_ELEMENT == tokenType)
+ {
+ long tmpValue;
+ ret = readLongData(tmpValue, reader);
+ if (!m_shape.m_fillStyle.shadowFgColour)
+ m_shape.m_fillStyle.shadowFgColour = m_currentTheme.getThemeColour((unsigned)tmpValue);
+ }
+ break;
default:
if (XML_SECTION == tokenClass && XML_READER_TYPE_ELEMENT == tokenType)
ret = skipSection(reader);
diff --git a/src/lib/VSDXTheme.cpp b/src/lib/VSDXTheme.cpp
index 5550857..3def5fb 100644
--- a/src/lib/VSDXTheme.cpp
+++ b/src/lib/VSDXTheme.cpp
@@ -150,7 +150,7 @@ void libvisio::VSDXTheme::readClrScheme(xmlTextReaderPtr reader)
tokenType = xmlTextReaderNodeType(reader);
switch (tokenId)
{
- case XML_A_SRGBCLR:
+ case XML_A_DK1:
readThemeColour(reader, tokenId, m_clrScheme.m_dk1);
break;
case XML_A_DK2:
@@ -248,7 +248,7 @@ void libvisio::VSDXTheme::readVariationClrSchemeLst(xmlTextReaderPtr reader)
tokenType = xmlTextReaderNodeType(reader);
switch (tokenId)
{
- case XML_VT_VARIATIONSTYLESCHEME:
+ case XML_VT_VARIATIONCLRSCHEME:
{
VSDXVariationClrScheme varClrSch;
readVariationClrScheme(reader, varClrSch);
@@ -259,7 +259,7 @@ void libvisio::VSDXTheme::readVariationClrSchemeLst(xmlTextReaderPtr reader)
break;
}
}
- while ((XML_VT_VARIATIONSTYLESCHEMELST != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret);
+ while ((XML_VT_VARIATIONCLRSCHEMELST != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret);
}
void libvisio::VSDXTheme::readVariationClrScheme(xmlTextReaderPtr reader, VSDXVariationClrScheme &varClrSch)
@@ -303,7 +303,7 @@ void libvisio::VSDXTheme::readVariationClrScheme(xmlTextReaderPtr reader, VSDXVa
break;
}
}
- while ((XML_VT_VARIATIONSTYLESCHEME != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret);
+ while ((XML_VT_VARIATIONCLRSCHEME != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret);
}
boost::optional<libvisio::Colour> libvisio::VSDXTheme::getThemeColour(unsigned value, unsigned variationIndex) const
diff --git a/src/lib/tokens.txt b/src/lib/tokens.txt
index 7c4a966..4421b59 100644
--- a/src/lib/tokens.txt
+++ b/src/lib/tokens.txt
@@ -132,6 +132,16 @@ PinY
PolylineTo
Pos
pp
+QuickStyleEffectsMatrix
+QuickStyleFillColor
+QuickStyleFillMatrix
+QuickStyleFontMatrix
+QuickStyleLineColor
+QuickStyleLineMatrix
+QuickStyleShadowColor
+QuickStyleType
+QuickStyleVariation
+QuickStyleShadowColor
Rel
RelCubBezTo
RelEllipticalArcTo