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
37d735b2
Kaydet (Commit)
37d735b2
authored
Ara 12, 2015
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
replace homegrown map with std::map<>
Change-Id: I5f35e0aeb6cef5920891eaa338c1d9b29e0ce554
üst
dd58c789
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
104 deletions
+41
-104
unostyle.cxx
sw/source/core/unocore/unostyle.cxx
+41
-104
No files found.
sw/source/core/unocore/unostyle.cxx
Dosyayı görüntüle @
37d735b2
...
...
@@ -755,114 +755,52 @@ static const std::vector<StyleFamilyEntry>* lcl_GetStyleFamilyEntries()
class
SwStyleProperties_Impl
{
const
PropertyEntryVector_t
aPropertyEntries
;
uno
::
Any
**
pAnyArr
;
sal_uInt32
nArrLen
;
std
::
map
<
OUString
,
uno
::
Any
>
m_vPropertyValues
;
public
:
explicit
SwStyleProperties_Impl
(
const
SfxItemPropertyMap
&
rMap
);
~
SwStyleProperties_Impl
();
bool
SetProperty
(
const
OUString
&
rName
,
const
uno
::
Any
&
rVal
);
bool
GetProperty
(
const
OUString
&
rName
,
uno
::
Any
*&
rpAny
);
bool
ClearProperty
(
const
OUString
&
rPropertyName
);
void
ClearAllProperties
(
);
static
void
GetProperty
(
const
OUString
&
rPropertyName
,
const
uno
::
Reference
<
beans
::
XPropertySet
>
&
rxPropertySet
,
uno
::
Any
&
rAny
);
const
PropertyEntryVector_t
&
GetPropertyVector
()
const
{
return
aPropertyEntries
;
}
};
SwStyleProperties_Impl
::
SwStyleProperties_Impl
(
const
SfxItemPropertyMap
&
rMap
)
:
aPropertyEntries
(
rMap
.
getPropertyEntries
()
),
nArrLen
(
0
)
{
nArrLen
=
aPropertyEntries
.
size
();
pAnyArr
=
new
uno
::
Any
*
[
nArrLen
];
for
(
sal_uInt32
i
=
0
;
i
<
nArrLen
;
i
++
)
pAnyArr
[
i
]
=
nullptr
;
}
SwStyleProperties_Impl
::~
SwStyleProperties_Impl
()
{
for
(
sal_uInt32
i
=
0
;
i
<
nArrLen
;
i
++
)
delete
pAnyArr
[
i
];
delete
[]
pAnyArr
;
}
explicit
SwStyleProperties_Impl
(
const
SfxItemPropertyMap
&
rMap
)
:
aPropertyEntries
(
rMap
.
getPropertyEntries
())
{
}
~
SwStyleProperties_Impl
()
{
}
bool
SwStyleProperties_Impl
::
SetProperty
(
const
OUString
&
rName
,
const
uno
::
Any
&
rVal
)
{
sal_uInt32
nPos
=
0
;
bool
bRet
=
false
;
PropertyEntryVector_t
::
const_iterator
aIt
=
aPropertyEntries
.
begin
();
while
(
aIt
!=
aPropertyEntries
.
end
()
)
bool
AllowsKey
(
const
OUString
&
rName
)
{
if
(
rName
==
aIt
->
sName
)
{
delete
pAnyArr
[
nPos
];
pAnyArr
[
nPos
]
=
new
uno
::
Any
(
rVal
);
bRet
=
true
;
break
;
}
++
nPos
;
++
aIt
;
return
aPropertyEntries
.
end
()
!=
std
::
find_if
(
aPropertyEntries
.
begin
(),
aPropertyEntries
.
end
(),
[
rName
]
(
const
SfxItemPropertyNamedEntry
&
rEntry
)
{
return
rName
==
rEntry
.
sName
;}
);
}
return
bRet
;
}
bool
SwStyleProperties_Impl
::
ClearProperty
(
const
OUString
&
rName
)
{
bool
bRet
=
false
;
sal_uInt32
nPos
=
0
;
PropertyEntryVector_t
::
const_iterator
aIt
=
aPropertyEntries
.
begin
();
while
(
aIt
!=
aPropertyEntries
.
end
()
)
bool
SetProperty
(
const
OUString
&
rName
,
const
uno
::
Any
&
rValue
)
{
if
(
rName
==
aIt
->
sName
)
if
(
!
AllowsKey
(
rName
))
return
false
;
m_vPropertyValues
[
rName
]
=
rValue
;
return
true
;
}
bool
GetProperty
(
const
OUString
&
rName
,
const
uno
::
Any
*&
pAny
)
{
if
(
!
AllowsKey
(
rName
))
{
delete
pAnyArr
[
nPos
];
pAnyArr
[
nPos
]
=
nullptr
;
bRet
=
true
;
break
;
pAny
=
nullptr
;
return
false
;
}
++
nPos
;
++
aIt
;
pAny
=
&
m_vPropertyValues
[
rName
]
;
return
true
;
}
return
bRet
;
}
void
SwStyleProperties_Impl
::
ClearAllProperties
(
)
{
for
(
sal_uInt32
i
=
0
;
i
<
nArrLen
;
i
++
)
bool
ClearProperty
(
const
OUString
&
rName
)
{
delete
pAnyArr
[
i
];
pAnyArr
[
i
]
=
nullptr
;
if
(
!
AllowsKey
(
rName
))
return
false
;
m_vPropertyValues
[
rName
]
=
uno
::
Any
();
return
true
;
}
}
bool
SwStyleProperties_Impl
::
GetProperty
(
const
OUString
&
rName
,
uno
::
Any
*&
rpAny
)
{
bool
bRet
=
false
;
sal_uInt32
nPos
=
0
;
PropertyEntryVector_t
::
const_iterator
aIt
=
aPropertyEntries
.
begin
();
while
(
aIt
!=
aPropertyEntries
.
end
()
)
void
ClearAllProperties
(
)
{
m_vPropertyValues
.
clear
();
}
static
void
GetProperty
(
const
OUString
&
rPropertyName
,
const
uno
::
Reference
<
beans
::
XPropertySet
>
&
rxPropertySet
,
uno
::
Any
&
rAny
)
{
if
(
rName
==
aIt
->
sName
)
{
rpAny
=
pAnyArr
[
nPos
];
bRet
=
true
;
break
;
}
++
nPos
;
++
aIt
;
rAny
=
rxPropertySet
->
getPropertyValue
(
rPropertyName
);
}
return
bRet
;
}
void
SwStyleProperties_Impl
::
GetProperty
(
const
OUString
&
rPropertyName
,
const
uno
::
Reference
<
beans
::
XPropertySet
>
&
rxPropertySet
,
uno
::
Any
&
rAny
)
{
rAny
=
rxPropertySet
->
getPropertyValue
(
rPropertyName
);
}
const
PropertyEntryVector_t
&
GetPropertyVector
()
const
{
return
aPropertyEntries
;
}
};
static
SwGetPoolIdFromName
lcl_GetSwEnumFromSfxEnum
(
SfxStyleFamily
eFamily
)
{
...
...
@@ -1287,9 +1225,9 @@ void SwXStyle::ApplyDescriptorProperties()
PropertyEntryVector_t
::
const_iterator
aIt
=
rPropertyVector
.
begin
();
while
(
aIt
!=
rPropertyVector
.
end
())
{
uno
::
Any
*
pAny
(
nullptr
);
const
uno
::
Any
*
pAny
(
nullptr
);
m_pPropertiesImpl
->
GetProperty
(
aIt
->
sName
,
pAny
);
if
(
pAny
)
if
(
pAny
->
hasValue
()
)
setPropertyValue
(
aIt
->
sName
,
*
pAny
);
++
aIt
;
}
...
...
@@ -2423,9 +2361,9 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::GetPropertyValues_Impl(
}
else
if
(
m_bIsDescriptor
)
{
uno
::
Any
*
pAny
=
nullptr
;
m_pPropertiesImpl
->
GetProperty
(
pNames
[
nProp
],
pAny
);
if
(
!
pAny
)
const
uno
::
Any
*
pAny
=
nullptr
;
m_pPropertiesImpl
->
GetProperty
(
pNames
[
nProp
],
pAny
);
if
(
!
pAny
->
hasValue
()
)
{
bool
bExcept
=
false
;
switch
(
m_eFamily
)
...
...
@@ -3667,10 +3605,9 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl(
}
else
if
(
IsDescriptor
())
{
uno
::
Any
*
pAny
=
nullptr
;
const
uno
::
Any
*
pAny
=
nullptr
;
GetPropImpl
()
->
GetProperty
(
rPropName
,
pAny
);
if
(
!
pAny
)
if
(
!
pAny
->
hasValue
())
{
SwStyleProperties_Impl
::
GetProperty
(
rPropName
,
mxStyleData
,
pRet
[
nProp
]);
}
...
...
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