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
6797610b
Kaydet (Commit)
6797610b
authored
Agu 25, 2014
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use ptr_vector to prevent memory leak
Found by Lsan. Change-Id: I727098ea3861bacf89209615e4b46e986a72c1ce
üst
0e061bd9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
24 deletions
+26
-24
effectproperties.cxx
oox/source/drawingml/effectproperties.cxx
+8
-8
effectproperties.hxx
oox/source/drawingml/effectproperties.hxx
+3
-1
effectpropertiescontext.cxx
oox/source/drawingml/effectpropertiescontext.cxx
+12
-12
shape.cxx
oox/source/drawingml/shape.cxx
+3
-3
No files found.
oox/source/drawingml/effectproperties.cxx
Dosyayı görüntüle @
6797610b
...
...
@@ -35,16 +35,16 @@ void EffectProperties::assignUsed( const EffectProperties& rSourceProps )
void
EffectProperties
::
pushToPropMap
(
PropertyMap
&
rPropMap
,
const
GraphicHelper
&
rGraphicHelper
)
const
{
for
(
std
::
vector
<
Effect
*
>::
const_iterator
it
=
maEffects
.
begin
();
it
!=
maEffects
.
end
();
++
it
)
if
(
(
*
it
)
->
msName
==
"outerShdw"
)
for
(
boost
::
ptr_vector
<
Effect
>::
const_iterator
it
=
maEffects
.
begin
();
it
!=
maEffects
.
end
();
++
it
)
if
(
it
->
msName
==
"outerShdw"
)
{
sal_Int32
nAttrDir
=
0
,
nAttrDist
=
0
;
std
::
map
<
OUString
,
css
::
uno
::
Any
>::
iterator
attribIt
=
(
*
it
)
->
maAttribs
.
find
(
"dir"
);
if
(
attribIt
!=
(
*
it
)
->
maAttribs
.
end
()
)
std
::
map
<
OUString
,
css
::
uno
::
Any
>::
const_iterator
attribIt
=
it
->
maAttribs
.
find
(
"dir"
);
if
(
attribIt
!=
it
->
maAttribs
.
end
()
)
attribIt
->
second
>>=
nAttrDir
;
attribIt
=
(
*
it
)
->
maAttribs
.
find
(
"dist"
);
if
(
attribIt
!=
(
*
it
)
->
maAttribs
.
end
()
)
attribIt
=
it
->
maAttribs
.
find
(
"dist"
);
if
(
attribIt
!=
it
->
maAttribs
.
end
()
)
attribIt
->
second
>>=
nAttrDist
;
// Negative X or Y dist indicates left or up, respectively
...
...
@@ -56,8 +56,8 @@ void EffectProperties::pushToPropMap( PropertyMap& rPropMap,
rPropMap
.
setProperty
(
PROP_Shadow
,
true
);
rPropMap
.
setProperty
(
PROP_ShadowXDistance
,
nXDist
);
rPropMap
.
setProperty
(
PROP_ShadowYDistance
,
nYDist
);
rPropMap
.
setProperty
(
PROP_ShadowColor
,
(
*
it
)
->
moColor
.
getColor
(
rGraphicHelper
,
-
1
)
);
rPropMap
.
setProperty
(
PROP_ShadowTransparence
,
(
*
it
)
->
moColor
.
getTransparency
());
rPropMap
.
setProperty
(
PROP_ShadowColor
,
it
->
moColor
.
getColor
(
rGraphicHelper
,
-
1
)
);
rPropMap
.
setProperty
(
PROP_ShadowTransparence
,
it
->
moColor
.
getTransparency
());
}
}
...
...
oox/source/drawingml/effectproperties.hxx
Dosyayı görüntüle @
6797610b
...
...
@@ -14,6 +14,8 @@
#include <oox/drawingml/color.hxx>
#include <oox/helper/propertymap.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
namespace
oox
{
namespace
drawingml
{
...
...
@@ -42,7 +44,7 @@ struct EffectProperties
EffectShadowProperties
maShadow
;
/** Stores all effect properties, including those not supported by core yet */
std
::
vector
<
Effect
*
>
maEffects
;
boost
::
ptr_vector
<
Effect
>
maEffects
;
/** Overwrites all members that are explicitly set in rSourceProps. */
void
assignUsed
(
const
EffectProperties
&
rSourceProps
);
...
...
oox/source/drawingml/effectpropertiescontext.cxx
Dosyayı görüntüle @
6797610b
...
...
@@ -76,22 +76,22 @@ ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement,
{
case
A_TOKEN
(
outerShdw
):
{
mrEffectProperties
.
maEffects
[
nPos
]
->
msName
=
"outerShdw"
;
saveUnsupportedAttribs
(
*
mrEffectProperties
.
maEffects
[
nPos
],
rAttribs
);
mrEffectProperties
.
maEffects
[
nPos
]
.
msName
=
"outerShdw"
;
saveUnsupportedAttribs
(
mrEffectProperties
.
maEffects
[
nPos
],
rAttribs
);
mrEffectProperties
.
maShadow
.
moShadowDist
=
rAttribs
.
getInteger
(
XML_dist
,
0
);
mrEffectProperties
.
maShadow
.
moShadowDir
=
rAttribs
.
getInteger
(
XML_dir
,
0
);
return
new
ColorContext
(
*
this
,
mrEffectProperties
.
maEffects
[
nPos
]
->
moColor
);
return
new
ColorContext
(
*
this
,
mrEffectProperties
.
maEffects
[
nPos
]
.
moColor
);
}
break
;
case
A_TOKEN
(
innerShdw
):
{
mrEffectProperties
.
maEffects
[
nPos
]
->
msName
=
"innerShdw"
;
saveUnsupportedAttribs
(
*
mrEffectProperties
.
maEffects
[
nPos
],
rAttribs
);
mrEffectProperties
.
maEffects
[
nPos
]
.
msName
=
"innerShdw"
;
saveUnsupportedAttribs
(
mrEffectProperties
.
maEffects
[
nPos
],
rAttribs
);
mrEffectProperties
.
maShadow
.
moShadowDist
=
rAttribs
.
getInteger
(
XML_dist
,
0
);
mrEffectProperties
.
maShadow
.
moShadowDir
=
rAttribs
.
getInteger
(
XML_dir
,
0
);
return
new
ColorContext
(
*
this
,
mrEffectProperties
.
maEffects
[
nPos
]
->
moColor
);
return
new
ColorContext
(
*
this
,
mrEffectProperties
.
maEffects
[
nPos
]
.
moColor
);
}
break
;
case
A_TOKEN
(
glow
):
...
...
@@ -100,15 +100,15 @@ ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement,
case
A_TOKEN
(
blur
):
{
if
(
nElement
==
A_TOKEN
(
glow
)
)
mrEffectProperties
.
maEffects
[
nPos
]
->
msName
=
"glow"
;
mrEffectProperties
.
maEffects
[
nPos
]
.
msName
=
"glow"
;
else
if
(
nElement
==
A_TOKEN
(
softEdge
)
)
mrEffectProperties
.
maEffects
[
nPos
]
->
msName
=
"softEdge"
;
mrEffectProperties
.
maEffects
[
nPos
]
.
msName
=
"softEdge"
;
else
if
(
nElement
==
A_TOKEN
(
reflection
)
)
mrEffectProperties
.
maEffects
[
nPos
]
->
msName
=
"reflection"
;
mrEffectProperties
.
maEffects
[
nPos
]
.
msName
=
"reflection"
;
else
if
(
nElement
==
A_TOKEN
(
blur
)
)
mrEffectProperties
.
maEffects
[
nPos
]
->
msName
=
"blur"
;
saveUnsupportedAttribs
(
*
mrEffectProperties
.
maEffects
[
nPos
],
rAttribs
);
return
new
ColorContext
(
*
this
,
mrEffectProperties
.
maEffects
[
nPos
]
->
moColor
);
mrEffectProperties
.
maEffects
[
nPos
]
.
msName
=
"blur"
;
saveUnsupportedAttribs
(
mrEffectProperties
.
maEffects
[
nPos
],
rAttribs
);
return
new
ColorContext
(
*
this
,
mrEffectProperties
.
maEffects
[
nPos
]
.
moColor
);
}
break
;
}
...
...
oox/source/drawingml/shape.cxx
Dosyayı görüntüle @
6797610b
...
...
@@ -919,16 +919,16 @@ Reference< XShape > Shape::createAndInsert(
{
Sequence
<
PropertyValue
>
aEffects
(
aEffectProperties
.
maEffects
.
size
()
);
sal_uInt32
i
=
0
;
for
(
std
::
vector
<
Effect
*
>::
iterator
it
=
aEffectProperties
.
maEffects
.
begin
();
for
(
boost
::
ptr_vector
<
Effect
>::
iterator
it
=
aEffectProperties
.
maEffects
.
begin
();
it
!=
aEffectProperties
.
maEffects
.
end
();
++
it
)
{
PropertyValue
aEffect
=
(
*
it
)
->
getEffect
();
PropertyValue
aEffect
=
it
->
getEffect
();
if
(
!
aEffect
.
Name
.
isEmpty
()
)
{
Sequence
<
PropertyValue
>
aEffectsGrabBag
(
3
);
PUT_PROP
(
aEffectsGrabBag
,
0
,
"Attribs"
,
aEffect
.
Value
);
Color
&
aColor
(
(
*
it
)
->
moColor
);
Color
&
aColor
(
it
->
moColor
);
OUString
sColorScheme
=
aColor
.
getSchemeName
();
if
(
sColorScheme
.
isEmpty
()
)
{
...
...
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