You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2012/01/10 15:59:17 UTC
svn commit: r1229573 - in /incubator/ooo/trunk/main/svgio/source/svgreader:
svgpolynode.cxx svgstylenode.cxx
Author: alg
Date: Tue Jan 10 14:59:16 2012
New Revision: 1229573
URL: http://svn.apache.org/viewvc?rev=1229573&view=rev
Log:
#118737# Support multiple styles in a css/style statement, use the right identifiers for polygon and polynode
Modified:
incubator/ooo/trunk/main/svgio/source/svgreader/svgpolynode.cxx
incubator/ooo/trunk/main/svgio/source/svgreader/svgstylenode.cxx
Modified: incubator/ooo/trunk/main/svgio/source/svgreader/svgpolynode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svgio/source/svgreader/svgpolynode.cxx?rev=1229573&r1=1229572&r2=1229573&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svgio/source/svgreader/svgpolynode.cxx (original)
+++ incubator/ooo/trunk/main/svgio/source/svgreader/svgpolynode.cxx Tue Jan 10 14:59:16 2012
@@ -52,8 +52,9 @@ namespace svgio
const SvgStyleAttributes* SvgPolyNode::getSvgStyleAttributes() const
{
- static rtl::OUString aClassStr(rtl::OUString::createFromAscii("poly"));
- maSvgStyleAttributes.checkForCssStyle(aClassStr);
+ static rtl::OUString aClassStrA(rtl::OUString::createFromAscii("polygon"));
+ static rtl::OUString aClassStrB(rtl::OUString::createFromAscii("polyline"));
+ maSvgStyleAttributes.checkForCssStyle(mbIsPolyline? aClassStrB : aClassStrA);
return &maSvgStyleAttributes;
}
Modified: incubator/ooo/trunk/main/svgio/source/svgreader/svgstylenode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svgio/source/svgreader/svgstylenode.cxx?rev=1229573&r1=1229572&r2=1229573&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svgio/source/svgreader/svgstylenode.cxx (original)
+++ incubator/ooo/trunk/main/svgio/source/svgreader/svgstylenode.cxx Tue Jan 10 14:59:16 2012
@@ -86,27 +86,38 @@ namespace svgio
sal_Int32 nPos(0);
rtl::OUStringBuffer aTokenValue;
- skip_char(aContent, sal_Unicode(' '), sal_Unicode('#'), nPos, nLen);
- copyToLimiter(aContent, sal_Unicode('{'), nPos, aTokenValue, nLen);
- const rtl::OUString aStyleName = aTokenValue.makeStringAndClear().trim();
-
- if(aStyleName.getLength())
+ while(nPos < nLen)
{
- skip_char(aContent, sal_Unicode(' '), sal_Unicode('{'), nPos, nLen);
- copyToLimiter(aContent, sal_Unicode('}'), nPos, aTokenValue, nLen);
- const rtl::OUString aStyleContent = aTokenValue.makeStringAndClear().trim();
+ const sal_Int32 nInitPos(nPos);
+ skip_char(aContent, sal_Unicode(' '), sal_Unicode('#'), nPos, nLen);
+ copyToLimiter(aContent, sal_Unicode('{'), nPos, aTokenValue, nLen);
+ const rtl::OUString aStyleName = aTokenValue.makeStringAndClear().trim();
- if(aStyleContent.getLength())
+ if(aStyleName.getLength() && nPos < nLen)
{
- // create new style
- SvgStyleAttributes* pNewStyle = new SvgStyleAttributes(*this);
- maSvgStyleAttributes.push_back(pNewStyle);
-
- // fill with content
- pNewStyle->readStyle(aStyleContent);
+ skip_char(aContent, sal_Unicode(' '), sal_Unicode('{'), nPos, nLen);
+ copyToLimiter(aContent, sal_Unicode('}'), nPos, aTokenValue, nLen);
+ skip_char(aContent, sal_Unicode(' '), sal_Unicode('}'), nPos, nLen);
+ const rtl::OUString aStyleContent = aTokenValue.makeStringAndClear().trim();
+
+ if(aStyleContent.getLength())
+ {
+ // create new style
+ SvgStyleAttributes* pNewStyle = new SvgStyleAttributes(*this);
+ maSvgStyleAttributes.push_back(pNewStyle);
+
+ // fill with content
+ pNewStyle->readStyle(aStyleContent);
+
+ // register new style at document
+ const_cast< SvgDocument& >(getDocument()).addSvgStyleAttributesToMapper(aStyleName, *pNewStyle);
+ }
+ }
- // register new style at document
- const_cast< SvgDocument& >(getDocument()).addSvgStyleAttributesToMapper(aStyleName, *pNewStyle);
+ if(nInitPos == nPos)
+ {
+ OSL_ENSURE(false, "Could not interpret on current position (!)");
+ nPos++;
}
}
}