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
f0aaae92
Kaydet (Commit)
f0aaae92
authored
May 14, 2014
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sal_uInt16 to more proper types and constify
Change-Id: Ia510ac7d5b38dc6f3910a6e965f1cc154ad41f27
üst
352158b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
32 deletions
+31
-32
unostyle.cxx
sw/source/core/unocore/unostyle.cxx
+31
-32
No files found.
sw/source/core/unocore/unostyle.cxx
Dosyayı görüntüle @
f0aaae92
...
...
@@ -95,12 +95,12 @@
#define TYPE_LRSPACE 5
#define TYPE_BOX 6
const
unsigned
short
aStyleByIndex
[]
=
const
sal_uInt16
aStyleByIndex
[]
=
{
SFX_STYLE_FAMILY_CHAR
,
SFX_STYLE_FAMILY_PARA
,
SFX_STYLE_FAMILY_PAGE
,
SFX_STYLE_FAMILY_FRAME
,
SFX_STYLE_FAMILY_PAGE
,
SFX_STYLE_FAMILY_FRAME
,
SFX_STYLE_FAMILY_PSEUDO
};
...
...
@@ -296,7 +296,7 @@ uno::Any SwXStyleFamilies::getByIndex(sal_Int32 nIndex)
if
(
IsValid
())
{
uno
::
Reference
<
container
::
XNameContainer
>
aRef
;
sal_uInt16
nType
=
aStyleByIndex
[
nIndex
];
const
sal_uInt16
nType
=
aStyleByIndex
[
nIndex
];
switch
(
nType
)
{
case
SFX_STYLE_FAMILY_CHAR
:
...
...
@@ -481,8 +481,8 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc,
sal_uInt16
nBaseCount
=
RES_POOLCHR_HTML_END
-
RES_POOLCHR_HTML_BEGIN
+
RES_POOLCHR_NORMAL_END
-
RES_POOLCHR_NORMAL_BEGIN
;
nIndex
=
nIndex
-
nBaseCount
;
const
s
al_uInt16
nArrLen
=
rDoc
.
GetCharFmts
()
->
size
();
for
(
s
al_uInt16
i
=
0
;
i
<
nArrLen
;
i
++
)
const
s
ize_t
nArrLen
=
rDoc
.
GetCharFmts
()
->
size
();
for
(
s
ize_t
i
=
0
;
i
<
nArrLen
;
++
i
)
{
SwCharFmt
*
pFmt
=
(
*
rDoc
.
GetCharFmts
())[
i
];
if
(
pFmt
->
IsDefault
()
&&
pFmt
!=
rDoc
.
GetDfltCharFmt
()
)
...
...
@@ -514,8 +514,8 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc,
RES_POOLCOLL_LISTS_END
-
RES_POOLCOLL_LISTS_BEGIN
+
RES_POOLCOLL_TEXT_END
-
RES_POOLCOLL_TEXT_BEGIN
;
nIndex
=
nIndex
-
nBaseCount
;
const
s
al_uInt16
nArrLen
=
rDoc
.
GetTxtFmtColls
()
->
size
();
for
(
s
al_uInt16
i
=
0
;
i
<
nArrLen
;
i
++
)
const
s
ize_t
nArrLen
=
rDoc
.
GetTxtFmtColls
()
->
size
();
for
(
s
ize_t
i
=
0
;
i
<
nArrLen
;
++
i
)
{
SwTxtFmtColl
*
pColl
=
(
*
rDoc
.
GetTxtFmtColls
())[
i
];
if
(
pColl
->
IsDefault
()
)
...
...
@@ -537,8 +537,8 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc,
{
sal_uInt16
nBaseCount
=
RES_POOLFRM_END
-
RES_POOLFRM_BEGIN
;
nIndex
=
nIndex
-
nBaseCount
;
const
s
al_uInt16
nArrLen
=
rDoc
.
GetFrmFmts
()
->
size
();
for
(
s
al_uInt16
i
=
0
;
i
<
nArrLen
;
i
++
)
const
s
ize_t
nArrLen
=
rDoc
.
GetFrmFmts
()
->
size
();
for
(
s
ize_t
i
=
0
;
i
<
nArrLen
;
++
i
)
{
SwFrmFmt
*
pFmt
=
(
*
rDoc
.
GetFrmFmts
())[
i
];
if
(
pFmt
->
IsDefault
()
||
pFmt
->
IsAuto
())
...
...
@@ -583,7 +583,7 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc,
sal_uInt16
nBaseCount
=
RES_POOLNUMRULE_END
-
RES_POOLNUMRULE_BEGIN
;
nIndex
=
nIndex
-
nBaseCount
;
const
SwNumRuleTbl
&
rNumTbl
=
rDoc
.
GetNumRuleTbl
();
for
(
s
al_uInt16
i
=
0
;
i
<
rNumTbl
.
size
();
++
i
)
for
(
s
ize_t
i
=
0
;
i
<
rNumTbl
.
size
();
++
i
)
{
const
SwNumRule
&
rRule
=
*
rNumTbl
[
i
];
if
(
rRule
.
IsAutoRule
()
)
...
...
@@ -791,7 +791,7 @@ uno::Sequence< OUString > SwXStyleFamily::getElementNames(void) throw( uno::Runt
if
(
pBasePool
)
{
SfxStyleSheetIteratorPtr
pIterator
=
pBasePool
->
CreateIterator
(
eFamily
,
SFXSTYLEBIT_ALL
);
sal_uInt16
nCount
=
pIterator
->
Count
();
const
sal_uInt16
nCount
=
pIterator
->
Count
();
aRet
.
realloc
(
nCount
);
OUString
*
pArray
=
aRet
.
getArray
();
OUString
aString
;
...
...
@@ -1080,7 +1080,7 @@ SwStyleProperties_Impl::SwStyleProperties_Impl(const SfxItemPropertyMap& rMap) :
SwStyleProperties_Impl
::~
SwStyleProperties_Impl
()
{
for
(
sal_uInt
16
i
=
0
;
i
<
nArrLen
;
i
++
)
for
(
sal_uInt
32
i
=
0
;
i
<
nArrLen
;
i
++
)
delete
pAnyArr
[
i
];
delete
[]
pAnyArr
;
}
...
...
@@ -1108,7 +1108,7 @@ bool SwStyleProperties_Impl::SetProperty(const OUString& rName, uno::Any aVal)
bool
SwStyleProperties_Impl
::
ClearProperty
(
const
OUString
&
rName
)
{
bool
bRet
=
false
;
sal_uInt
16
nPos
=
0
;
sal_uInt
32
nPos
=
0
;
PropertyEntryVector_t
::
const_iterator
aIt
=
aPropertyEntries
.
begin
();
while
(
aIt
!=
aPropertyEntries
.
end
()
)
{
...
...
@@ -1127,7 +1127,7 @@ bool SwStyleProperties_Impl::ClearProperty( const OUString& rName )
void
SwStyleProperties_Impl
::
ClearAllProperties
(
)
{
for
(
sal_uInt
16
i
=
0
;
i
<
nArrLen
;
i
++
)
for
(
sal_uInt
32
i
=
0
;
i
<
nArrLen
;
i
++
)
{
delete
pAnyArr
[
i
];
pAnyArr
[
i
]
=
0
;
...
...
@@ -1137,7 +1137,7 @@ void SwStyleProperties_Impl::ClearAllProperties( )
bool
SwStyleProperties_Impl
::
GetProperty
(
const
OUString
&
rName
,
uno
::
Any
*&
rpAny
)
{
bool
bRet
=
false
;
sal_uInt
16
nPos
=
0
;
sal_uInt
32
nPos
=
0
;
PropertyEntryVector_t
::
const_iterator
aIt
=
aPropertyEntries
.
begin
();
while
(
aIt
!=
aPropertyEntries
.
end
()
)
{
...
...
@@ -1613,9 +1613,8 @@ const SwPageDesc& SwStyleBase_Impl::GetOldPageDesc()
{
if
(
!
pOldPageDesc
)
{
sal_uInt16
i
;
sal_uInt16
nPDescCount
=
rDoc
.
GetPageDescCnt
();
for
(
i
=
0
;
i
<
nPDescCount
;
i
++
)
const
sal_uInt16
nPDescCount
=
rDoc
.
GetPageDescCnt
();
for
(
sal_uInt16
i
=
0
;
i
<
nPDescCount
;
++
i
)
{
const
SwPageDesc
&
rDesc
=
rDoc
.
GetPageDesc
(
i
);
if
(
rDesc
.
GetName
()
==
rStyleName
)
...
...
@@ -1626,7 +1625,7 @@ const SwPageDesc& SwStyleBase_Impl::GetOldPageDesc()
}
if
(
!
pOldPageDesc
)
{
for
(
i
=
RC_POOLPAGEDESC_BEGIN
;
i
<=
STR_POOLPAGE_LANDSCAPE
;
++
i
)
for
(
sal_uInt16
i
=
RC_POOLPAGEDESC_BEGIN
;
i
<=
STR_POOLPAGE_LANDSCAPE
;
++
i
)
{
const
OUString
aFmtName
(
SW_RES
(
i
));
if
(
aFmtName
==
rStyleName
)
...
...
@@ -1841,7 +1840,7 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
SwNumRule
aSetRule
(
*
pSwXRules
->
GetNumRule
());
const
SwCharFmts
*
pFmts
=
pDoc
->
GetCharFmts
();
sal_uInt16
nChCount
=
pFmts
->
size
();
const
size_t
nChCount
=
pFmts
->
size
();
for
(
sal_uInt16
i
=
0
;
i
<
MAXLEVEL
;
i
++
)
{
...
...
@@ -1855,7 +1854,7 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
{
SwCharFmt
*
pCharFmt
=
0
;
for
(
s
al_uInt16
j
=
0
;
j
<
nChCount
;
j
++
)
for
(
s
ize_t
j
=
0
;
j
<
nChCount
;
++
j
)
{
SwCharFmt
*
pTmp
=
(
*
pFmts
)[
j
];
if
(
pTmp
->
GetName
()
==
pCharStyleNames
[
i
])
...
...
@@ -1994,11 +1993,11 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
OSL_ENSURE
(
COND_COMMAND_COUNT
==
28
,
"invalid size of comman count?"
);
const
beans
::
NamedValue
*
pSeq
=
aSeq
.
getConstArray
();
sal_Int32
nLen
=
aSeq
.
getLength
();
const
sal_Int32
nLen
=
aSeq
.
getLength
();
bool
bFailed
=
false
;
SwCondCollItem
aCondItem
;
for
(
sal_
uInt16
i
=
0
;
i
<
nLen
;
i
++
)
for
(
sal_
Int32
i
=
0
;
i
<
nLen
;
++
i
)
{
OUString
aTmp
;
if
((
pSeq
[
i
].
Value
>>=
aTmp
))
...
...
@@ -2218,7 +2217,7 @@ void SAL_CALL SwXStyle::SetPropertyValues_Impl(
SwStyleBase_Impl
aBaseImpl
(
*
m_pDoc
,
m_sStyleName
);
if
(
pBasePool
)
{
sal_uInt16
nSaveMask
=
pBasePool
->
GetSearchMask
();
const
sal_uInt16
nSaveMask
=
pBasePool
->
GetSearchMask
();
pBasePool
->
SetSearchMask
(
eFamily
);
SfxStyleSheetBase
*
pBase
=
pBasePool
->
Find
(
m_sStyleName
);
pBasePool
->
SetSearchMask
(
eFamily
,
nSaveMask
);
...
...
@@ -2456,7 +2455,7 @@ static uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
}
case
FN_UNO_CATEGORY
:
{
sal_uInt16
nPoolId
=
rBase
.
mxNewBase
->
GetCollection
()
->
GetPoolFmtId
();
const
sal_uInt16
nPoolId
=
rBase
.
mxNewBase
->
GetCollection
()
->
GetPoolFmtId
();
short
nRet
=
-
1
;
switch
(
COLL_GET_RANGE_BITS
&
nPoolId
)
...
...
@@ -2636,7 +2635,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::GetPropertyValues_Impl(
{
if
(
!
pBase
)
{
sal_uInt16
nSaveMask
=
pBasePool
->
GetSearchMask
();
const
sal_uInt16
nSaveMask
=
pBasePool
->
GetSearchMask
();
pBasePool
->
SetSearchMask
(
eFamily
,
SFXSTYLEBIT_ALL
);
pBase
=
pBasePool
->
Find
(
m_sStyleName
);
pBasePool
->
SetSearchMask
(
eFamily
,
nSaveMask
);
...
...
@@ -2847,7 +2846,7 @@ uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates(
else
if
(
SFX_STYLE_FAMILY_PAGE
==
eFamily
&&
(
sPropName
.
startsWith
(
"Header"
)
||
sPropName
.
startsWith
(
"Footer"
)))
{
sal_uInt16
nResId
=
lcl_ConvertFNToRES
(
pEntry
->
nWID
);
const
sal_uInt16
nResId
=
lcl_ConvertFNToRES
(
pEntry
->
nWID
);
bool
bFooter
=
sPropName
.
startsWith
(
"Footer"
);
const
SvxSetItem
*
pSetItem
;
if
(
SFX_ITEM_SET
==
aSet
.
GetItemState
(
...
...
@@ -3261,7 +3260,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl(
SwStyleBase_Impl
aBaseImpl
(
*
GetDoc
(),
GetStyleName
());
if
(
GetBasePool
())
{
sal_uInt16
nSaveMask
=
GetBasePool
()
->
GetSearchMask
();
const
sal_uInt16
nSaveMask
=
GetBasePool
()
->
GetSearchMask
();
GetBasePool
()
->
SetSearchMask
(
GetFamily
());
SfxStyleSheetBase
*
pBase
=
GetBasePool
()
->
Find
(
GetStyleName
());
GetBasePool
()
->
SetSearchMask
(
GetFamily
(),
nSaveMask
);
...
...
@@ -3518,7 +3517,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl(
{
if
(
!
pBase
)
{
sal_uInt16
nSaveMask
=
GetBasePool
()
->
GetSearchMask
();
const
sal_uInt16
nSaveMask
=
GetBasePool
()
->
GetSearchMask
();
GetBasePool
()
->
SetSearchMask
(
GetFamily
(),
SFXSTYLEBIT_ALL
);
pBase
=
GetBasePool
()
->
Find
(
GetStyleName
());
GetBasePool
()
->
SetSearchMask
(
GetFamily
(),
nSaveMask
);
...
...
@@ -4110,7 +4109,7 @@ uno::Reference< beans::XPropertySetInfo > SwXAutoStyle::getPropertySetInfo( )
static
uno
::
Reference
<
beans
::
XPropertySetInfo
>
xRubyRef
;
if
(
!
xRubyRef
.
is
())
{
sal_uInt16
nMapId
=
PROPERTY_MAP_RUBY_AUTO_STYLE
;
const
sal_uInt16
nMapId
=
PROPERTY_MAP_RUBY_AUTO_STYLE
;
xRubyRef
=
aSwMapProvider
.
GetPropertySet
(
nMapId
)
->
getPropertySetInfo
();
}
xRet
=
xRubyRef
;
...
...
@@ -4121,7 +4120,7 @@ uno::Reference< beans::XPropertySetInfo > SwXAutoStyle::getPropertySetInfo( )
static
uno
::
Reference
<
beans
::
XPropertySetInfo
>
xParaRef
;
if
(
!
xParaRef
.
is
())
{
sal_uInt16
nMapId
=
PROPERTY_MAP_PARA_AUTO_STYLE
;
const
sal_uInt16
nMapId
=
PROPERTY_MAP_PARA_AUTO_STYLE
;
xParaRef
=
aSwMapProvider
.
GetPropertySet
(
nMapId
)
->
getPropertySetInfo
();
}
xRet
=
xParaRef
;
...
...
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