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
2f9d53df
Kaydet (Commit)
2f9d53df
authored
Şub 24, 2016
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
remove unused exc_handling enum
Change-Id: I5e2e084114c8b0eedd0f2cd8327d6c6d68742462
üst
cdf176c9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
31 deletions
+17
-31
scopeguard.cxx
comphelper/source/misc/scopeguard.cxx
+12
-21
flagguard.hxx
include/comphelper/flagguard.hxx
+4
-4
scopeguard.hxx
include/comphelper/scopeguard.hxx
+1
-6
No files found.
comphelper/source/misc/scopeguard.cxx
Dosyayı görüntüle @
2f9d53df
...
...
@@ -26,27 +26,18 @@ namespace comphelper {
ScopeGuard
::~
ScopeGuard
()
{
if
(
m_func
)
{
if
(
m_excHandling
==
IGNORE_EXCEPTIONS
)
{
try
{
m_func
();
}
catch
(
css
::
uno
::
Exception
&
exc
)
{
(
void
)
exc
;
// avoid warning about unused variable
OSL_FAIL
(
OUStringToOString
(
"UNO exception occurred: "
+
exc
.
Message
,
RTL_TEXTENCODING_UTF8
).
getStr
()
);
}
catch
(...)
{
OSL_FAIL
(
"unknown exception occurred!"
);
}
}
else
{
m_func
();
}
if
(
!
m_func
)
return
;
try
{
m_func
();
}
catch
(
css
::
uno
::
Exception
&
exc
)
{
(
void
)
exc
;
// avoid warning about unused variable
OSL_FAIL
(
OUStringToOString
(
"UNO exception occurred: "
+
exc
.
Message
,
RTL_TEXTENCODING_UTF8
).
getStr
()
);
}
catch
(...)
{
OSL_FAIL
(
"unknown exception occurred!"
);
}
}
...
...
include/comphelper/flagguard.hxx
Dosyayı görüntüle @
2f9d53df
...
...
@@ -31,8 +31,8 @@ namespace comphelper
class
COMPHELPER_DLLPUBLIC
FlagRestorationGuard
:
public
ScopeGuard
{
public
:
FlagRestorationGuard
(
bool
&
i_flagRef
,
bool
i_temporaryValue
,
exc_handling
i_excHandling
=
IGNORE_EXCEPTIONS
)
:
ScopeGuard
(
RestoreFlag
(
i_flagRef
)
,
i_excHandling
)
FlagRestorationGuard
(
bool
&
i_flagRef
,
bool
i_temporaryValue
)
:
ScopeGuard
(
RestoreFlag
(
i_flagRef
))
{
i_flagRef
=
i_temporaryValue
;
}
...
...
@@ -61,8 +61,8 @@ namespace comphelper
class
COMPHELPER_DLLPUBLIC
FlagGuard
:
public
ScopeGuard
{
public
:
explicit
FlagGuard
(
bool
&
i_flagRef
,
exc_handling
i_excHandling
=
IGNORE_EXCEPTIONS
)
:
ScopeGuard
(
[
&
i_flagRef
]
()
{
i_flagRef
=
false
;
}
,
i_excHandling
)
explicit
FlagGuard
(
bool
&
i_flagRef
)
:
ScopeGuard
(
[
&
i_flagRef
]
()
{
i_flagRef
=
false
;
}
)
{
i_flagRef
=
true
;
}
...
...
include/comphelper/scopeguard.hxx
Dosyayı görüntüle @
2f9d53df
...
...
@@ -31,16 +31,12 @@ namespace comphelper {
class
COMPHELPER_DLLPUBLIC
ScopeGuard
{
public
:
enum
exc_handling
{
IGNORE_EXCEPTIONS
,
ALLOW_EXCEPTIONS
};
/** @param func function object to be executed in dtor
@param excHandling switches whether thrown exceptions in dtor will be
silently ignored (but OSL_ asserted)
*/
template
<
typename
func_type
>
explicit
ScopeGuard
(
func_type
const
&
func
,
exc_handling
excHandling
=
IGNORE_EXCEPTIONS
)
:
m_func
(
func
),
m_excHandling
(
excHandling
)
{}
explicit
ScopeGuard
(
func_type
const
&
func
)
:
m_func
(
func
)
{}
~
ScopeGuard
();
...
...
@@ -55,7 +51,6 @@ private:
ScopeGuard
&
operator
=
(
const
ScopeGuard
&
)
=
delete
;
::
std
::
function
<
void
()
>
m_func
;
exc_handling
const
m_excHandling
;
};
}
// namespace comphelper
...
...
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