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()
...
@@ -755,114 +755,52 @@ static const std::vector<StyleFamilyEntry>* lcl_GetStyleFamilyEntries()
class
SwStyleProperties_Impl
class
SwStyleProperties_Impl
{
{
const
PropertyEntryVector_t
aPropertyEntries
;
const
PropertyEntryVector_t
aPropertyEntries
;
uno
::
Any
**
pAnyArr
;
std
::
map
<
OUString
,
uno
::
Any
>
m_vPropertyValues
;
sal_uInt32
nArrLen
;
public
:
public
:
explicit
SwStyleProperties_Impl
(
const
SfxItemPropertyMap
&
rMap
);
explicit
SwStyleProperties_Impl
(
const
SfxItemPropertyMap
&
rMap
)
~
SwStyleProperties_Impl
();
:
aPropertyEntries
(
rMap
.
getPropertyEntries
())
{
}
bool
SetProperty
(
const
OUString
&
rName
,
const
uno
::
Any
&
rVal
);
~
SwStyleProperties_Impl
()
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
;
}
bool
SwStyleProperties_Impl
::
SetProperty
(
const
OUString
&
rName
,
const
uno
::
Any
&
rVal
)
bool
AllowsKey
(
const
OUString
&
rName
)
{
sal_uInt32
nPos
=
0
;
bool
bRet
=
false
;
PropertyEntryVector_t
::
const_iterator
aIt
=
aPropertyEntries
.
begin
();
while
(
aIt
!=
aPropertyEntries
.
end
()
)
{
{
if
(
rName
==
aIt
->
sName
)
return
aPropertyEntries
.
end
()
!=
std
::
find_if
(
aPropertyEntries
.
begin
(),
aPropertyEntries
.
end
(),
{
[
rName
]
(
const
SfxItemPropertyNamedEntry
&
rEntry
)
{
return
rName
==
rEntry
.
sName
;}
);
delete
pAnyArr
[
nPos
];
pAnyArr
[
nPos
]
=
new
uno
::
Any
(
rVal
);
bRet
=
true
;
break
;
}
++
nPos
;
++
aIt
;
}
}
return
bRet
;
bool
SetProperty
(
const
OUString
&
rName
,
const
uno
::
Any
&
rValue
)
}
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
()
)
{
{
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
];
pAny
=
nullptr
;
pAnyArr
[
nPos
]
=
nullptr
;
return
false
;
bRet
=
true
;
break
;
}
}
++
nPos
;
pAny
=
&
m_vPropertyValues
[
rName
]
;
++
aIt
;
return
true
;
}
}
return
bRet
;
bool
ClearProperty
(
const
OUString
&
rName
)
}
void
SwStyleProperties_Impl
::
ClearAllProperties
(
)
{
for
(
sal_uInt32
i
=
0
;
i
<
nArrLen
;
i
++
)
{
{
delete
pAnyArr
[
i
];
if
(
!
AllowsKey
(
rName
))
pAnyArr
[
i
]
=
nullptr
;
return
false
;
m_vPropertyValues
[
rName
]
=
uno
::
Any
();
return
true
;
}
}
}
void
ClearAllProperties
(
)
{
m_vPropertyValues
.
clear
();
}
bool
SwStyleProperties_Impl
::
GetProperty
(
const
OUString
&
rName
,
uno
::
Any
*&
rpAny
)
static
void
GetProperty
(
const
OUString
&
rPropertyName
,
const
uno
::
Reference
<
beans
::
XPropertySet
>
&
rxPropertySet
,
uno
::
Any
&
rAny
)
{
bool
bRet
=
false
;
sal_uInt32
nPos
=
0
;
PropertyEntryVector_t
::
const_iterator
aIt
=
aPropertyEntries
.
begin
();
while
(
aIt
!=
aPropertyEntries
.
end
()
)
{
{
if
(
rName
==
aIt
->
sName
)
rAny
=
rxPropertySet
->
getPropertyValue
(
rPropertyName
);
{
rpAny
=
pAnyArr
[
nPos
];
bRet
=
true
;
break
;
}
++
nPos
;
++
aIt
;
}
}
const
PropertyEntryVector_t
&
GetPropertyVector
()
const
return
bRet
;
{
return
aPropertyEntries
;
}
}
};
void
SwStyleProperties_Impl
::
GetProperty
(
const
OUString
&
rPropertyName
,
const
uno
::
Reference
<
beans
::
XPropertySet
>
&
rxPropertySet
,
uno
::
Any
&
rAny
)
{
rAny
=
rxPropertySet
->
getPropertyValue
(
rPropertyName
);
}
static
SwGetPoolIdFromName
lcl_GetSwEnumFromSfxEnum
(
SfxStyleFamily
eFamily
)
static
SwGetPoolIdFromName
lcl_GetSwEnumFromSfxEnum
(
SfxStyleFamily
eFamily
)
{
{
...
@@ -1287,9 +1225,9 @@ void SwXStyle::ApplyDescriptorProperties()
...
@@ -1287,9 +1225,9 @@ void SwXStyle::ApplyDescriptorProperties()
PropertyEntryVector_t
::
const_iterator
aIt
=
rPropertyVector
.
begin
();
PropertyEntryVector_t
::
const_iterator
aIt
=
rPropertyVector
.
begin
();
while
(
aIt
!=
rPropertyVector
.
end
())
while
(
aIt
!=
rPropertyVector
.
end
())
{
{
uno
::
Any
*
pAny
(
nullptr
);
const
uno
::
Any
*
pAny
(
nullptr
);
m_pPropertiesImpl
->
GetProperty
(
aIt
->
sName
,
pAny
);
m_pPropertiesImpl
->
GetProperty
(
aIt
->
sName
,
pAny
);
if
(
pAny
)
if
(
pAny
->
hasValue
()
)
setPropertyValue
(
aIt
->
sName
,
*
pAny
);
setPropertyValue
(
aIt
->
sName
,
*
pAny
);
++
aIt
;
++
aIt
;
}
}
...
@@ -2423,9 +2361,9 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::GetPropertyValues_Impl(
...
@@ -2423,9 +2361,9 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::GetPropertyValues_Impl(
}
}
else
if
(
m_bIsDescriptor
)
else
if
(
m_bIsDescriptor
)
{
{
uno
::
Any
*
pAny
=
nullptr
;
const
uno
::
Any
*
pAny
=
nullptr
;
m_pPropertiesImpl
->
GetProperty
(
pNames
[
nProp
],
pAny
);
m_pPropertiesImpl
->
GetProperty
(
pNames
[
nProp
],
pAny
);
if
(
!
pAny
)
if
(
!
pAny
->
hasValue
()
)
{
{
bool
bExcept
=
false
;
bool
bExcept
=
false
;
switch
(
m_eFamily
)
switch
(
m_eFamily
)
...
@@ -3667,10 +3605,9 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl(
...
@@ -3667,10 +3605,9 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl(
}
}
else
if
(
IsDescriptor
())
else
if
(
IsDescriptor
())
{
{
uno
::
Any
*
pAny
=
nullptr
;
const
uno
::
Any
*
pAny
=
nullptr
;
GetPropImpl
()
->
GetProperty
(
rPropName
,
pAny
);
GetPropImpl
()
->
GetProperty
(
rPropName
,
pAny
);
if
(
!
pAny
->
hasValue
())
if
(
!
pAny
)
{
{
SwStyleProperties_Impl
::
GetProperty
(
rPropName
,
mxStyleData
,
pRet
[
nProp
]);
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