[Libreoffice-commits] libcdr.git: src/lib
Fridrich Å trba
fridrich.strba at bluewin.ch
Sat Nov 23 06:01:45 PST 2013
src/lib/CDRContentCollector.cpp | 11 +++++++----
src/lib/CDRContentCollector.h | 2 +-
src/lib/CDROutputElementList.cpp | 15 +++++++--------
src/lib/CDROutputElementList.h | 2 +-
4 files changed, 16 insertions(+), 14 deletions(-)
New commits:
commit 84d90a4d213b15337a8030aa18e843554ca1c882
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date: Sat Nov 23 14:08:09 2013 +0100
Fold in the gradient
Change-Id: I431b96cc00343492e0cac255b3b9482a780d7749
diff --git a/src/lib/CDRContentCollector.cpp b/src/lib/CDRContentCollector.cpp
index b792842..0ce93f2 100644
--- a/src/lib/CDRContentCollector.cpp
+++ b/src/lib/CDRContentCollector.cpp
@@ -186,10 +186,9 @@ void libcdr::CDRContentCollector::_flushCurrentPath()
double x = 0.0;
double y = 0.0;
librevenge::RVNGPropertyList style;
- librevenge::RVNGPropertyListVector gradient;
- _fillProperties(style, gradient);
+ _fillProperties(style);
_lineProperties(style);
- outputElement.addStyle(style, gradient);
+ outputElement.addStyle(style);
m_currentPath.transform(m_currentTransforms);
if (!m_groupTransforms.empty())
m_currentPath.transform(m_groupTransforms.top());
@@ -602,7 +601,7 @@ void libcdr::CDRContentCollector::collectPolygonTransform(unsigned numAngles, un
m_polygon = new CDRPolygon(numAngles, nextPoint, rx, ry, cx, cy);
}
-void libcdr::CDRContentCollector::_fillProperties(librevenge::RVNGPropertyList &propList, librevenge::RVNGPropertyListVector &vec)
+void libcdr::CDRContentCollector::_fillProperties(librevenge::RVNGPropertyList &propList)
{
if (m_fillOpacity < 1.0)
propList.insert("draw:opacity", m_fillOpacity, librevenge::RVNG_PERCENT);
@@ -674,6 +673,7 @@ void libcdr::CDRContentCollector::_fillProperties(librevenge::RVNGPropertyList &
while (angle > 360.0)
angle -= 360.0;
propList.insert("draw:angle", (int)angle);
+ librevenge::RVNGPropertyListVector vec;
for (unsigned i = 0; i < m_currentFillStyle.gradient.m_stops.size(); i++)
{
libcdr::CDRGradientStop &gradStop = m_currentFillStyle.gradient.m_stops[i];
@@ -683,6 +683,7 @@ void libcdr::CDRContentCollector::_fillProperties(librevenge::RVNGPropertyList &
stopElement.insert("svg:stop-opacity", m_fillOpacity, librevenge::RVNG_PERCENT);
vec.append(stopElement);
}
+ propList.insert("svg:linearGradient", vec);
break;
}
}
@@ -697,6 +698,7 @@ void libcdr::CDRContentCollector::_fillProperties(librevenge::RVNGPropertyList &
while (angle > 360.0)
angle -= 360.0;
propList.insert("draw:angle", (int)angle);
+ librevenge::RVNGPropertyListVector vec;
for (unsigned i = 0; i < m_currentFillStyle.gradient.m_stops.size(); i++)
{
libcdr::CDRGradientStop &gradStop = m_currentFillStyle.gradient.m_stops[i];
@@ -706,6 +708,7 @@ void libcdr::CDRContentCollector::_fillProperties(librevenge::RVNGPropertyList &
stopElement.insert("svg:stop-opacity", m_fillOpacity, librevenge::RVNG_PERCENT);
vec.append(stopElement);
}
+ propList.insert("svg:linearGradient", vec);
}
break;
case 7: // Pattern
diff --git a/src/lib/CDRContentCollector.h b/src/lib/CDRContentCollector.h
index 80b42d9..b84f84b 100644
--- a/src/lib/CDRContentCollector.h
+++ b/src/lib/CDRContentCollector.h
@@ -95,7 +95,7 @@ private:
void _endPage();
void _flushCurrentPath();
- void _fillProperties(librevenge::RVNGPropertyList &propList, librevenge::RVNGPropertyListVector &vec);
+ void _fillProperties(librevenge::RVNGPropertyList &propList);
void _lineProperties(librevenge::RVNGPropertyList &propList);
void _generateBitmapFromPattern(librevenge::RVNGBinaryData &bitmap, const CDRPattern &pattern, const CDRColor &fgColor, const CDRColor &bgColor);
diff --git a/src/lib/CDROutputElementList.cpp b/src/lib/CDROutputElementList.cpp
index f70c57b..6a2ecd3 100644
--- a/src/lib/CDROutputElementList.cpp
+++ b/src/lib/CDROutputElementList.cpp
@@ -45,16 +45,15 @@ public:
class CDRStyleOutputElement : public CDROutputElement
{
public:
- CDRStyleOutputElement(const librevenge::RVNGPropertyList &propList, const librevenge::RVNGPropertyListVector &propListVec);
+ CDRStyleOutputElement(const librevenge::RVNGPropertyList &propList);
virtual ~CDRStyleOutputElement() {}
virtual void draw(librevenge::RVNGDrawingInterface *painter);
virtual CDROutputElement *clone()
{
- return new CDRStyleOutputElement(m_propList, m_propListVec);
+ return new CDRStyleOutputElement(m_propList);
}
private:
librevenge::RVNGPropertyList m_propList;
- librevenge::RVNGPropertyListVector m_propListVec;
};
@@ -214,13 +213,13 @@ public:
} // namespace libcdr
-libcdr::CDRStyleOutputElement::CDRStyleOutputElement(const librevenge::RVNGPropertyList &propList, const librevenge::RVNGPropertyListVector &propListVec) :
- m_propList(propList), m_propListVec(propListVec) {}
+libcdr::CDRStyleOutputElement::CDRStyleOutputElement(const librevenge::RVNGPropertyList &propList) :
+ m_propList(propList) {}
void libcdr::CDRStyleOutputElement::draw(librevenge::RVNGDrawingInterface *painter)
{
if (painter)
- painter->setStyle(m_propList, m_propListVec);
+ painter->setStyle(m_propList);
}
@@ -367,9 +366,9 @@ void libcdr::CDROutputElementList::draw(librevenge::RVNGDrawingInterface *painte
(*iter)->draw(painter);
}
-void libcdr::CDROutputElementList::addStyle(const librevenge::RVNGPropertyList &propList, const librevenge::RVNGPropertyListVector &propListVec)
+void libcdr::CDROutputElementList::addStyle(const librevenge::RVNGPropertyList &propList)
{
- m_elements.push_back(new CDRStyleOutputElement(propList, propListVec));
+ m_elements.push_back(new CDRStyleOutputElement(propList));
}
void libcdr::CDROutputElementList::addPath(const librevenge::RVNGPropertyList &propList)
diff --git a/src/lib/CDROutputElementList.h b/src/lib/CDROutputElementList.h
index 06fae1a..ed33401 100644
--- a/src/lib/CDROutputElementList.h
+++ b/src/lib/CDROutputElementList.h
@@ -49,7 +49,7 @@ public:
CDROutputElementList &operator=(const CDROutputElementList &elementList);
virtual ~CDROutputElementList();
void draw(librevenge::RVNGDrawingInterface *painter) const;
- void addStyle(const librevenge::RVNGPropertyList &propList, const librevenge::RVNGPropertyListVector &propListVec);
+ void addStyle(const librevenge::RVNGPropertyList &propList);
void addPath(const librevenge::RVNGPropertyList &propList);
void addGraphicObject(const librevenge::RVNGPropertyList &propList);
void addStartTextObject(const librevenge::RVNGPropertyList &propList);
More information about the Libreoffice-commits
mailing list