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
36e52cbb
Kaydet (Commit)
36e52cbb
authored
Tem 24, 2014
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simplify code by throwing earlier
Change-Id: I0f70aff42520852d53e31ccf6eadbda67483870a
üst
bb296e46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
42 deletions
+19
-42
unoatxt.cxx
sw/source/uibase/uno/unoatxt.cxx
+19
-42
No files found.
sw/source/uibase/uno/unoatxt.cxx
Dosyayı görüntüle @
36e52cbb
...
@@ -98,13 +98,10 @@ uno::Any SwXAutoTextContainer::getByIndex(sal_Int32 nIndex)
...
@@ -98,13 +98,10 @@ uno::Any SwXAutoTextContainer::getByIndex(sal_Int32 nIndex)
throw
(
lang
::
IndexOutOfBoundsException
,
lang
::
WrappedTargetException
,
uno
::
RuntimeException
,
std
::
exception
)
throw
(
lang
::
IndexOutOfBoundsException
,
lang
::
WrappedTargetException
,
uno
::
RuntimeException
,
std
::
exception
)
{
{
SolarMutexGuard
aGuard
;
SolarMutexGuard
aGuard
;
uno
::
Any
aRet
;
const
size_t
nCount
=
pGlossaries
->
GetGroupCnt
();
const
size_t
nCount
=
pGlossaries
->
GetGroupCnt
();
if
(
0
<=
nIndex
&&
static_cast
<
size_t
>
(
nIndex
)
<
nCount
)
if
(
nIndex
<
0
||
static_cast
<
size_t
>
(
nIndex
)
>=
nCount
)
aRet
=
getByName
(
pGlossaries
->
GetGroupName
(
static_cast
<
size_t
>
(
nIndex
)
));
else
throw
lang
::
IndexOutOfBoundsException
();
throw
lang
::
IndexOutOfBoundsException
();
return
aRet
;
return
getByName
(
pGlossaries
->
GetGroupName
(
static_cast
<
size_t
>
(
nIndex
)
))
;
}
}
uno
::
Type
SwXAutoTextContainer
::
getElementType
(
void
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
uno
::
Type
SwXAutoTextContainer
::
getElementType
(
void
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
...
@@ -272,12 +269,10 @@ SwXAutoTextGroup::~SwXAutoTextGroup()
...
@@ -272,12 +269,10 @@ SwXAutoTextGroup::~SwXAutoTextGroup()
uno
::
Sequence
<
OUString
>
SwXAutoTextGroup
::
getTitles
(
void
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
uno
::
Sequence
<
OUString
>
SwXAutoTextGroup
::
getTitles
(
void
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
{
SolarMutexGuard
aGuard
;
SolarMutexGuard
aGuard
;
sal_uInt16
nCount
=
0
;
boost
::
scoped_ptr
<
SwTextBlocks
>
pGlosGroup
(
pGlossaries
?
pGlossaries
->
GetGroupDoc
(
m_sGroupName
,
false
)
:
0
);
boost
::
scoped_ptr
<
SwTextBlocks
>
pGlosGroup
(
pGlossaries
?
pGlossaries
->
GetGroupDoc
(
m_sGroupName
,
false
)
:
0
);
if
(
pGlosGroup
&&
!
pGlosGroup
->
GetError
())
if
(
!
pGlosGroup
||
pGlosGroup
->
GetError
())
nCount
=
pGlosGroup
->
GetCount
();
else
throw
uno
::
RuntimeException
();
throw
uno
::
RuntimeException
();
const
sal_uInt16
nCount
=
pGlosGroup
->
GetCount
();
uno
::
Sequence
<
OUString
>
aEntryTitles
(
nCount
);
uno
::
Sequence
<
OUString
>
aEntryTitles
(
nCount
);
OUString
*
pArr
=
aEntryTitles
.
getArray
();
OUString
*
pArr
=
aEntryTitles
.
getArray
();
...
@@ -494,42 +489,31 @@ void SwXAutoTextGroup::setName(const OUString& rName) throw( uno::RuntimeExcepti
...
@@ -494,42 +489,31 @@ void SwXAutoTextGroup::setName(const OUString& rName) throw( uno::RuntimeExcepti
OUString
sPreserveTitle
(
pGlossaries
->
GetGroupTitle
(
sName
)
);
OUString
sPreserveTitle
(
pGlossaries
->
GetGroupTitle
(
sName
)
);
if
(
!
pGlossaries
->
RenameGroupDoc
(
sName
,
sNewGroup
,
sPreserveTitle
)
)
if
(
!
pGlossaries
->
RenameGroupDoc
(
sName
,
sNewGroup
,
sPreserveTitle
)
)
throw
uno
::
RuntimeException
();
throw
uno
::
RuntimeException
();
else
sName
=
rName
;
{
m_sGroupName
=
sNewGroup
;
sName
=
rName
;
pGlossaries
=
pTempGlossaries
;
m_sGroupName
=
sNewGroup
;
pGlossaries
=
pTempGlossaries
;
}
}
}
sal_Int32
SwXAutoTextGroup
::
getCount
(
void
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
sal_Int32
SwXAutoTextGroup
::
getCount
(
void
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
{
SolarMutexGuard
aGuard
;
SolarMutexGuard
aGuard
;
int
nCount
=
0
;
boost
::
scoped_ptr
<
SwTextBlocks
>
pGlosGroup
(
pGlossaries
?
pGlossaries
->
GetGroupDoc
(
m_sGroupName
,
false
)
:
0
);
boost
::
scoped_ptr
<
SwTextBlocks
>
pGlosGroup
(
pGlossaries
?
pGlossaries
->
GetGroupDoc
(
m_sGroupName
,
false
)
:
0
);
if
(
pGlosGroup
&&
!
pGlosGroup
->
GetError
())
if
(
!
pGlosGroup
||
pGlosGroup
->
GetError
())
nCount
=
pGlosGroup
->
GetCount
();
else
throw
uno
::
RuntimeException
();
throw
uno
::
RuntimeException
();
return
nCount
;
return
static_cast
<
sal_Int32
>
(
pGlosGroup
->
GetCount
())
;
}
}
uno
::
Any
SwXAutoTextGroup
::
getByIndex
(
sal_Int32
nIndex
)
uno
::
Any
SwXAutoTextGroup
::
getByIndex
(
sal_Int32
nIndex
)
throw
(
lang
::
IndexOutOfBoundsException
,
lang
::
WrappedTargetException
,
uno
::
RuntimeException
,
std
::
exception
)
throw
(
lang
::
IndexOutOfBoundsException
,
lang
::
WrappedTargetException
,
uno
::
RuntimeException
,
std
::
exception
)
{
{
SolarMutexGuard
aGuard
;
SolarMutexGuard
aGuard
;
uno
::
Any
aRet
;
sal_uInt16
nCount
=
0
;
boost
::
scoped_ptr
<
SwTextBlocks
>
pGlosGroup
(
pGlossaries
?
pGlossaries
->
GetGroupDoc
(
m_sGroupName
,
false
)
:
0
);
boost
::
scoped_ptr
<
SwTextBlocks
>
pGlosGroup
(
pGlossaries
?
pGlossaries
->
GetGroupDoc
(
m_sGroupName
,
false
)
:
0
);
if
(
pGlosGroup
&&
!
pGlosGroup
->
GetError
())
if
(
!
pGlosGroup
||
pGlosGroup
->
GetError
())
nCount
=
pGlosGroup
->
GetCount
();
else
throw
uno
::
RuntimeException
();
throw
uno
::
RuntimeException
();
if
(
0
<=
nIndex
&&
nIndex
<
nCount
)
const
sal_uInt16
nCount
=
pGlosGroup
->
GetCount
();
aRet
=
getByName
(
pGlosGroup
->
GetShortName
((
sal_uInt16
)
nIndex
));
if
(
nIndex
<
0
||
nIndex
>=
static_cast
<
sal_Int32
>
(
nCount
))
else
throw
lang
::
IndexOutOfBoundsException
();
throw
lang
::
IndexOutOfBoundsException
();
return
aRet
;
return
getByName
(
pGlosGroup
->
GetShortName
(
static_cast
<
sal_uInt16
>
(
nIndex
)))
;
}
}
uno
::
Type
SwXAutoTextGroup
::
getElementType
(
void
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
uno
::
Type
SwXAutoTextGroup
::
getElementType
(
void
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
...
@@ -542,12 +526,9 @@ sal_Bool SwXAutoTextGroup::hasElements(void) throw( uno::RuntimeException, std::
...
@@ -542,12 +526,9 @@ sal_Bool SwXAutoTextGroup::hasElements(void) throw( uno::RuntimeException, std::
{
{
SolarMutexGuard
aGuard
;
SolarMutexGuard
aGuard
;
boost
::
scoped_ptr
<
SwTextBlocks
>
pGlosGroup
(
pGlossaries
?
pGlossaries
->
GetGroupDoc
(
m_sGroupName
,
false
)
:
0
);
boost
::
scoped_ptr
<
SwTextBlocks
>
pGlosGroup
(
pGlossaries
?
pGlossaries
->
GetGroupDoc
(
m_sGroupName
,
false
)
:
0
);
sal_uInt16
nCount
=
0
;
if
(
!
pGlosGroup
||
pGlosGroup
->
GetError
())
if
(
pGlosGroup
&&
!
pGlosGroup
->
GetError
())
nCount
=
pGlosGroup
->
GetCount
();
else
throw
uno
::
RuntimeException
();
throw
uno
::
RuntimeException
();
return
nCount
>
0
;
return
pGlosGroup
->
GetCount
()
>
0
;
}
}
...
@@ -565,13 +546,11 @@ uno::Sequence< OUString > SwXAutoTextGroup::getElementNames(void)
...
@@ -565,13 +546,11 @@ uno::Sequence< OUString > SwXAutoTextGroup::getElementNames(void)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
{
SolarMutexGuard
aGuard
;
SolarMutexGuard
aGuard
;
sal_uInt16
nCount
=
0
;
boost
::
scoped_ptr
<
SwTextBlocks
>
pGlosGroup
(
pGlossaries
?
pGlossaries
->
GetGroupDoc
(
m_sGroupName
,
false
)
:
0
);
boost
::
scoped_ptr
<
SwTextBlocks
>
pGlosGroup
(
pGlossaries
?
pGlossaries
->
GetGroupDoc
(
m_sGroupName
,
false
)
:
0
);
if
(
pGlosGroup
&&
!
pGlosGroup
->
GetError
())
if
(
!
pGlosGroup
||
pGlosGroup
->
GetError
())
nCount
=
pGlosGroup
->
GetCount
();
else
throw
uno
::
RuntimeException
();
throw
uno
::
RuntimeException
();
const
sal_uInt16
nCount
=
pGlosGroup
->
GetCount
();
uno
::
Sequence
<
OUString
>
aEntryNames
(
nCount
);
uno
::
Sequence
<
OUString
>
aEntryNames
(
nCount
);
OUString
*
pArr
=
aEntryNames
.
getArray
();
OUString
*
pArr
=
aEntryNames
.
getArray
();
...
@@ -585,13 +564,11 @@ sal_Bool SwXAutoTextGroup::hasByName(const OUString& rName)
...
@@ -585,13 +564,11 @@ sal_Bool SwXAutoTextGroup::hasByName(const OUString& rName)
{
{
SolarMutexGuard
aGuard
;
SolarMutexGuard
aGuard
;
bool
bRet
=
false
;
bool
bRet
=
false
;
sal_uInt16
nCount
=
0
;
boost
::
scoped_ptr
<
SwTextBlocks
>
pGlosGroup
(
pGlossaries
?
pGlossaries
->
GetGroupDoc
(
m_sGroupName
,
false
)
:
0
);
boost
::
scoped_ptr
<
SwTextBlocks
>
pGlosGroup
(
pGlossaries
?
pGlossaries
->
GetGroupDoc
(
m_sGroupName
,
false
)
:
0
);
if
(
pGlosGroup
&&
!
pGlosGroup
->
GetError
())
if
(
!
pGlosGroup
||
pGlosGroup
->
GetError
())
nCount
=
pGlosGroup
->
GetCount
();
else
throw
uno
::
RuntimeException
();
throw
uno
::
RuntimeException
();
const
sal_uInt16
nCount
=
pGlosGroup
->
GetCount
();
for
(
sal_uInt16
i
=
0
;
i
<
nCount
;
++
i
)
for
(
sal_uInt16
i
=
0
;
i
<
nCount
;
++
i
)
{
{
OUString
sCompare
(
pGlosGroup
->
GetShortName
(
i
));
OUString
sCompare
(
pGlosGroup
->
GetShortName
(
i
));
...
...
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