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
7f97b5e7
Kaydet (Commit)
7f97b5e7
authored
Eyl 23, 2016
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
convert CONTINUATION constants to typed_flags_set
Change-Id: I38333e5d229aa520fbe0a8ad72007c503853956e
üst
69c29c9f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
97 deletions
+54
-97
simpleinteractionrequest.hxx
include/ucbhelper/simpleinteractionrequest.hxx
+21
-18
warnpassword.cxx
sc/source/ui/unoobj/warnpassword.cxx
+4
-16
webdavcontent.cxx
ucb/source/ucp/webdav-neon/webdavcontent.cxx
+5
-6
webdavcontent.cxx
ucb/source/ucp/webdav/webdavcontent.cxx
+5
-5
simpleinteractionrequest.cxx
ucbhelper/source/provider/simpleinteractionrequest.cxx
+19
-52
No files found.
include/ucbhelper/simpleinteractionrequest.hxx
Dosyayı görüntüle @
7f97b5e7
...
...
@@ -22,28 +22,31 @@
#include <ucbhelper/interactionrequest.hxx>
#include <ucbhelper/ucbhelperdllapi.h>
namespace
ucbhelper
{
#include <o3tl/typed_flags_set.hxx>
/** These are the constants that can be passed to the constructor of class
* SimpleInteractionRequest and that are returned by method
* SimpleInteractionRequest::getResponse().
*/
/** The request was not (yet) handled by the interaction handler. */
static
const
sal_Int32
CONTINUATION_UNKNOWN
=
0
;
/** The interaction handler selected XInteractionAbort. */
static
const
sal_Int32
CONTINUATION_ABORT
=
1
;
/** The interaction handler selected XInteractionRetry. */
static
const
sal_Int32
CONTINUATION_RETRY
=
2
;
/** The interaction handler selected XInteractionApprove. */
static
const
sal_Int32
CONTINUATION_APPROVE
=
4
;
enum
class
ContinuationFlags
{
/** The request was not (yet) handled by the interaction handler. */
NONE
=
0
,
/** The interaction handler selected XInteractionAbort. */
Abort
=
1
,
/** The interaction handler selected XInteractionRetry. */
Retry
=
2
,
/** The interaction handler selected XInteractionApprove. */
Approve
=
4
,
/** The interaction handler selected XInteractionDisapprove. */
Disapprove
=
8
,
};
namespace
o3tl
{
template
<>
struct
typed_flags
<
ContinuationFlags
>
:
is_typed_flags
<
ContinuationFlags
,
0x0f
>
{};
}
/** The interaction handler selected XInteractionDisapprove. */
static
const
sal_Int32
CONTINUATION_DISAPPROVE
=
8
;
namespace
ucbhelper
{
/**
* This class implements a simple interaction request. The user must not deal
...
...
@@ -71,16 +74,16 @@ public:
* listed above.
*/
SimpleInteractionRequest
(
const
css
::
uno
::
Any
&
rRequest
,
const
sal_Int32
nContinuations
);
const
ContinuationFlags
nContinuations
);
/**
* After passing this request to XInteractionHandler::handle, this method
* returns the continuation that was chosen by the interaction handler.
*
* @return the continuation chosen by an interaction handler or
* C
ONTINUATION_UNKNOWN
, if the request was not (yet) handled.
* C
ontinuationFlags::NONE
, if the request was not (yet) handled.
*/
sal_Int32
getResponse
()
const
;
ContinuationFlags
getResponse
()
const
;
};
}
// namespace ucbhelper
...
...
sc/source/ui/unoobj/warnpassword.cxx
Dosyayı görüntüle @
7f97b5e7
...
...
@@ -52,26 +52,14 @@ bool ScWarnPassword::WarningOnPassword( SfxMedium& rMedium )
rtl
::
Reference
<
ucbhelper
::
SimpleInteractionRequest
>
xRequest
=
new
ucbhelper
::
SimpleInteractionRequest
(
aException
,
ucbhelper
::
CONTINUATION_APPROVE
|
ucbhelper
::
CONTINUATION_DISAPPROVE
);
ContinuationFlags
::
Approve
|
ContinuationFlags
::
Disapprove
);
xHandler
->
handle
(
xRequest
.
get
()
);
const
sal_Int32
nResp
=
xRequest
->
getResponse
();
const
ContinuationFlags
nResp
=
xRequest
->
getResponse
();
switch
(
nResp
)
{
case
ucbhelper
:
:
CONTINUATION_UNKNOWN
:
break
;
case
ucbhelper
:
:
CONTINUATION_APPROVE
:
// Continue
break
;
case
ucbhelper
:
:
CONTINUATION_DISAPPROVE
:
bReturn
=
false
;
break
;
}
if
(
nResp
==
ContinuationFlags
::
Disapprove
)
bReturn
=
false
;
}
return
bReturn
;
}
...
...
ucb/source/ucp/webdav-neon/webdavcontent.cxx
Dosyayı görüntüle @
7f97b5e7
...
...
@@ -2586,25 +2586,24 @@ void Content::insert(
rtl
::
Reference
<
ucbhelper
::
SimpleInteractionRequest
>
xRequest
=
new
ucbhelper
::
SimpleInteractionRequest
(
aExAsAny
,
ucbhelper
::
CONTINUATION_APPROVE
|
ucbhelper
::
CONTINUATION_DISAPPROVE
);
ContinuationFlags
::
Approve
|
ContinuationFlags
::
Disapprove
);
xIH
->
handle
(
xRequest
.
get
()
);
const
sal_Int32
nResp
=
xRequest
->
getResponse
();
const
ContinuationFlags
nResp
=
xRequest
->
getResponse
();
switch
(
nResp
)
{
case
ucbhelper
:
:
CONTINUATION_UNKNOWN
:
case
ContinuationFlags
:
:
NONE
:
// Not handled; throw.
throw
aEx
;
// break;
case
ucbhelper
:
:
CONTINUATION_APPROVE
:
case
ContinuationFlags
:
:
Approve
:
// Continue -> Overwrite.
bReplaceExisting
=
true
;
break
;
case
ucbhelper
:
:
CONTINUATION_DISAPPROVE
:
case
ContinuationFlags
:
:
Disapprove
:
// Abort.
throw
ucb
::
CommandFailedException
(
OUString
(),
...
...
ucb/source/ucp/webdav/webdavcontent.cxx
Dosyayı görüntüle @
7f97b5e7
...
...
@@ -2435,25 +2435,25 @@ void Content::insert(
rtl
::
Reference
<
ucbhelper
::
SimpleInteractionRequest
>
xRequest
=
new
ucbhelper
::
SimpleInteractionRequest
(
aExAsAny
,
ucbhelper
::
CONTINUATION_APPROVE
|
ucbhelper
::
CONTINUATION_DISAPPROVE
);
ContinuationFlags
::
Approve
|
ContinuationFlags
::
Disapprove
);
xIH
->
handle
(
xRequest
.
get
()
);
const
sal_Int32
nResp
=
xRequest
->
getResponse
();
switch
(
nResp
)
{
case
ucbhelper
:
:
CONTINUATION_UNKNOWN
:
case
ContinuationFlags
:
:
NONE
:
// Not handled; throw.
throw
aEx
;
// break;
case
ucbhelper
:
:
CONTINUATION_APPROVE
:
case
ContinuationFlags
:
:
Approve
:
// Continue -> Overwrite.
bReplaceExisting
=
true
;
break
;
case
ucbhelper
:
:
CONTINUATION_DISAPPROVE
:
case
ContinuationFlags
:
:
Disapprove
:
// Abort.
throw
ucb
::
CommandFailedException
(
OUString
(),
...
...
ucbhelper/source/provider/simpleinteractionrequest.cxx
Dosyayı görüntüle @
7f97b5e7
...
...
@@ -18,6 +18,7 @@
*/
#include <ucbhelper/simpleinteractionrequest.hxx>
#include <comphelper/sequence.hxx>
#include <osl/diagnose.h>
...
...
@@ -27,69 +28,35 @@ using namespace ucbhelper;
SimpleInteractionRequest
::
SimpleInteractionRequest
(
const
uno
::
Any
&
rRequest
,
const
sal_Int32
nContinuations
)
const
ContinuationFlags
nContinuations
)
:
InteractionRequest
(
rRequest
)
{
// Set continuations.
OSL_ENSURE
(
nContinuations
!=
C
ONTINUATION_UNKNOWN
,
OSL_ENSURE
(
nContinuations
!=
C
ontinuationFlags
::
NONE
,
"SimpleInteractionRequest - No continuation!"
);
sal_Int32
nLength
=
0
;
uno
::
Reference
<
task
::
XInteractionContinuation
>
xAbort
;
uno
::
Reference
<
task
::
XInteractionContinuation
>
xRetry
;
uno
::
Reference
<
task
::
XInteractionContinuation
>
xApprove
;
uno
::
Reference
<
task
::
XInteractionContinuation
>
xDisapprove
;
if
(
nContinuations
&
CONTINUATION_ABORT
)
std
::
vector
<
uno
::
Reference
<
task
::
XInteractionContinuation
>
>
aContinuations
;
if
(
nContinuations
&
ContinuationFlags
::
Abort
)
{
++
nLength
;
xAbort
=
new
InteractionAbort
(
this
);
aContinuations
.
push_back
(
new
InteractionAbort
(
this
)
);
}
if
(
nContinuations
&
CONTINUATION_RETRY
)
if
(
nContinuations
&
ContinuationFlags
::
Retry
)
{
++
nLength
;
xRetry
=
new
InteractionRetry
(
this
);
aContinuations
.
push_back
(
new
InteractionRetry
(
this
)
);
}
if
(
nContinuations
&
CONTINUATION_APPROVE
)
if
(
nContinuations
&
ContinuationFlags
::
Approve
)
{
++
nLength
;
xApprove
=
new
InteractionApprove
(
this
);
aContinuations
.
push_back
(
new
InteractionApprove
(
this
)
);
}
if
(
nContinuations
&
CONTINUATION_DISAPPROVE
)
if
(
nContinuations
&
ContinuationFlags
::
Disapprove
)
{
++
nLength
;
xDisapprove
=
new
InteractionDisapprove
(
this
);
aContinuations
.
push_back
(
new
InteractionDisapprove
(
this
)
);
}
OSL_ENSURE
(
nLength
>
0
,
"SimpleInteractionRequest - No continuation!"
);
uno
::
Sequence
<
uno
::
Reference
<
task
::
XInteractionContinuation
>
>
aContinuations
(
nLength
);
nLength
=
0
;
if
(
xAbort
.
is
()
)
aContinuations
[
nLength
++
]
=
xAbort
;
if
(
xRetry
.
is
()
)
aContinuations
[
nLength
++
]
=
xRetry
;
if
(
xApprove
.
is
()
)
aContinuations
[
nLength
++
]
=
xApprove
;
if
(
xDisapprove
.
is
()
)
aContinuations
[
nLength
++
]
=
xDisapprove
;
setContinuations
(
aContinuations
);
setContinuations
(
comphelper
::
containerToSequence
(
aContinuations
)
);
}
sal_Int32
SimpleInteractionRequest
::
getResponse
()
const
ContinuationFlags
SimpleInteractionRequest
::
getResponse
()
const
{
rtl
::
Reference
<
InteractionContinuation
>
xSelection
=
getSelection
();
if
(
xSelection
.
is
()
)
...
...
@@ -99,26 +66,26 @@ sal_Int32 SimpleInteractionRequest::getResponse() const
uno
::
Reference
<
task
::
XInteractionAbort
>
xAbort
(
pSelection
,
uno
::
UNO_QUERY
);
if
(
xAbort
.
is
()
)
return
C
ONTINUATION_ABORT
;
return
C
ontinuationFlags
::
Abort
;
uno
::
Reference
<
task
::
XInteractionRetry
>
xRetry
(
pSelection
,
uno
::
UNO_QUERY
);
if
(
xRetry
.
is
()
)
return
C
ONTINUATION_RETRY
;
return
C
ontinuationFlags
::
Retry
;
uno
::
Reference
<
task
::
XInteractionApprove
>
xApprove
(
pSelection
,
uno
::
UNO_QUERY
);
if
(
xApprove
.
is
()
)
return
C
ONTINUATION_APPROVE
;
return
C
ontinuationFlags
::
Approve
;
uno
::
Reference
<
task
::
XInteractionDisapprove
>
xDisapprove
(
pSelection
,
uno
::
UNO_QUERY
);
if
(
xDisapprove
.
is
()
)
return
C
ONTINUATION_DISAPPROVE
;
return
C
ontinuationFlags
::
Disapprove
;
OSL_FAIL
(
"SimpleInteractionRequest::getResponse - Unknown continuation!"
);
}
return
C
ONTINUATION_UNKNOWN
;
return
C
ontinuationFlags
::
NONE
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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