Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
37446076
Kaydet (Commit)
37446076
authored
Tem 25, 2012
tarafından
Armin Le Grand
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#120334# Added support for multiple CSS styles per graphic primitive in SVG
üst
5ee3e9d6
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
144 additions
and
107 deletions
+144
-107
svgnode.hxx
svgio/inc/svgio/svgreader/svgnode.hxx
+8
-0
svgstyleattributes.hxx
svgio/inc/svgio/svgreader/svgstyleattributes.hxx
+18
-10
svgcirclenode.cxx
svgio/source/svgreader/svgcirclenode.cxx
+1
-2
svgellipsenode.cxx
svgio/source/svgreader/svgellipsenode.cxx
+1
-2
svggnode.cxx
svgio/source/svgreader/svggnode.cxx
+1
-2
svgimagenode.cxx
svgio/source/svgreader/svgimagenode.cxx
+1
-2
svglinenode.cxx
svgio/source/svgreader/svglinenode.cxx
+1
-2
svgmarkernode.cxx
svgio/source/svgreader/svgmarkernode.cxx
+1
-2
svgnode.cxx
svgio/source/svgreader/svgnode.cxx
+92
-1
svgpathnode.cxx
svgio/source/svgreader/svgpathnode.cxx
+1
-2
svgpatternnode.cxx
svgio/source/svgreader/svgpatternnode.cxx
+1
-2
svgpolynode.cxx
svgio/source/svgreader/svgpolynode.cxx
+1
-2
svgrectnode.cxx
svgio/source/svgreader/svgrectnode.cxx
+1
-2
svgstyleattributes.cxx
svgio/source/svgreader/svgstyleattributes.cxx
+14
-72
svgtextnode.cxx
svgio/source/svgreader/svgtextnode.cxx
+1
-2
svgusenode.cxx
svgio/source/svgreader/svgusenode.cxx
+1
-2
No files found.
svgio/inc/svgio/svgreader/svgnode.hxx
Dosyayı görüntüle @
37446076
...
@@ -50,6 +50,7 @@ namespace svgio
...
@@ -50,6 +50,7 @@ namespace svgio
namespace
svgreader
namespace
svgreader
{
{
typedef
::
std
::
vector
<
SvgNode
*
>
SvgNodeVector
;
typedef
::
std
::
vector
<
SvgNode
*
>
SvgNodeVector
;
typedef
::
std
::
vector
<
const
SvgStyleAttributes
*
>
SvgStyleAttributeVector
;
enum
XmlSpace
enum
XmlSpace
{
{
...
@@ -79,6 +80,13 @@ namespace svgio
...
@@ -79,6 +80,13 @@ namespace svgio
/// XmlSpace value
/// XmlSpace value
XmlSpace
maXmlSpace
;
XmlSpace
maXmlSpace
;
/// CSS styles
SvgStyleAttributeVector
maCssStyleVector
;
protected
:
/// helper to evtl. link to css style
const
SvgStyleAttributes
*
checkForCssStyle
(
const
rtl
::
OUString
&
rClassStr
,
const
SvgStyleAttributes
&
rOriginal
)
const
;
public
:
public
:
SvgNode
(
SvgNode
(
SVGToken
aType
,
SVGToken
aType
,
...
...
svgio/inc/svgio/svgreader/svgstyleattributes.hxx
Dosyayı görüntüle @
37446076
...
@@ -139,12 +139,18 @@ namespace svgio
...
@@ -139,12 +139,18 @@ namespace svgio
TextAnchor_end
TextAnchor_end
};
};
enum
FillRule
{
FillRule_notset
,
FillRule_nonzero
,
FillRule_evenodd
};
class
SvgStyleAttributes
class
SvgStyleAttributes
{
{
private
:
private
:
SvgNode
&
mrOwner
;
SvgNode
&
mrOwner
;
const
SvgStyleAttributes
*
mpCssStyleParent
;
const
SvgStyleAttributes
*
mpCssStyleParent
;
SvgPaint
maFill
;
SvgPaint
maFill
;
SvgPaint
maStroke
;
SvgPaint
maStroke
;
SvgPaint
maStopColor
;
SvgPaint
maStopColor
;
...
@@ -187,18 +193,19 @@ namespace svgio
...
@@ -187,18 +193,19 @@ namespace svgio
rtl
::
OUString
maMarkerEndXLink
;
rtl
::
OUString
maMarkerEndXLink
;
const
SvgMarkerNode
*
mpMarkerEndXLink
;
const
SvgMarkerNode
*
mpMarkerEndXLink
;
/// fill rule
FillRule
maFillRule
;
// ClipRule setting (only valid wne mbIsClipPathContent == true, default is FillRule_nonzero)
FillRule
maClipRule
;
/// bitfield
/// bitfield
bool
maFillRule
:
1
;
// true: NonZero, false: EvenOdd
bool
maFillRuleSet
:
1
;
// defines if this attributes are part of a ClipPath. If yes,
// defines if this attributes are part of a ClipPath. If yes,
// rough geometry will be created on decomposition by patching
// rough geometry will be created on decomposition by patching
// vaules for fill, stroke, strokeWidth and others
// vaules for fill, stroke, strokeWidth and others
bool
mbIsClipPathContent
:
1
;
bool
mbIsClipPathContent
:
1
;
// ClipRule setting (only valid wne mbIsClipPathContent == true)
bool
mbClipRule
:
1
;
// true == nonzero(default), false == evenodd
/// internal helpers
/// internal helpers
void
add_fillGradient
(
void
add_fillGradient
(
const
basegfx
::
B2DPolyPolygon
&
rPath
,
const
basegfx
::
B2DPolyPolygon
&
rPath
,
...
@@ -256,8 +263,9 @@ namespace svgio
...
@@ -256,8 +263,9 @@ namespace svgio
const
drawinglayer
::
primitive2d
::
Primitive2DSequence
&
rSource
,
const
drawinglayer
::
primitive2d
::
Primitive2DSequence
&
rSource
,
const
basegfx
::
B2DHomMatrix
*
pTransform
)
const
;
const
basegfx
::
B2DHomMatrix
*
pTransform
)
const
;
/// helper to evtl. link to css style
/// helper to set mpCssStyleParent temporarily for CSS style hierarchies
void
checkForCssStyle
(
const
rtl
::
OUString
&
rClassStr
)
const
;
void
setCssStyleParent
(
const
SvgStyleAttributes
*
pNew
)
{
mpCssStyleParent
=
pNew
;
}
const
SvgStyleAttributes
*
getCssStyleParent
()
const
{
return
mpCssStyleParent
;
}
/// scan helpers
/// scan helpers
void
readStyle
(
const
rtl
::
OUString
&
rCandidate
);
void
readStyle
(
const
rtl
::
OUString
&
rCandidate
);
...
@@ -307,8 +315,8 @@ namespace svgio
...
@@ -307,8 +315,8 @@ namespace svgio
void
setFillOpacity
(
const
SvgNumber
&
rFillOpacity
=
SvgNumber
())
{
maFillOpacity
=
rFillOpacity
;
}
void
setFillOpacity
(
const
SvgNumber
&
rFillOpacity
=
SvgNumber
())
{
maFillOpacity
=
rFillOpacity
;
}
/// fill rule content
/// fill rule content
bool
getFillRule
()
const
;
const
FillRule
getFillRule
()
const
;
void
setFillRule
(
const
bool
*
pFillRule
=
0
);
void
setFillRule
(
const
FillRule
aFillRule
=
FillRule_notset
)
{
maFillRule
=
aFillRule
;
}
/// fill StrokeDasharray content
/// fill StrokeDasharray content
const
SvgNumberVector
&
getStrokeDasharray
()
const
;
const
SvgNumberVector
&
getStrokeDasharray
()
const
;
...
...
svgio/source/svgreader/svgcirclenode.cxx
Dosyayı görüntüle @
37446076
...
@@ -52,9 +52,8 @@ namespace svgio
...
@@ -52,9 +52,8 @@ namespace svgio
const
SvgStyleAttributes
*
SvgCircleNode
::
getSvgStyleAttributes
()
const
const
SvgStyleAttributes
*
SvgCircleNode
::
getSvgStyleAttributes
()
const
{
{
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"circle"
));
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"circle"
));
maSvgStyleAttributes
.
checkForCssStyle
(
aClassStr
);
return
&
maSvgStyleAttributes
;
return
checkForCssStyle
(
aClassStr
,
maSvgStyleAttributes
)
;
}
}
void
SvgCircleNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
void
SvgCircleNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
...
...
svgio/source/svgreader/svgellipsenode.cxx
Dosyayı görüntüle @
37446076
...
@@ -53,9 +53,8 @@ namespace svgio
...
@@ -53,9 +53,8 @@ namespace svgio
const
SvgStyleAttributes
*
SvgEllipseNode
::
getSvgStyleAttributes
()
const
const
SvgStyleAttributes
*
SvgEllipseNode
::
getSvgStyleAttributes
()
const
{
{
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"ellipse"
));
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"ellipse"
));
maSvgStyleAttributes
.
checkForCssStyle
(
aClassStr
);
return
&
maSvgStyleAttributes
;
return
checkForCssStyle
(
aClassStr
,
maSvgStyleAttributes
)
;
}
}
void
SvgEllipseNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
void
SvgEllipseNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
...
...
svgio/source/svgreader/svggnode.cxx
Dosyayı görüntüle @
37446076
...
@@ -51,9 +51,8 @@ namespace svgio
...
@@ -51,9 +51,8 @@ namespace svgio
const
SvgStyleAttributes
*
SvgGNode
::
getSvgStyleAttributes
()
const
const
SvgStyleAttributes
*
SvgGNode
::
getSvgStyleAttributes
()
const
{
{
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"g"
));
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"g"
));
maSvgStyleAttributes
.
checkForCssStyle
(
aClassStr
);
return
&
maSvgStyleAttributes
;
return
checkForCssStyle
(
aClassStr
,
maSvgStyleAttributes
)
;
}
}
void
SvgGNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
void
SvgGNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
...
...
svgio/source/svgreader/svgimagenode.cxx
Dosyayı görüntüle @
37446076
...
@@ -70,9 +70,8 @@ namespace svgio
...
@@ -70,9 +70,8 @@ namespace svgio
const
SvgStyleAttributes
*
SvgImageNode
::
getSvgStyleAttributes
()
const
const
SvgStyleAttributes
*
SvgImageNode
::
getSvgStyleAttributes
()
const
{
{
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"image"
));
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"image"
));
maSvgStyleAttributes
.
checkForCssStyle
(
aClassStr
);
return
&
maSvgStyleAttributes
;
return
checkForCssStyle
(
aClassStr
,
maSvgStyleAttributes
)
;
}
}
void
SvgImageNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
void
SvgImageNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
...
...
svgio/source/svgreader/svglinenode.cxx
Dosyayı görüntüle @
37446076
...
@@ -53,9 +53,8 @@ namespace svgio
...
@@ -53,9 +53,8 @@ namespace svgio
const
SvgStyleAttributes
*
SvgLineNode
::
getSvgStyleAttributes
()
const
const
SvgStyleAttributes
*
SvgLineNode
::
getSvgStyleAttributes
()
const
{
{
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"line"
));
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"line"
));
maSvgStyleAttributes
.
checkForCssStyle
(
aClassStr
);
return
&
maSvgStyleAttributes
;
return
checkForCssStyle
(
aClassStr
,
maSvgStyleAttributes
)
;
}
}
void
SvgLineNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
void
SvgLineNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
...
...
svgio/source/svgreader/svgmarkernode.cxx
Dosyayı görüntüle @
37446076
...
@@ -56,9 +56,8 @@ namespace svgio
...
@@ -56,9 +56,8 @@ namespace svgio
const
SvgStyleAttributes
*
SvgMarkerNode
::
getSvgStyleAttributes
()
const
const
SvgStyleAttributes
*
SvgMarkerNode
::
getSvgStyleAttributes
()
const
{
{
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"marker"
));
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"marker"
));
maSvgStyleAttributes
.
checkForCssStyle
(
aClassStr
);
return
&
maSvgStyleAttributes
;
return
checkForCssStyle
(
aClassStr
,
maSvgStyleAttributes
)
;
}
}
void
SvgMarkerNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
void
SvgMarkerNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
...
...
svgio/source/svgreader/svgnode.cxx
Dosyayı görüntüle @
37446076
...
@@ -41,6 +41,96 @@ namespace svgio
...
@@ -41,6 +41,96 @@ namespace svgio
return
0
;
return
0
;
}
}
const
SvgStyleAttributes
*
SvgNode
::
checkForCssStyle
(
const
rtl
::
OUString
&
rClassStr
,
const
SvgStyleAttributes
&
rOriginal
)
const
{
const
SvgDocument
&
rDocument
=
getDocument
();
if
(
rDocument
.
hasSvgStyleAttributesById
())
{
if
(
getClass
())
{
// find all referenced CSS styles, a list of entries is allowed
const
rtl
::
OUString
*
pClassList
=
getClass
();
const
sal_Int32
nLen
(
pClassList
->
getLength
());
sal_Int32
nPos
(
0
);
const
SvgStyleAttributes
*
pNew
=
0
;
skip_char
(
*
pClassList
,
sal_Unicode
(
' '
),
nPos
,
nLen
);
while
(
nPos
<
nLen
)
{
rtl
::
OUStringBuffer
aTokenValue
;
copyToLimiter
(
*
pClassList
,
sal_Unicode
(
' '
),
nPos
,
aTokenValue
,
nLen
);
skip_char
(
*
pClassList
,
sal_Unicode
(
' '
),
nPos
,
nLen
);
rtl
::
OUString
aId
(
rtl
::
OUString
::
createFromAscii
(
"."
));
const
rtl
::
OUString
aOUTokenValue
(
aTokenValue
.
makeStringAndClear
());
// look for CSS style common to token
aId
=
aId
+
aOUTokenValue
;
pNew
=
rDocument
.
findSvgStyleAttributesById
(
aId
);
if
(
!
pNew
&&
rClassStr
.
getLength
())
{
// look for CSS style common to class.token
aId
=
rClassStr
+
aId
;
pNew
=
rDocument
.
findSvgStyleAttributesById
(
aId
);
}
if
(
pNew
)
{
const_cast
<
SvgNode
*
>
(
this
)
->
maCssStyleVector
.
push_back
(
pNew
);
}
}
}
if
(
maCssStyleVector
.
empty
()
&&
getId
())
{
// if none found, search for CSS style equal to Id
const
SvgStyleAttributes
*
pNew
=
rDocument
.
findSvgStyleAttributesById
(
*
getId
());
if
(
pNew
)
{
const_cast
<
SvgNode
*
>
(
this
)
->
maCssStyleVector
.
push_back
(
pNew
);
}
}
if
(
maCssStyleVector
.
empty
()
&&
rClassStr
.
getLength
())
{
// if none found, search for CSS style equal to class type
const
SvgStyleAttributes
*
pNew
=
rDocument
.
findSvgStyleAttributesById
(
rClassStr
);
if
(
pNew
)
{
const_cast
<
SvgNode
*
>
(
this
)
->
maCssStyleVector
.
push_back
(
pNew
);
}
}
}
if
(
maCssStyleVector
.
empty
())
{
return
&
rOriginal
;
}
else
{
// set CssStyleParent at maCssStyleVector members to hang them in front of
// the existing style
SvgStyleAttributes
*
pCurrent
=
const_cast
<
SvgStyleAttributes
*
>
(
&
rOriginal
);
for
(
sal_uInt32
a
(
0
);
a
<
maCssStyleVector
.
size
();
a
++
)
{
SvgStyleAttributes
*
pCandidate
=
const_cast
<
SvgStyleAttributes
*
>
(
maCssStyleVector
[
maCssStyleVector
.
size
()
-
a
-
1
]);
pCandidate
->
setCssStyleParent
(
pCurrent
);
pCurrent
=
pCandidate
;
}
return
pCurrent
;
}
}
SvgNode
::
SvgNode
(
SvgNode
::
SvgNode
(
SVGToken
aType
,
SVGToken
aType
,
SvgDocument
&
rDocument
,
SvgDocument
&
rDocument
,
...
@@ -52,7 +142,8 @@ namespace svgio
...
@@ -52,7 +142,8 @@ namespace svgio
maChildren
(),
maChildren
(),
mpId
(
0
),
mpId
(
0
),
mpClass
(
0
),
mpClass
(
0
),
maXmlSpace
(
XmlSpace_notset
)
maXmlSpace
(
XmlSpace_notset
),
maCssStyleVector
()
{
{
OSL_ENSURE
(
SVGTokenUnknown
!=
maType
,
"SvgNode with unknown type created (!)"
);
OSL_ENSURE
(
SVGTokenUnknown
!=
maType
,
"SvgNode with unknown type created (!)"
);
...
...
svgio/source/svgreader/svgpathnode.cxx
Dosyayı görüntüle @
37446076
...
@@ -51,9 +51,8 @@ namespace svgio
...
@@ -51,9 +51,8 @@ namespace svgio
const
SvgStyleAttributes
*
SvgPathNode
::
getSvgStyleAttributes
()
const
const
SvgStyleAttributes
*
SvgPathNode
::
getSvgStyleAttributes
()
const
{
{
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"path"
));
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"path"
));
maSvgStyleAttributes
.
checkForCssStyle
(
aClassStr
);
return
&
maSvgStyleAttributes
;
return
checkForCssStyle
(
aClassStr
,
maSvgStyleAttributes
)
;
}
}
void
SvgPathNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
void
SvgPathNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
...
...
svgio/source/svgreader/svgpatternnode.cxx
Dosyayı görüntüle @
37446076
...
@@ -70,9 +70,8 @@ namespace svgio
...
@@ -70,9 +70,8 @@ namespace svgio
const
SvgStyleAttributes
*
SvgPatternNode
::
getSvgStyleAttributes
()
const
const
SvgStyleAttributes
*
SvgPatternNode
::
getSvgStyleAttributes
()
const
{
{
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"pattern"
));
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"pattern"
));
maSvgStyleAttributes
.
checkForCssStyle
(
aClassStr
);
return
&
maSvgStyleAttributes
;
return
checkForCssStyle
(
aClassStr
,
maSvgStyleAttributes
)
;
}
}
void
SvgPatternNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
void
SvgPatternNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
...
...
svgio/source/svgreader/svgpolynode.cxx
Dosyayı görüntüle @
37446076
...
@@ -54,9 +54,8 @@ namespace svgio
...
@@ -54,9 +54,8 @@ namespace svgio
{
{
static
rtl
::
OUString
aClassStrA
(
rtl
::
OUString
::
createFromAscii
(
"polygon"
));
static
rtl
::
OUString
aClassStrA
(
rtl
::
OUString
::
createFromAscii
(
"polygon"
));
static
rtl
::
OUString
aClassStrB
(
rtl
::
OUString
::
createFromAscii
(
"polyline"
));
static
rtl
::
OUString
aClassStrB
(
rtl
::
OUString
::
createFromAscii
(
"polyline"
));
maSvgStyleAttributes
.
checkForCssStyle
(
mbIsPolyline
?
aClassStrB
:
aClassStrA
);
return
&
maSvgStyleAttributes
;
return
checkForCssStyle
(
mbIsPolyline
?
aClassStrB
:
aClassStrA
,
maSvgStyleAttributes
)
;
}
}
void
SvgPolyNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
void
SvgPolyNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
...
...
svgio/source/svgreader/svgrectnode.cxx
Dosyayı görüntüle @
37446076
...
@@ -55,9 +55,8 @@ namespace svgio
...
@@ -55,9 +55,8 @@ namespace svgio
const
SvgStyleAttributes
*
SvgRectNode
::
getSvgStyleAttributes
()
const
const
SvgStyleAttributes
*
SvgRectNode
::
getSvgStyleAttributes
()
const
{
{
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"rect"
));
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"rect"
));
maSvgStyleAttributes
.
checkForCssStyle
(
aClassStr
);
return
&
maSvgStyleAttributes
;
return
checkForCssStyle
(
aClassStr
,
maSvgStyleAttributes
)
;
}
}
void
SvgRectNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
void
SvgRectNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
...
...
svgio/source/svgreader/svgstyleattributes.cxx
Dosyayı görüntüle @
37446076
...
@@ -212,53 +212,11 @@ namespace svgio
...
@@ -212,53 +212,11 @@ namespace svgio
}
}
}
}
void
SvgStyleAttributes
::
checkForCssStyle
(
const
rtl
::
OUString
&
rClassStr
)
const
{
if
(
!
mpCssStyleParent
)
{
const
SvgDocument
&
rDocument
=
mrOwner
.
getDocument
();
const
SvgStyleAttributes
*
pNew
=
0
;
if
(
rDocument
.
hasSvgStyleAttributesById
())
{
if
(
mrOwner
.
getClass
())
{
rtl
::
OUString
aId
(
rtl
::
OUString
::
createFromAscii
(
"."
));
aId
=
aId
+
*
mrOwner
.
getClass
();
pNew
=
rDocument
.
findSvgStyleAttributesById
(
aId
);
if
(
!
pNew
&&
rClassStr
.
getLength
())
{
aId
=
rClassStr
+
aId
;
pNew
=
rDocument
.
findSvgStyleAttributesById
(
aId
);
}
}
if
(
!
pNew
&&
mrOwner
.
getId
())
{
pNew
=
rDocument
.
findSvgStyleAttributesById
(
*
mrOwner
.
getId
());
}
if
(
!
pNew
&&
rClassStr
.
getLength
())
{
pNew
=
rDocument
.
findSvgStyleAttributesById
(
rClassStr
);
}
if
(
pNew
)
{
// found css style, set as parent
const_cast
<
SvgStyleAttributes
*
>
(
this
)
->
mpCssStyleParent
=
pNew
;
}
}
}
}
const
SvgStyleAttributes
*
SvgStyleAttributes
::
getParentStyle
()
const
const
SvgStyleAttributes
*
SvgStyleAttributes
::
getParentStyle
()
const
{
{
if
(
mpCssStyleParent
)
if
(
getCssStyleParent
()
)
{
{
return
mpCssStyleParent
;
return
getCssStyleParent
()
;
}
}
if
(
mrOwner
.
getParent
())
if
(
mrOwner
.
getParent
())
...
@@ -1068,8 +1026,8 @@ namespace svgio
...
@@ -1068,8 +1026,8 @@ namespace svgio
{
{
basegfx
::
B2DPolyPolygon
aPath
(
rPath
);
basegfx
::
B2DPolyPolygon
aPath
(
rPath
);
const
bool
bNeedToCheckClipRule
(
SVGTokenPath
==
mrOwner
.
getType
()
||
SVGTokenPolygon
==
mrOwner
.
getType
());
const
bool
bNeedToCheckClipRule
(
SVGTokenPath
==
mrOwner
.
getType
()
||
SVGTokenPolygon
==
mrOwner
.
getType
());
const
bool
bClipPathIsNonzero
(
!
bIsLine
&&
bNeedToCheckClipRule
&&
mbIsClipPathContent
&&
mb
ClipRule
);
const
bool
bClipPathIsNonzero
(
!
bIsLine
&&
bNeedToCheckClipRule
&&
mbIsClipPathContent
&&
FillRule_nonzero
==
ma
ClipRule
);
const
bool
bFillRuleIsNonzero
(
!
bIsLine
&&
bNeedToCheckClipRule
&&
!
mbIsClipPathContent
&&
getFillRule
());
const
bool
bFillRuleIsNonzero
(
!
bIsLine
&&
bNeedToCheckClipRule
&&
!
mbIsClipPathContent
&&
FillRule_nonzero
==
getFillRule
());
if
(
bClipPathIsNonzero
||
bFillRuleIsNonzero
)
if
(
bClipPathIsNonzero
||
bFillRuleIsNonzero
)
{
{
...
@@ -1203,10 +1161,9 @@ namespace svgio
...
@@ -1203,10 +1161,9 @@ namespace svgio
mpMarkerMidXLink
(
0
),
mpMarkerMidXLink
(
0
),
maMarkerEndXLink
(),
maMarkerEndXLink
(),
mpMarkerEndXLink
(
0
),
mpMarkerEndXLink
(
0
),
maFillRule
(
true
),
maFillRule
(
FillRule_notset
),
maFillRuleSet
(
false
),
maClipRule
(
FillRule_nonzero
),
mbIsClipPathContent
(
SVGTokenClipPathNode
==
mrOwner
.
getType
()),
mbIsClipPathContent
(
SVGTokenClipPathNode
==
mrOwner
.
getType
())
mbClipRule
(
true
)
{
{
if
(
!
mbIsClipPathContent
)
if
(
!
mbIsClipPathContent
)
{
{
...
@@ -1273,13 +1230,11 @@ namespace svgio
...
@@ -1273,13 +1230,11 @@ namespace svgio
{
{
if
(
aContent
.
match
(
commonStrings
::
aStrNonzero
))
if
(
aContent
.
match
(
commonStrings
::
aStrNonzero
))
{
{
maFillRule
=
true
;
maFillRule
=
FillRule_nonzero
;
maFillRuleSet
=
true
;
}
}
else
if
(
aContent
.
match
(
commonStrings
::
aStrEvenOdd
))
else
if
(
aContent
.
match
(
commonStrings
::
aStrEvenOdd
))
{
{
maFillRule
=
false
;
maFillRule
=
FillRule_evenodd
;
maFillRuleSet
=
true
;
}
}
}
}
break
;
break
;
...
@@ -1790,11 +1745,11 @@ namespace svgio
...
@@ -1790,11 +1745,11 @@ namespace svgio
{
{
if
(
aContent
.
match
(
commonStrings
::
aStrNonzero
))
if
(
aContent
.
match
(
commonStrings
::
aStrNonzero
))
{
{
m
bClipRule
=
true
;
m
aClipRule
=
FillRule_nonzero
;
}
}
else
if
(
aContent
.
match
(
commonStrings
::
aStrEvenOdd
))
else
if
(
aContent
.
match
(
commonStrings
::
aStrEvenOdd
))
{
{
m
bClipRule
=
false
;
m
aClipRule
=
FillRule_evenodd
;
}
}
}
}
break
;
break
;
...
@@ -2048,9 +2003,9 @@ namespace svgio
...
@@ -2048,9 +2003,9 @@ namespace svgio
return
SvgNumber
(
1.0
);
return
SvgNumber
(
1.0
);
}
}
bool
SvgStyleAttributes
::
getFillRule
()
const
const
FillRule
SvgStyleAttributes
::
getFillRule
()
const
{
{
if
(
maFillRuleSet
)
if
(
FillRule_notset
!=
maFillRule
)
{
{
return
maFillRule
;
return
maFillRule
;
}
}
...
@@ -2063,20 +2018,7 @@ namespace svgio
...
@@ -2063,20 +2018,7 @@ namespace svgio
}
}
// default is NonZero
// default is NonZero
return
true
;
return
FillRule_nonzero
;
}
void
SvgStyleAttributes
::
setFillRule
(
const
bool
*
pFillRule
)
{
if
(
pFillRule
)
{
maFillRuleSet
=
true
;
maFillRule
=
*
pFillRule
;
}
else
{
maFillRuleSet
=
false
;
}
}
}
const
SvgNumberVector
&
SvgStyleAttributes
::
getStrokeDasharray
()
const
const
SvgNumberVector
&
SvgStyleAttributes
::
getStrokeDasharray
()
const
...
...
svgio/source/svgreader/svgtextnode.cxx
Dosyayı görüntüle @
37446076
...
@@ -55,9 +55,8 @@ namespace svgio
...
@@ -55,9 +55,8 @@ namespace svgio
const
SvgStyleAttributes
*
SvgTextNode
::
getSvgStyleAttributes
()
const
const
SvgStyleAttributes
*
SvgTextNode
::
getSvgStyleAttributes
()
const
{
{
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"text"
));
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"text"
));
maSvgStyleAttributes
.
checkForCssStyle
(
aClassStr
);
return
&
maSvgStyleAttributes
;
return
checkForCssStyle
(
aClassStr
,
maSvgStyleAttributes
)
;
}
}
void
SvgTextNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
void
SvgTextNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
...
...
svgio/source/svgreader/svgusenode.cxx
Dosyayı görüntüle @
37446076
...
@@ -54,9 +54,8 @@ namespace svgio
...
@@ -54,9 +54,8 @@ namespace svgio
const
SvgStyleAttributes
*
SvgUseNode
::
getSvgStyleAttributes
()
const
const
SvgStyleAttributes
*
SvgUseNode
::
getSvgStyleAttributes
()
const
{
{
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"use"
));
static
rtl
::
OUString
aClassStr
(
rtl
::
OUString
::
createFromAscii
(
"use"
));
maSvgStyleAttributes
.
checkForCssStyle
(
aClassStr
);
return
&
maSvgStyleAttributes
;
return
checkForCssStyle
(
aClassStr
,
maSvgStyleAttributes
)
;
}
}
void
SvgUseNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
void
SvgUseNode
::
parseAttribute
(
const
rtl
::
OUString
&
rTokenName
,
SVGToken
aSVGToken
,
const
rtl
::
OUString
&
aContent
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment