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
452ae1ad
Kaydet (Commit)
452ae1ad
authored
Kas 27, 2015
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
reduce scope with template specialization
Change-Id: I7bfbaa3898f34e1ed931f5865b493aae66e28c0f
üst
78b28312
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
24 deletions
+65
-24
unostyle.cxx
sw/source/core/unocore/unostyle.cxx
+65
-24
No files found.
sw/source/core/unocore/unostyle.cxx
Dosyayı görüntüle @
452ae1ad
...
@@ -320,14 +320,13 @@ static bool lcl_GetHeaderFooterItem(
...
@@ -320,14 +320,13 @@ static bool lcl_GetHeaderFooterItem(
return
SfxItemState
::
SET
==
eState
;
return
SfxItemState
::
SET
==
eState
;
}
}
static
sal_Int32
lcl_GetCountOrName
(
const
SwDoc
&
rDoc
,
template
<
enum
SfxStyleFamily
>
SfxStyleFamily
eFamily
,
OUString
*
pString
,
sal_Int32
nIndex
=
SAL_MAX_INT32
)
static
sal_Int32
lcl_GetCountOrName2
(
const
SwDoc
&
rDoc
,
OUString
*
pString
,
sal_Int32
nIndex
);
template
<>
sal_Int32
lcl_GetCountOrName2
<
SFX_STYLE_FAMILY_CHAR
>
(
const
SwDoc
&
rDoc
,
OUString
*
pString
,
sal_Int32
nIndex
)
{
{
sal_Int32
nCount
=
0
;
sal_Int32
nCount
=
0
;
switch
(
eFamily
)
{
case
SFX_STYLE_FAMILY_CHAR
:
{
const
sal_Int32
nBaseCount
=
const
sal_Int32
nBaseCount
=
RES_POOLCHR_HTML_END
-
RES_POOLCHR_HTML_BEGIN
+
RES_POOLCHR_HTML_END
-
RES_POOLCHR_HTML_BEGIN
+
RES_POOLCHR_NORMAL_END
-
RES_POOLCHR_NORMAL_BEGIN
;
RES_POOLCHR_NORMAL_END
-
RES_POOLCHR_NORMAL_BEGIN
;
...
@@ -354,10 +353,13 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc,
...
@@ -354,10 +353,13 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc,
}
}
}
}
nCount
+=
nBaseCount
;
nCount
+=
nBaseCount
;
}
return
nCount
;
break
;
}
case
SFX_STYLE_FAMILY_PARA
:
{
template
<>
sal_Int32
lcl_GetCountOrName2
<
SFX_STYLE_FAMILY_PARA
>
(
const
SwDoc
&
rDoc
,
OUString
*
pString
,
sal_Int32
nIndex
)
{
sal_Int32
nCount
=
0
;
const
sal_Int32
nBaseCount
=
const
sal_Int32
nBaseCount
=
RES_POOLCOLL_HTML_END
-
RES_POOLCOLL_HTML_BEGIN
+
RES_POOLCOLL_HTML_END
-
RES_POOLCOLL_HTML_BEGIN
+
RES_POOLCOLL_DOC_END
-
RES_POOLCOLL_DOC_BEGIN
+
RES_POOLCOLL_DOC_END
-
RES_POOLCOLL_DOC_BEGIN
+
...
@@ -383,10 +385,13 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc,
...
@@ -383,10 +385,13 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc,
}
}
}
}
nCount
+=
nBaseCount
;
nCount
+=
nBaseCount
;
}
return
nCount
;
break
;
}
case
SFX_STYLE_FAMILY_FRAME
:
{
template
<>
sal_Int32
lcl_GetCountOrName2
<
SFX_STYLE_FAMILY_FRAME
>
(
const
SwDoc
&
rDoc
,
OUString
*
pString
,
sal_Int32
nIndex
)
{
sal_Int32
nCount
=
0
;
const
sal_Int32
nBaseCount
=
RES_POOLFRM_END
-
RES_POOLFRM_BEGIN
;
const
sal_Int32
nBaseCount
=
RES_POOLFRM_END
-
RES_POOLFRM_BEGIN
;
nIndex
=
nIndex
-
nBaseCount
;
nIndex
=
nIndex
-
nBaseCount
;
const
size_t
nArrLen
=
rDoc
.
GetFrameFormats
()
->
size
();
const
size_t
nArrLen
=
rDoc
.
GetFrameFormats
()
->
size
();
...
@@ -406,10 +411,13 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc,
...
@@ -406,10 +411,13 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc,
}
}
}
}
nCount
+=
nBaseCount
;
nCount
+=
nBaseCount
;
}
return
nCount
;
break
;
}
case
SFX_STYLE_FAMILY_PAGE
:
{
template
<>
sal_Int32
lcl_GetCountOrName2
<
SFX_STYLE_FAMILY_PAGE
>
(
const
SwDoc
&
rDoc
,
OUString
*
pString
,
sal_Int32
nIndex
)
{
sal_Int32
nCount
=
0
;
const
sal_Int32
nBaseCount
=
RES_POOLPAGE_END
-
RES_POOLPAGE_BEGIN
;
const
sal_Int32
nBaseCount
=
RES_POOLPAGE_END
-
RES_POOLPAGE_BEGIN
;
nIndex
=
nIndex
-
nBaseCount
;
nIndex
=
nIndex
-
nBaseCount
;
const
size_t
nArrLen
=
rDoc
.
GetPageDescCnt
();
const
size_t
nArrLen
=
rDoc
.
GetPageDescCnt
();
...
@@ -428,10 +436,13 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc,
...
@@ -428,10 +436,13 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc,
}
}
}
}
nCount
+=
nBaseCount
;
nCount
+=
nBaseCount
;
}
return
nCount
;
break
;
}
case
SFX_STYLE_FAMILY_PSEUDO
:
{
template
<>
sal_Int32
lcl_GetCountOrName2
<
SFX_STYLE_FAMILY_PSEUDO
>
(
const
SwDoc
&
rDoc
,
OUString
*
pString
,
sal_Int32
nIndex
)
{
sal_Int32
nCount
=
0
;
const
sal_Int32
nBaseCount
=
RES_POOLNUMRULE_END
-
RES_POOLNUMRULE_BEGIN
;
const
sal_Int32
nBaseCount
=
RES_POOLNUMRULE_END
-
RES_POOLNUMRULE_BEGIN
;
nIndex
=
nIndex
-
nBaseCount
;
nIndex
=
nIndex
-
nBaseCount
;
const
SwNumRuleTable
&
rNumTable
=
rDoc
.
GetNumRuleTable
();
const
SwNumRuleTable
&
rNumTable
=
rDoc
.
GetNumRuleTable
();
...
@@ -451,13 +462,43 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc,
...
@@ -451,13 +462,43 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc,
}
}
}
}
nCount
+=
nBaseCount
;
nCount
+=
nBaseCount
;
return
nCount
;
}
static
sal_Int32
lcl_GetCountOrName
(
const
SwDoc
&
rDoc
,
SfxStyleFamily
eFamily
,
OUString
*
pString
,
sal_Int32
nIndex
=
SAL_MAX_INT32
)
{
switch
(
eFamily
)
{
case
SFX_STYLE_FAMILY_CHAR
:
{
return
lcl_GetCountOrName2
<
SFX_STYLE_FAMILY_CHAR
>
(
rDoc
,
pString
,
nIndex
);
}
break
;
case
SFX_STYLE_FAMILY_PARA
:
{
return
lcl_GetCountOrName2
<
SFX_STYLE_FAMILY_PARA
>
(
rDoc
,
pString
,
nIndex
);
}
break
;
case
SFX_STYLE_FAMILY_FRAME
:
{
return
lcl_GetCountOrName2
<
SFX_STYLE_FAMILY_FRAME
>
(
rDoc
,
pString
,
nIndex
);
}
break
;
case
SFX_STYLE_FAMILY_PAGE
:
{
return
lcl_GetCountOrName2
<
SFX_STYLE_FAMILY_PAGE
>
(
rDoc
,
pString
,
nIndex
);
}
break
;
case
SFX_STYLE_FAMILY_PSEUDO
:
{
return
lcl_GetCountOrName2
<
SFX_STYLE_FAMILY_PSEUDO
>
(
rDoc
,
pString
,
nIndex
);
}
}
break
;
break
;
default
:
default
:
;
return
0
;
}
}
return
nCount
;
}
}
sal_Int32
SwXStyleFamily
::
getCount
()
throw
(
uno
::
RuntimeException
,
std
::
exception
)
sal_Int32
SwXStyleFamily
::
getCount
()
throw
(
uno
::
RuntimeException
,
std
::
exception
)
...
...
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