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
d29e614f
Kaydet (Commit)
d29e614f
authored
Eki 22, 2015
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
oox: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: I105535a2a250e682a5d6976e0c7f74374b1f31ac
üst
fc90cf2a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
25 deletions
+42
-25
effectproperties.cxx
oox/source/drawingml/effectproperties.cxx
+12
-3
effectproperties.hxx
oox/source/drawingml/effectproperties.hxx
+10
-3
effectpropertiescontext.cxx
oox/source/drawingml/effectpropertiescontext.cxx
+17
-15
shape.cxx
oox/source/drawingml/shape.cxx
+3
-4
No files found.
oox/source/drawingml/effectproperties.cxx
Dosyayı görüntüle @
d29e614f
...
...
@@ -14,6 +14,7 @@
#include "oox/token/tokens.hxx"
#include <basegfx/numeric/ftools.hxx>
#include <o3tl/make_unique.hxx>
namespace
oox
{
namespace
drawingml
{
...
...
@@ -28,14 +29,21 @@ void EffectShadowProperties::assignUsed(const EffectShadowProperties& rSourcePro
void
EffectProperties
::
assignUsed
(
const
EffectProperties
&
rSourceProps
)
{
maShadow
.
assignUsed
(
rSourceProps
.
maShadow
);
if
(
rSourceProps
.
maEffects
.
size
()
>
0
)
maEffects
=
rSourceProps
.
maEffects
;
if
(
!
rSourceProps
.
m_Effects
.
empty
())
{
m_Effects
.
reserve
(
rSourceProps
.
m_Effects
.
size
());
for
(
auto
const
&
it
:
rSourceProps
.
m_Effects
)
{
m_Effects
.
push_back
(
o3tl
::
make_unique
<
Effect
>
(
*
it
));
}
}
}
void
EffectProperties
::
pushToPropMap
(
PropertyMap
&
rPropMap
,
const
GraphicHelper
&
rGraphicHelper
)
const
{
for
(
boost
::
ptr_vector
<
Effect
>::
const_iterator
it
=
maEffects
.
begin
();
it
!=
maEffects
.
end
();
++
it
)
for
(
auto
const
&
it
:
m_Effects
)
{
if
(
it
->
msName
==
"outerShdw"
)
{
sal_Int32
nAttrDir
=
0
,
nAttrDist
=
0
;
...
...
@@ -59,6 +67,7 @@ void EffectProperties::pushToPropMap( PropertyMap& rPropMap,
rPropMap
.
setProperty
(
PROP_ShadowColor
,
it
->
moColor
.
getColor
(
rGraphicHelper
)
);
rPropMap
.
setProperty
(
PROP_ShadowTransparence
,
it
->
moColor
.
getTransparency
());
}
}
}
css
::
beans
::
PropertyValue
Effect
::
getEffect
()
...
...
oox/source/drawingml/effectproperties.hxx
Dosyayı görüntüle @
d29e614f
...
...
@@ -10,11 +10,12 @@
#ifndef INCLUDED_OOX_DRAWINGML_EFFECTPROPERTIES_HXX
#define INCLUDED_OOX_DRAWINGML_EFFECTPROPERTIES_HXX
#include <map>
#include <oox/drawingml/color.hxx>
#include <oox/helper/propertymap.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
#include <memory>
#include <vector>
#include <map>
namespace
oox
{
namespace
drawingml
{
...
...
@@ -44,7 +45,13 @@ struct EffectProperties
EffectShadowProperties
maShadow
;
/** Stores all effect properties, including those not supported by core yet */
boost
::
ptr_vector
<
Effect
>
maEffects
;
std
::
vector
<
std
::
unique_ptr
<
Effect
>>
m_Effects
;
EffectProperties
()
{}
EffectProperties
(
EffectProperties
const
&
rOther
)
{
assignUsed
(
rOther
);
}
/** Overwrites all members that are explicitly set in rSourceProps. */
void
assignUsed
(
const
EffectProperties
&
rSourceProps
);
...
...
oox/source/drawingml/effectpropertiescontext.cxx
Dosyayı görüntüle @
d29e614f
...
...
@@ -13,6 +13,8 @@
#include "drawingml/fillpropertiesgroupcontext.hxx"
#include "oox/helper/attributelist.hxx"
#include <o3tl/make_unique.hxx>
using
namespace
::
oox
::
core
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
xml
::
sax
;
...
...
@@ -70,28 +72,28 @@ void EffectPropertiesContext::saveUnsupportedAttribs( Effect& rEffect, const Att
ContextHandlerRef
EffectPropertiesContext
::
onCreateContext
(
sal_Int32
nElement
,
const
AttributeList
&
rAttribs
)
{
sal_Int32
nPos
=
mrEffectProperties
.
m
a
Effects
.
size
();
mrEffectProperties
.
m
aEffects
.
push_back
(
new
Effect
()
);
sal_Int32
nPos
=
mrEffectProperties
.
m
_
Effects
.
size
();
mrEffectProperties
.
m
_Effects
.
push_back
(
o3tl
::
make_unique
<
Effect
>
()
);
switch
(
nElement
)
{
case
A_TOKEN
(
outerShdw
):
{
mrEffectProperties
.
m
aEffects
[
nPos
].
msName
=
"outerShdw"
;
saveUnsupportedAttribs
(
mrEffectProperties
.
maEffects
[
nPos
],
rAttribs
);
mrEffectProperties
.
m
_Effects
[
nPos
]
->
msName
=
"outerShdw"
;
saveUnsupportedAttribs
(
*
mrEffectProperties
.
m_Effects
[
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
.
m_Effects
[
nPos
]
->
moColor
);
}
break
;
case
A_TOKEN
(
innerShdw
):
{
mrEffectProperties
.
m
aEffects
[
nPos
].
msName
=
"innerShdw"
;
saveUnsupportedAttribs
(
mrEffectProperties
.
maEffects
[
nPos
],
rAttribs
);
mrEffectProperties
.
m
_Effects
[
nPos
]
->
msName
=
"innerShdw"
;
saveUnsupportedAttribs
(
*
mrEffectProperties
.
m_Effects
[
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
.
m_Effects
[
nPos
]
->
moColor
);
}
break
;
case
A_TOKEN
(
glow
):
...
...
@@ -100,20 +102,20 @@ ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement,
case
A_TOKEN
(
blur
):
{
if
(
nElement
==
A_TOKEN
(
glow
)
)
mrEffectProperties
.
m
aEffects
[
nPos
].
msName
=
"glow"
;
mrEffectProperties
.
m
_Effects
[
nPos
]
->
msName
=
"glow"
;
else
if
(
nElement
==
A_TOKEN
(
softEdge
)
)
mrEffectProperties
.
m
aEffects
[
nPos
].
msName
=
"softEdge"
;
mrEffectProperties
.
m
_Effects
[
nPos
]
->
msName
=
"softEdge"
;
else
if
(
nElement
==
A_TOKEN
(
reflection
)
)
mrEffectProperties
.
m
aEffects
[
nPos
].
msName
=
"reflection"
;
mrEffectProperties
.
m
_Effects
[
nPos
]
->
msName
=
"reflection"
;
else
if
(
nElement
==
A_TOKEN
(
blur
)
)
mrEffectProperties
.
m
aEffects
[
nPos
].
msName
=
"blur"
;
saveUnsupportedAttribs
(
mrEffectProperties
.
maEffects
[
nPos
],
rAttribs
);
return
new
ColorContext
(
*
this
,
mrEffectProperties
.
maEffects
[
nPos
].
moColor
);
mrEffectProperties
.
m
_Effects
[
nPos
]
->
msName
=
"blur"
;
saveUnsupportedAttribs
(
*
mrEffectProperties
.
m_Effects
[
nPos
],
rAttribs
);
return
new
ColorContext
(
*
this
,
mrEffectProperties
.
m_Effects
[
nPos
]
->
moColor
);
}
break
;
}
mrEffectProperties
.
m
a
Effects
.
pop_back
();
mrEffectProperties
.
m
_
Effects
.
pop_back
();
return
0
;
}
...
...
oox/source/drawingml/shape.cxx
Dosyayı görüntüle @
d29e614f
...
...
@@ -953,12 +953,11 @@ Reference< XShape > Shape::createAndInsert(
}
// store unsupported effect attributes in the grab bag
if
(
aEffectProperties
.
maEffects
.
size
()
>
0
)
if
(
!
aEffectProperties
.
m_Effects
.
empty
()
)
{
Sequence
<
PropertyValue
>
aEffects
(
aEffectProperties
.
maEffects
.
size
()
);
Sequence
<
PropertyValue
>
aEffects
(
aEffectProperties
.
m_Effects
.
size
()
);
sal_uInt32
i
=
0
;
for
(
boost
::
ptr_vector
<
Effect
>::
iterator
it
=
aEffectProperties
.
maEffects
.
begin
();
it
!=
aEffectProperties
.
maEffects
.
end
();
++
it
)
for
(
auto
const
&
it
:
aEffectProperties
.
m_Effects
)
{
PropertyValue
aEffect
=
it
->
getEffect
();
if
(
!
aEffect
.
Name
.
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