svgstyleattributes.cxx (0813cdfd) | svgstyleattributes.cxx (01e92ad6) |
---|---|
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 --- 304 unchanged lines hidden (view full) --- 313 drawinglayer::primitive2d::SvgGradientEntryVector aSvgGradientEntryVector; 314 315 // get the color stops 316 rFillGradient.collectGradientEntries(aSvgGradientEntryVector); 317 318 if(!aSvgGradientEntryVector.empty()) 319 { 320 basegfx::B2DHomMatrix aGeoToUnit; | 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 --- 304 unchanged lines hidden (view full) --- 313 drawinglayer::primitive2d::SvgGradientEntryVector aSvgGradientEntryVector; 314 315 // get the color stops 316 rFillGradient.collectGradientEntries(aSvgGradientEntryVector); 317 318 if(!aSvgGradientEntryVector.empty()) 319 { 320 basegfx::B2DHomMatrix aGeoToUnit; |
321 basegfx::B2DHomMatrix aGradientTransform; |
|
321 322 if(rFillGradient.getGradientTransform()) 323 { | 322 323 if(rFillGradient.getGradientTransform()) 324 { |
324 aGeoToUnit = *rFillGradient.getGradientTransform(); | 325 aGradientTransform = *rFillGradient.getGradientTransform(); |
325 } 326 327 if(userSpaceOnUse == rFillGradient.getGradientUnits()) 328 { 329 aGeoToUnit.translate(-rGeoRange.getMinX(), -rGeoRange.getMinY()); 330 aGeoToUnit.scale(1.0 / rGeoRange.getWidth(), 1.0 / rGeoRange.getHeight()); 331 } 332 --- 28 unchanged lines hidden (view full) --- 361 { 362 aStart *= aGeoToUnit; 363 aEnd *= aGeoToUnit; 364 } 365 366 drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence( 367 rTarget, 368 new drawinglayer::primitive2d::SvgLinearGradientPrimitive2D( | 326 } 327 328 if(userSpaceOnUse == rFillGradient.getGradientUnits()) 329 { 330 aGeoToUnit.translate(-rGeoRange.getMinX(), -rGeoRange.getMinY()); 331 aGeoToUnit.scale(1.0 / rGeoRange.getWidth(), 1.0 / rGeoRange.getHeight()); 332 } 333 --- 28 unchanged lines hidden (view full) --- 362 { 363 aStart *= aGeoToUnit; 364 aEnd *= aGeoToUnit; 365 } 366 367 drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence( 368 rTarget, 369 new drawinglayer::primitive2d::SvgLinearGradientPrimitive2D( |
370 aGradientTransform, |
|
369 rPath, 370 aSvgGradientEntryVector, 371 aStart, 372 aEnd, 373 userSpaceOnUse != rFillGradient.getGradientUnits(), 374 rFillGradient.getSpreadMethod())); 375 } 376 else --- 45 unchanged lines hidden (view full) --- 422 { 423 aFocal *= aGeoToUnit; 424 } 425 } 426 427 drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence( 428 rTarget, 429 new drawinglayer::primitive2d::SvgRadialGradientPrimitive2D( | 371 rPath, 372 aSvgGradientEntryVector, 373 aStart, 374 aEnd, 375 userSpaceOnUse != rFillGradient.getGradientUnits(), 376 rFillGradient.getSpreadMethod())); 377 } 378 else --- 45 unchanged lines hidden (view full) --- 424 { 425 aFocal *= aGeoToUnit; 426 } 427 } 428 429 drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence( 430 rTarget, 431 new drawinglayer::primitive2d::SvgRadialGradientPrimitive2D( |
432 aGradientTransform, |
|
430 rPath, 431 aSvgGradientEntryVector, 432 aStart, 433 fRadius, 434 userSpaceOnUse != rFillGradient.getGradientUnits(), 435 rFillGradient.getSpreadMethod(), 436 bFocal ? &aFocal : 0)); 437 } --- 741 unchanged lines hidden (view full) --- 1179 } 1180 } 1181 } 1182 1183 SvgStyleAttributes::~SvgStyleAttributes() 1184 { 1185 } 1186 | 433 rPath, 434 aSvgGradientEntryVector, 435 aStart, 436 fRadius, 437 userSpaceOnUse != rFillGradient.getGradientUnits(), 438 rFillGradient.getSpreadMethod(), 439 bFocal ? &aFocal : 0)); 440 } --- 741 unchanged lines hidden (view full) --- 1182 } 1183 } 1184 } 1185 1186 SvgStyleAttributes::~SvgStyleAttributes() 1187 { 1188 } 1189 |
1187 void SvgStyleAttributes::parseStyleAttribute(const rtl::OUString& /*rTokenName*/, SVGToken aSVGToken, const rtl::OUString& aContent) | 1190 void SvgStyleAttributes::parseStyleAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent) |
1188 { 1189 switch(aSVGToken) 1190 { 1191 case SVGTokenFill: 1192 { 1193 SvgPaint aSvgPaint; 1194 rtl::OUString aURL; 1195 --- 587 unchanged lines hidden (view full) --- 1783 readLocalUrl(aContent, maMarkerMidXLink); 1784 break; 1785 } 1786 case SVGTokenMarkerEnd: 1787 { 1788 readLocalUrl(aContent, maMarkerEndXLink); 1789 break; 1790 } | 1191 { 1192 switch(aSVGToken) 1193 { 1194 case SVGTokenFill: 1195 { 1196 SvgPaint aSvgPaint; 1197 rtl::OUString aURL; 1198 --- 587 unchanged lines hidden (view full) --- 1786 readLocalUrl(aContent, maMarkerMidXLink); 1787 break; 1788 } 1789 case SVGTokenMarkerEnd: 1790 { 1791 readLocalUrl(aContent, maMarkerEndXLink); 1792 break; 1793 } |
1794 case SVGTokenDisplay: 1795 { 1796 // There may be display:none statements inside of style defines, e.g. the following line: 1797 // style="display:none" 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 } |
|
1791 default: 1792 { 1793 break; 1794 } 1795 } 1796 } 1797 1798 const basegfx::BColor* SvgStyleAttributes::getFill() const --- 666 unchanged lines hidden --- | 1806 default: 1807 { 1808 break; 1809 } 1810 } 1811 } 1812 1813 const basegfx::BColor* SvgStyleAttributes::getFill() const --- 666 unchanged lines hidden --- |