summaryrefslogtreecommitdiff
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:33:21 +0100
commit271be232a69d19628a3fd7782176a140d1e92e40 (patch)
tree37b197fbb3904e0a35bf00bd07c62694b4447894
parent57210acffdc7953653f65be184897c0993555155 (diff)
Parse the quick-style pointers
Change-Id: I2d6b5a72c6c2764793992d1ca6363c831fa425b0 (cherry picked from commit 17843d542375641f707d9737fa77fff5180ec031)
-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 730a353..e4dc1b1 100644
--- a/src/lib/VSDXParser.cpp
+++ b/src/lib/VSDXParser.cpp
@@ -852,6 +852,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;
}
@@ -1170,6 +1201,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 f2f094d..b67330a 100644
--- a/src/lib/VSDXTheme.cpp
+++ b/src/lib/VSDXTheme.cpp
@@ -170,7 +170,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:
@@ -268,7 +268,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);
@@ -279,7 +279,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)
@@ -323,7 +323,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