svgstyleattributes.cxx (363947da) svgstyleattributes.cxx (86d02030)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 1155 unchanged lines hidden (view full) ---

1164 maMarkerStartXLink(),
1165 mpMarkerStartXLink(0),
1166 maMarkerMidXLink(),
1167 mpMarkerMidXLink(0),
1168 maMarkerEndXLink(),
1169 mpMarkerEndXLink(0),
1170 maFillRule(FillRule_notset),
1171 maClipRule(FillRule_nonzero),
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 1155 unchanged lines hidden (view full) ---

1164 maMarkerStartXLink(),
1165 mpMarkerStartXLink(0),
1166 maMarkerMidXLink(),
1167 mpMarkerMidXLink(0),
1168 maMarkerEndXLink(),
1169 mpMarkerEndXLink(0),
1170 maFillRule(FillRule_notset),
1171 maClipRule(FillRule_nonzero),
1172 maBaselineShift(BaselineShift_Baseline),
1173 maBaselineShiftNumber(0),
1172 mbIsClipPathContent(SVGTokenClipPathNode == mrOwner.getType()),
1173 mbStrokeDasharraySet(false)
1174 {
1175 if(!mbIsClipPathContent)
1176 {
1177 const SvgStyleAttributes* pParentStyle = getParentStyle();
1178
1179 if(pParentStyle)

--- 618 unchanged lines hidden (view full) ---

1798 // taken from a svg example; this needs to be parsed and set at the owning node. Do not call
1799 // mrOwner.parseAttribute(...) here, this would lead to a recursion
1800 if(aContent.getLength())
1801 {
1802 mrOwner.setDisplay(getDisplayFromContent(aContent));
1803 }
1804 break;
1805 }
1174 mbIsClipPathContent(SVGTokenClipPathNode == mrOwner.getType()),
1175 mbStrokeDasharraySet(false)
1176 {
1177 if(!mbIsClipPathContent)
1178 {
1179 const SvgStyleAttributes* pParentStyle = getParentStyle();
1180
1181 if(pParentStyle)

--- 618 unchanged lines hidden (view full) ---

1800 // taken from a svg example; this needs to be parsed and set at the owning node. Do not call
1801 // mrOwner.parseAttribute(...) here, this would lead to a recursion
1802 if(aContent.getLength())
1803 {
1804 mrOwner.setDisplay(getDisplayFromContent(aContent));
1805 }
1806 break;
1807 }
1808 case SVGTokenBaselineShift:
1809 {
1810 if(aContent.getLength())
1811 {
1812 static rtl::OUString aStrSub(rtl::OUString::createFromAscii("sub"));
1813 static rtl::OUString aStrSuper(rtl::OUString::createFromAscii("super"));
1814 SvgNumber aNum;
1815
1816 if(aContent.match(aStrSub))
1817 {
1818 setBaselineShift(BaselineShift_Sub);
1819 }
1820 else if(aContent.match(aStrSuper))
1821 {
1822 setBaselineShift(BaselineShift_Super);
1823 }
1824 else if(readSingleNumber(aContent, aNum))
1825 {
1826 setBaselineShiftNumber(aNum);
1827
1828 if(Unit_percent == aNum.getUnit())
1829 {
1830 setBaselineShift(BaselineShift_Percentage);
1831 }
1832 else
1833 {
1834 setBaselineShift(BaselineShift_Length);
1835 }
1836 }
1837 else
1838 {
1839 // no BaselineShift or inherit (which is automatically)
1840 setBaselineShift(BaselineShift_Baseline);
1841 }
1842 }
1843 break;
1844 }
1806 default:
1807 {
1808 break;
1809 }
1810 }
1811 }
1812
1813 const basegfx::BColor* SvgStyleAttributes::getFill() const

--- 365 unchanged lines hidden (view full) ---

2179 // default is empty
2180 return maFontFamily;
2181 }
2182
2183 SvgNumber SvgStyleAttributes::getFontSize() const
2184 {
2185 if(maFontSize.isSet())
2186 {
1845 default:
1846 {
1847 break;
1848 }
1849 }
1850 }
1851
1852 const basegfx::BColor* SvgStyleAttributes::getFill() const

--- 365 unchanged lines hidden (view full) ---

2218 // default is empty
2219 return maFontFamily;
2220 }
2221
2222 SvgNumber SvgStyleAttributes::getFontSize() const
2223 {
2224 if(maFontSize.isSet())
2225 {
2226 // #122524# Handle Unit_percent realtive to parent FontSize (see SVG1.1
2227 // spec 10.10 Font selection properties �font-size�, lastline (klick 'normative
2228 // definition of the property')
2229 if(Unit_percent == maFontSize.getUnit())
2230 {
2231 const SvgStyleAttributes* pSvgStyleAttributes = getParentStyle();
2232
2233 if(pSvgStyleAttributes)
2234 {
2235 const SvgNumber aParentNumber = pSvgStyleAttributes->getFontSize();
2236
2237 return SvgNumber(
2238 aParentNumber.getNumber() * maFontSize.getNumber() * 0.01,
2239 aParentNumber.getUnit(),
2240 true);
2241 }
2242 }
2243
2187 return maFontSize;
2188 }
2189
2190 const SvgStyleAttributes* pSvgStyleAttributes = getParentStyle();
2191
2192 if(pSvgStyleAttributes)
2193 {
2194 return pSvgStyleAttributes->getFontSize();

--- 272 unchanged lines hidden (view full) ---

2467 {
2468 const_cast< SvgStyleAttributes* >(this)->mpMarkerEndXLink = dynamic_cast< const SvgMarkerNode* >(mrOwner.getDocument().findSvgNodeById(getMarkerEndXLink()));
2469 }
2470 }
2471
2472 return mpMarkerEndXLink;
2473 }
2474
2244 return maFontSize;
2245 }
2246
2247 const SvgStyleAttributes* pSvgStyleAttributes = getParentStyle();
2248
2249 if(pSvgStyleAttributes)
2250 {
2251 return pSvgStyleAttributes->getFontSize();

--- 272 unchanged lines hidden (view full) ---

2524 {
2525 const_cast< SvgStyleAttributes* >(this)->mpMarkerEndXLink = dynamic_cast< const SvgMarkerNode* >(mrOwner.getDocument().findSvgNodeById(getMarkerEndXLink()));
2526 }
2527 }
2528
2529 return mpMarkerEndXLink;
2530 }
2531
2532 SvgNumber SvgStyleAttributes::getBaselineShiftNumber() const
2533 {
2534 // #122524# Handle Unit_percent realtive to parent BaselineShift
2535 if(Unit_percent == maBaselineShiftNumber.getUnit())
2536 {
2537 const SvgStyleAttributes* pSvgStyleAttributes = getParentStyle();
2538
2539 if(pSvgStyleAttributes)
2540 {
2541 const SvgNumber aParentNumber = pSvgStyleAttributes->getBaselineShiftNumber();
2542
2543 return SvgNumber(
2544 aParentNumber.getNumber() * maBaselineShiftNumber.getNumber() * 0.01,
2545 aParentNumber.getUnit(),
2546 true);
2547 }
2548 }
2549
2550 return maBaselineShiftNumber;
2551 }
2475 } // end of namespace svgreader
2476} // end of namespace svgio
2477
2478//////////////////////////////////////////////////////////////////////////////
2479// eof
2552 } // end of namespace svgreader
2553} // end of namespace svgio
2554
2555//////////////////////////////////////////////////////////////////////////////
2556// eof