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
a60f9112
Kaydet (Commit)
a60f9112
authored
Eyl 05, 2012
tarafından
Ricardo Montania
Kaydeden (comit)
Stephan Bergmann
Eyl 05, 2012
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
OUString and RTL_CONSTASCII cleanup
Change-Id: Ic56451b2c13d8561bb6e6ee92bf9147b35640a5c
üst
a82e532c
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
75 additions
and
197 deletions
+75
-197
bridge.cxx
binaryurp/source/bridge.cxx
+23
-55
bridgefactory.cxx
binaryurp/source/bridgefactory.cxx
+5
-12
currentcontext.cxx
binaryurp/source/currentcontext.cxx
+4
-6
incomingrequest.cxx
binaryurp/source/incomingrequest.cxx
+1
-2
marshal.cxx
binaryurp/source/marshal.cxx
+1
-3
outgoingrequests.cxx
binaryurp/source/outgoingrequests.cxx
+1
-2
proxy.cxx
binaryurp/source/proxy.cxx
+1
-2
reader.cxx
binaryurp/source/reader.cxx
+16
-48
unmarshal.cxx
binaryurp/source/unmarshal.cxx
+19
-57
writer.cxx
binaryurp/source/writer.cxx
+4
-10
No files found.
binaryurp/source/bridge.cxx
Dosyayı görüntüle @
a60f9112
...
@@ -179,15 +179,13 @@ Bridge::Bridge(
...
@@ -179,15 +179,13 @@ Bridge::Bridge(
css
::
uno
::
Reference
<
css
::
bridge
::
XInstanceProvider
>
const
&
provider
)
:
css
::
uno
::
Reference
<
css
::
bridge
::
XInstanceProvider
>
const
&
provider
)
:
factory_
(
factory
),
name_
(
name
),
connection_
(
connection
),
factory_
(
factory
),
name_
(
name
),
connection_
(
connection
),
provider_
(
provider
),
provider_
(
provider
),
binaryUno_
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
UNO_LB_UNO
))
),
binaryUno_
(
UNO_LB_UNO
),
cppToBinaryMapping_
(
cppToBinaryMapping_
(
OUString
(
CPPU_CURRENT_LANGUAGE_BINDING_NAME
,
RTL_CONSTASCII_USTRINGPARAM
(
CPPU_CURRENT_LANGUAGE_BINDING_NAME
)),
UNO_LB_UNO
),
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
UNO_LB_UNO
))),
binaryToCppMapping_
(
binaryToCppMapping_
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
UNO_LB_UNO
)),
UNO_LB_UNO
,
OUString
(
CPPU_CURRENT_LANGUAGE_BINDING_NAME
),
RTL_CONSTASCII_USTRINGPARAM
(
CPPU_CURRENT_LANGUAGE_BINDING_NAME
))),
protPropTid_
(
protPropTid_
(
reinterpret_cast
<
sal_Int8
const
*
>
(
".UrpProtocolPropertiesTid"
),
reinterpret_cast
<
sal_Int8
const
*
>
(
".UrpProtocolPropertiesTid"
),
RTL_CONSTASCII_LENGTH
(
".UrpProtocolPropertiesTid"
)),
RTL_CONSTASCII_LENGTH
(
".UrpProtocolPropertiesTid"
)),
...
@@ -196,13 +194,9 @@ Bridge::Bridge(
...
@@ -196,13 +194,9 @@ Bridge::Bridge(
cppu
::
UnoType
<
cppu
::
UnoType
<
css
::
uno
::
Reference
<
css
::
bridge
::
XProtocolProperties
>
>::
get
()),
css
::
uno
::
Reference
<
css
::
bridge
::
XProtocolProperties
>
>::
get
()),
protPropRequest_
(
protPropRequest_
(
OUString
(
"com.sun.star.bridge.XProtocolProperties::requestChange"
),
RTL_CONSTASCII_USTRINGPARAM
(
"com.sun.star.bridge.XProtocolProperties::requestChange"
))),
protPropCommit_
(
protPropCommit_
(
OUString
(
"com.sun.star.bridge.XProtocolProperties::commitChange"
),
RTL_CONSTASCII_USTRINGPARAM
(
"com.sun.star.bridge.XProtocolProperties::commitChange"
))),
state_
(
STATE_INITIAL
),
threadPool_
(
0
),
currentContextMode_
(
false
),
state_
(
STATE_INITIAL
),
threadPool_
(
0
),
currentContextMode_
(
false
),
proxies_
(
0
),
calls_
(
0
),
normalCall_
(
false
),
activeCalls_
(
0
),
proxies_
(
0
),
calls_
(
0
),
normalCall_
(
false
),
activeCalls_
(
0
),
mode_
(
MODE_REQUESTED
)
mode_
(
MODE_REQUESTED
)
...
@@ -210,14 +204,12 @@ Bridge::Bridge(
...
@@ -210,14 +204,12 @@ Bridge::Bridge(
assert
(
factory
.
is
()
&&
connection
.
is
());
assert
(
factory
.
is
()
&&
connection
.
is
());
if
(
!
binaryUno_
.
is
())
{
if
(
!
binaryUno_
.
is
())
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"URP: no binary UNO environment"
,
RTL_CONSTASCII_USTRINGPARAM
(
"URP: no binary UNO environment"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
if
(
!
(
cppToBinaryMapping_
.
is
()
&&
binaryToCppMapping_
.
is
()))
{
if
(
!
(
cppToBinaryMapping_
.
is
()
&&
binaryToCppMapping_
.
is
()))
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"URP: no C++ UNO mapping"
,
RTL_CONSTASCII_USTRINGPARAM
(
"URP: no C++ UNO mapping"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
passive_
.
set
();
passive_
.
set
();
...
@@ -473,9 +465,7 @@ OUString Bridge::registerOutgoingInterface(
...
@@ -473,9 +465,7 @@ OUString Bridge::registerOutgoingInterface(
assert
(
stub
!=
&
newStub
);
assert
(
stub
!=
&
newStub
);
if
(
j
->
second
.
references
==
SAL_MAX_UINT32
)
{
if
(
j
->
second
.
references
==
SAL_MAX_UINT32
)
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"URP: stub reference count overflow"
,
RTL_CONSTASCII_USTRINGPARAM
(
"URP: stub reference count overflow"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
++
j
->
second
.
references
;
++
j
->
second
.
references
;
...
@@ -517,15 +507,13 @@ void Bridge::releaseStub(
...
@@ -517,15 +507,13 @@ void Bridge::releaseStub(
Stubs
::
iterator
i
(
stubs_
.
find
(
oid
));
Stubs
::
iterator
i
(
stubs_
.
find
(
oid
));
if
(
i
==
stubs_
.
end
())
{
if
(
i
==
stubs_
.
end
())
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"URP: release unknown stub"
,
RTL_CONSTASCII_USTRINGPARAM
(
"URP: release unknown stub"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
Stub
::
iterator
j
(
i
->
second
.
find
(
type
));
Stub
::
iterator
j
(
i
->
second
.
find
(
type
));
if
(
j
==
i
->
second
.
end
())
{
if
(
j
==
i
->
second
.
end
())
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"URP: release unknown stub"
,
RTL_CONSTASCII_USTRINGPARAM
(
"URP: release unknown stub"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
assert
(
j
->
second
.
references
>
0
);
assert
(
j
->
second
.
references
>
0
);
...
@@ -643,9 +631,7 @@ bool Bridge::makeCall(
...
@@ -643,9 +631,7 @@ bool Bridge::makeCall(
}
}
if
(
resp
.
get
()
==
0
)
{
if
(
resp
.
get
()
==
0
)
{
throw
css
::
lang
::
DisposedException
(
throw
css
::
lang
::
DisposedException
(
OUString
(
"Binary URP bridge disposed during call"
,
RTL_CONSTASCII_USTRINGPARAM
(
"Binary URP bridge disposed during call"
)),
static_cast
<
cppu
::
OWeakObject
*
>
(
this
));
static_cast
<
cppu
::
OWeakObject
*
>
(
this
));
}
}
*
returnValue
=
resp
->
returnValue
;
*
returnValue
=
resp
->
returnValue
;
...
@@ -710,10 +696,8 @@ void Bridge::handleRequestChangeReply(
...
@@ -710,10 +696,8 @@ void Bridge::handleRequestChangeReply(
}
}
if
(
n
!=
exp
)
{
if
(
n
!=
exp
)
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"URP: requestChange reply with unexpected return value"
"URP: requestChange reply with unexpected return value"
" received"
))
,
" received"
,
static_cast
<
cppu
::
OWeakObject
*
>
(
this
));
static_cast
<
cppu
::
OWeakObject
*
>
(
this
));
}
}
decrementCalls
();
decrementCalls
();
...
@@ -796,9 +780,7 @@ void Bridge::handleRequestChangeRequest(
...
@@ -796,9 +780,7 @@ void Bridge::handleRequestChangeRequest(
}
}
default
:
default
:
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"URP: unexpected requestChange request received"
,
RTL_CONSTASCII_USTRINGPARAM
(
"URP: unexpected requestChange request received"
)),
static_cast
<
cppu
::
OWeakObject
*
>
(
this
));
static_cast
<
cppu
::
OWeakObject
*
>
(
this
));
}
}
}
}
...
@@ -824,9 +806,7 @@ void Bridge::handleCommitChangeRequest(
...
@@ -824,9 +806,7 @@ void Bridge::handleCommitChangeRequest(
ret
=
mapCppToBinaryAny
(
ret
=
mapCppToBinaryAny
(
css
::
uno
::
makeAny
(
css
::
uno
::
makeAny
(
css
::
bridge
::
InvalidProtocolChangeException
(
css
::
bridge
::
InvalidProtocolChangeException
(
OUString
(
"InvalidProtocolChangeException"
,
RTL_CONSTASCII_USTRINGPARAM
(
"InvalidProtocolChangeException"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
(),
s
[
i
],
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
(),
s
[
i
],
1
)));
1
)));
break
;
break
;
...
@@ -853,9 +833,7 @@ void Bridge::handleCommitChangeRequest(
...
@@ -853,9 +833,7 @@ void Bridge::handleCommitChangeRequest(
break
;
break
;
default
:
default
:
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"URP: unexpected commitChange request received"
,
RTL_CONSTASCII_USTRINGPARAM
(
"URP: unexpected commitChange request received"
)),
static_cast
<
cppu
::
OWeakObject
*
>
(
this
));
static_cast
<
cppu
::
OWeakObject
*
>
(
this
));
}
}
}
}
...
@@ -899,18 +877,14 @@ css::uno::Reference< css::uno::XInterface > Bridge::getInstance(
...
@@ -899,18 +877,14 @@ css::uno::Reference< css::uno::XInterface > Bridge::getInstance(
{
{
if
(
sInstanceName
.
isEmpty
())
{
if
(
sInstanceName
.
isEmpty
())
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"XBridge::getInstance sInstanceName must be non-empty"
,
RTL_CONSTASCII_USTRINGPARAM
(
"XBridge::getInstance sInstanceName must be non-empty"
)),
static_cast
<
cppu
::
OWeakObject
*
>
(
this
));
static_cast
<
cppu
::
OWeakObject
*
>
(
this
));
}
}
for
(
sal_Int32
i
=
0
;
i
!=
sInstanceName
.
getLength
();
++
i
)
{
for
(
sal_Int32
i
=
0
;
i
!=
sInstanceName
.
getLength
();
++
i
)
{
if
(
sInstanceName
[
i
]
>
0x7F
)
{
if
(
sInstanceName
[
i
]
>
0x7F
)
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"XBridge::getInstance sInstanceName contains non-ASCII"
"XBridge::getInstance sInstanceName contains non-ASCII"
" character"
))
,
" character"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
}
}
...
@@ -927,9 +901,7 @@ css::uno::Reference< css::uno::XInterface > Bridge::getInstance(
...
@@ -927,9 +901,7 @@ css::uno::Reference< css::uno::XInterface > Bridge::getInstance(
bool
exc
=
makeCall
(
bool
exc
=
makeCall
(
sInstanceName
,
sInstanceName
,
css
::
uno
::
TypeDescription
(
css
::
uno
::
TypeDescription
(
OUString
(
"com.sun.star.uno.XInterface::queryInterface"
),
RTL_CONSTASCII_USTRINGPARAM
(
"com.sun.star.uno.XInterface::queryInterface"
))),
false
,
inArgs
,
&
ret
,
&
outArgs
);
false
,
inArgs
,
&
ret
,
&
outArgs
);
throwException
(
exc
,
ret
);
throwException
(
exc
,
ret
);
return
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
(
return
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
(
...
@@ -996,7 +968,7 @@ void Bridge::removeEventListener(
...
@@ -996,7 +968,7 @@ void Bridge::removeEventListener(
void
Bridge
::
sendCommitChangeRequest
()
{
void
Bridge
::
sendCommitChangeRequest
()
{
assert
(
mode_
==
MODE_REQUESTED
||
mode_
==
MODE_REPLY_1
);
assert
(
mode_
==
MODE_REQUESTED
||
mode_
==
MODE_REPLY_1
);
css
::
uno
::
Sequence
<
css
::
bridge
::
ProtocolProperty
>
s
(
1
);
css
::
uno
::
Sequence
<
css
::
bridge
::
ProtocolProperty
>
s
(
1
);
s
[
0
].
Name
=
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"CurrentContext"
))
;
s
[
0
].
Name
=
"CurrentContext"
;
std
::
vector
<
BinaryAny
>
a
;
std
::
vector
<
BinaryAny
>
a
;
a
.
push_back
(
mapCppToBinaryAny
(
css
::
uno
::
makeAny
(
s
)));
a
.
push_back
(
mapCppToBinaryAny
(
css
::
uno
::
makeAny
(
s
)));
sendProtPropRequest
(
OutgoingRequest
::
KIND_COMMIT_CHANGE
,
a
);
sendProtPropRequest
(
OutgoingRequest
::
KIND_COMMIT_CHANGE
,
a
);
...
@@ -1026,9 +998,7 @@ void Bridge::makeReleaseCall(
...
@@ -1026,9 +998,7 @@ void Bridge::makeReleaseCall(
sendRequest
(
sendRequest
(
att
.
getTid
(),
oid
,
type
,
att
.
getTid
(),
oid
,
type
,
css
::
uno
::
TypeDescription
(
css
::
uno
::
TypeDescription
(
OUString
(
"com.sun.star.uno.XInterface::release"
),
RTL_CONSTASCII_USTRINGPARAM
(
"com.sun.star.uno.XInterface::release"
))),
std
::
vector
<
BinaryAny
>
());
std
::
vector
<
BinaryAny
>
());
}
}
...
@@ -1075,9 +1045,7 @@ void Bridge::checkDisposed() {
...
@@ -1075,9 +1045,7 @@ void Bridge::checkDisposed() {
assert
(
state_
!=
STATE_INITIAL
);
assert
(
state_
!=
STATE_INITIAL
);
if
(
state_
!=
STATE_STARTED
)
{
if
(
state_
!=
STATE_STARTED
)
{
throw
css
::
lang
::
DisposedException
(
throw
css
::
lang
::
DisposedException
(
OUString
(
"Binary URP bridge already disposed"
,
RTL_CONSTASCII_USTRINGPARAM
(
"Binary URP bridge already disposed"
)),
static_cast
<
cppu
::
OWeakObject
*
>
(
this
));
static_cast
<
cppu
::
OWeakObject
*
>
(
this
));
}
}
}
}
...
...
binaryurp/source/bridgefactory.cxx
Dosyayı görüntüle @
a60f9112
...
@@ -53,14 +53,13 @@ css::uno::Reference< css::uno::XInterface > BridgeFactory::static_create(
...
@@ -53,14 +53,13 @@ css::uno::Reference< css::uno::XInterface > BridgeFactory::static_create(
OUString
BridgeFactory
::
static_getImplementationName
()
{
OUString
BridgeFactory
::
static_getImplementationName
()
{
return
OUString
(
return
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"com.sun.star.comp.bridge.BridgeFactory"
);
"com.sun.star.comp.bridge.BridgeFactory"
));
}
}
css
::
uno
::
Sequence
<
OUString
>
css
::
uno
::
Sequence
<
OUString
>
BridgeFactory
::
static_getSupportedServiceNames
()
{
BridgeFactory
::
static_getSupportedServiceNames
()
{
OUString
name
(
OUString
name
(
RTL_CONSTASCII_USTRINGPARAM
(
"com.sun.star.bridge.BridgeFactory"
)
);
"com.sun.star.bridge.BridgeFactory"
);
return
css
::
uno
::
Sequence
<
OUString
>
(
&
name
,
1
);
return
css
::
uno
::
Sequence
<
OUString
>
(
&
name
,
1
);
}
}
...
@@ -136,10 +135,8 @@ css::uno::Reference< css::bridge::XBridge > BridgeFactory::createBridge(
...
@@ -136,10 +135,8 @@ css::uno::Reference< css::bridge::XBridge > BridgeFactory::createBridge(
if
(
sProtocol
!=
"urp"
||
!
aConnection
.
is
()
)
if
(
sProtocol
!=
"urp"
||
!
aConnection
.
is
()
)
{
{
throw
css
::
lang
::
IllegalArgumentException
(
throw
css
::
lang
::
IllegalArgumentException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"BridgeFactory::createBridge: sProtocol != urp ||"
"BridgeFactory::createBridge: sProtocol != urp ||"
" aConnection == null"
))
,
" aConnection == null"
,
static_cast
<
cppu
::
OWeakObject
*
>
(
this
),
-
1
);
static_cast
<
cppu
::
OWeakObject
*
>
(
this
),
-
1
);
}
}
b
.
set
(
new
Bridge
(
this
,
sName
,
aConnection
,
anInstanceProvider
));
b
.
set
(
new
Bridge
(
this
,
sName
,
aConnection
,
anInstanceProvider
));
...
@@ -168,17 +165,13 @@ BridgeFactory::getExistingBridges() throw (css::uno::RuntimeException) {
...
@@ -168,17 +165,13 @@ BridgeFactory::getExistingBridges() throw (css::uno::RuntimeException) {
osl
::
MutexGuard
g
(
*
this
);
osl
::
MutexGuard
g
(
*
this
);
if
(
unnamed_
.
size
()
>
SAL_MAX_INT32
)
{
if
(
unnamed_
.
size
()
>
SAL_MAX_INT32
)
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"BridgeFactory::getExistingBridges: too many"
,
RTL_CONSTASCII_USTRINGPARAM
(
"BridgeFactory::getExistingBridges: too many"
)),
static_cast
<
cppu
::
OWeakObject
*
>
(
this
));
static_cast
<
cppu
::
OWeakObject
*
>
(
this
));
}
}
sal_Int32
n
=
static_cast
<
sal_Int32
>
(
unnamed_
.
size
());
sal_Int32
n
=
static_cast
<
sal_Int32
>
(
unnamed_
.
size
());
if
(
named_
.
size
()
>
static_cast
<
sal_uInt32
>
(
SAL_MAX_INT32
-
n
))
{
if
(
named_
.
size
()
>
static_cast
<
sal_uInt32
>
(
SAL_MAX_INT32
-
n
))
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"BridgeFactory::getExistingBridges: too many"
,
RTL_CONSTASCII_USTRINGPARAM
(
"BridgeFactory::getExistingBridges: too many"
)),
static_cast
<
cppu
::
OWeakObject
*
>
(
this
));
static_cast
<
cppu
::
OWeakObject
*
>
(
this
));
}
}
n
=
static_cast
<
sal_Int32
>
(
n
+
named_
.
size
());
n
=
static_cast
<
sal_Int32
>
(
n
+
named_
.
size
());
...
...
binaryurp/source/currentcontext.cxx
Dosyayı görüntüle @
a60f9112
...
@@ -44,11 +44,10 @@ css::uno::UnoInterfaceReference get() {
...
@@ -44,11 +44,10 @@ css::uno::UnoInterfaceReference get() {
css
::
uno
::
UnoInterfaceReference
cc
;
css
::
uno
::
UnoInterfaceReference
cc
;
if
(
!
uno_getCurrentContext
(
if
(
!
uno_getCurrentContext
(
reinterpret_cast
<
void
**
>
(
&
cc
.
m_pUnoI
),
reinterpret_cast
<
void
**
>
(
&
cc
.
m_pUnoI
),
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
UNO_LB_UNO
)
).
pData
,
0
))
OUString
(
UNO_LB_UNO
).
pData
,
0
))
{
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"uno_getCurrentContext failed"
,
RTL_CONSTASCII_USTRINGPARAM
(
"uno_getCurrentContext failed"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
return
cc
;
return
cc
;
...
@@ -58,11 +57,10 @@ void set(css::uno::UnoInterfaceReference const & value) {
...
@@ -58,11 +57,10 @@ void set(css::uno::UnoInterfaceReference const & value) {
css
::
uno
::
UnoInterfaceReference
cc
(
value
);
css
::
uno
::
UnoInterfaceReference
cc
(
value
);
if
(
!
uno_setCurrentContext
(
if
(
!
uno_setCurrentContext
(
cc
.
m_pUnoI
,
cc
.
m_pUnoI
,
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
UNO_LB_UNO
)
).
pData
,
0
))
OUString
(
UNO_LB_UNO
).
pData
,
0
))
{
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"uno_setCurrentContext failed"
,
RTL_CONSTASCII_USTRINGPARAM
(
"uno_setCurrentContext failed"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
}
}
...
...
binaryurp/source/incomingrequest.cxx
Dosyayı görüntüle @
a60f9112
...
@@ -80,8 +80,7 @@ void IncomingRequest::execute() const {
...
@@ -80,8 +80,7 @@ void IncomingRequest::execute() const {
isExc
=
!
execute_throw
(
&
ret
,
&
outArgs
);
isExc
=
!
execute_throw
(
&
ret
,
&
outArgs
);
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
(
OUString
(
(
"caught C++ exception: "
+
RTL_CONSTASCII_USTRINGPARAM
(
"caught C++ exception: "
))
+
rtl
::
OStringToOUString
(
rtl
::
OStringToOUString
(
rtl
::
OString
(
e
.
what
()),
RTL_TEXTENCODING_ASCII_US
)),
rtl
::
OString
(
e
.
what
()),
RTL_TEXTENCODING_ASCII_US
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
...
...
binaryurp/source/marshal.cxx
Dosyayı görüntüle @
a60f9112
...
@@ -83,9 +83,7 @@ void writeString(
...
@@ -83,9 +83,7 @@ void writeString(
RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR
)))
RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR
)))
{
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"UNO string contains invalid UTF-16 sequence"
,
RTL_CONSTASCII_USTRINGPARAM
(
"UNO string contains invalid UTF-16 sequence"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
writeCompressed
(
buffer
,
static_cast
<
sal_uInt32
>
(
v
.
getLength
()));
writeCompressed
(
buffer
,
static_cast
<
sal_uInt32
>
(
v
.
getLength
()));
...
...
binaryurp/source/outgoingrequests.cxx
Dosyayı görüntüle @
a60f9112
...
@@ -51,8 +51,7 @@ OutgoingRequest OutgoingRequests::top(rtl::ByteSequence const & tid) {
...
@@ -51,8 +51,7 @@ OutgoingRequest OutgoingRequests::top(rtl::ByteSequence const & tid) {
Map
::
iterator
i
(
map_
.
find
(
tid
));
Map
::
iterator
i
(
map_
.
find
(
tid
));
if
(
i
==
map_
.
end
())
{
if
(
i
==
map_
.
end
())
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"URP: reply for unknown TID"
,
RTL_CONSTASCII_USTRINGPARAM
(
"URP: reply for unknown TID"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
OSL_ASSERT
(
!
i
->
second
.
empty
());
OSL_ASSERT
(
!
i
->
second
.
empty
());
...
...
binaryurp/source/proxy.cxx
Dosyayı görüntüle @
a60f9112
...
@@ -109,8 +109,7 @@ void Proxy::do_dispatch(
...
@@ -109,8 +109,7 @@ void Proxy::do_dispatch(
do_dispatch_throw
(
member
,
returnValue
,
arguments
,
exception
);
do_dispatch_throw
(
member
,
returnValue
,
arguments
,
exception
);
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
(
OUString
(
(
"caught C++ exception: "
+
RTL_CONSTASCII_USTRINGPARAM
(
"caught C++ exception: "
))
+
rtl
::
OStringToOUString
(
rtl
::
OStringToOUString
(
rtl
::
OString
(
e
.
what
()),
RTL_TEXTENCODING_ASCII_US
)),
rtl
::
OString
(
e
.
what
()),
RTL_TEXTENCODING_ASCII_US
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
...
...
binaryurp/source/reader.cxx
Dosyayı görüntüle @
a60f9112
...
@@ -69,9 +69,7 @@ css::uno::Sequence< sal_Int8 > read(
...
@@ -69,9 +69,7 @@ css::uno::Sequence< sal_Int8 > read(
assert
(
connection
.
is
());
assert
(
connection
.
is
());
if
(
size
>
SAL_MAX_INT32
)
{
if
(
size
>
SAL_MAX_INT32
)
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"binaryurp::Reader: block size too large"
,
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Reader: block size too large"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
css
::
uno
::
Sequence
<
sal_Int8
>
buf
;
css
::
uno
::
Sequence
<
sal_Int8
>
buf
;
...
@@ -81,9 +79,7 @@ css::uno::Sequence< sal_Int8 > read(
...
@@ -81,9 +79,7 @@ css::uno::Sequence< sal_Int8 > read(
}
}
if
(
n
!=
static_cast
<
sal_Int32
>
(
size
))
{
if
(
n
!=
static_cast
<
sal_Int32
>
(
size
))
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
"binaryurp::Reader: premature end of input"
,
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Reader: premature end of input"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
assert
(
buf
.
getLength
()
==
static_cast
<
sal_Int32
>
(
size
));
assert
(
buf
.
getLength
()
==
static_cast
<
sal_Int32
>
(
size
));
...
@@ -123,10 +119,8 @@ void Reader::execute() {
...
@@ -123,10 +119,8 @@ void Reader::execute() {
header
.
done
();
header
.
done
();
if
(
count
==
0
)
{
if
(
count
==
0
)
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Reader: block with zero message count"
"binaryurp::Reader: block with zero message count"
" received"
))
,
" received"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
Unmarshal
block
(
bridge_
,
state_
,
read
(
con
,
size
,
false
));
Unmarshal
block
(
bridge_
,
state_
,
read
(
con
,
size
,
false
));
...
@@ -164,10 +158,8 @@ void Reader::readMessage(Unmarshal & unmarshal) {
...
@@ -164,10 +158,8 @@ void Reader::readMessage(Unmarshal & unmarshal) {
if
(((
flags2
&
0x40
)
!=
0
)
!=
forceSynchronous
)
{
if
(((
flags2
&
0x40
)
!=
0
)
!=
forceSynchronous
)
{
// bit 6: SYNCHRONOUS
// bit 6: SYNCHRONOUS
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"URP: request message with MUSTREPLY != SYNCHRONOUS"
"URP: request message with MUSTREPLY != SYNCHRONOUS"
" received"
))
,
" received"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
}
else
{
}
else
{
...
@@ -190,10 +182,8 @@ void Reader::readMessage(Unmarshal & unmarshal) {
...
@@ -190,10 +182,8 @@ void Reader::readMessage(Unmarshal & unmarshal) {
}
else
{
}
else
{
if
(
!
lastType_
.
is
())
{
if
(
!
lastType_
.
is
())
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"URP: request message with NEWTYPE received when last"
"URP: request message with NEWTYPE received when last"
" interface type has not yet been set"
))
,
" interface type has not yet been set"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
type
=
lastType_
;
type
=
lastType_
;
...
@@ -203,19 +193,15 @@ void Reader::readMessage(Unmarshal & unmarshal) {
...
@@ -203,19 +193,15 @@ void Reader::readMessage(Unmarshal & unmarshal) {
oid
=
unmarshal
.
readOid
();
oid
=
unmarshal
.
readOid
();
if
(
oid
.
isEmpty
())
{
if
(
oid
.
isEmpty
())
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
"binaryurp::Unmarshal: emtpy OID"
,
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: emtpy OID"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
lastOid_
=
oid
;
lastOid_
=
oid
;
}
else
{
}
else
{
if
(
lastOid_
.
isEmpty
())
{
if
(
lastOid_
.
isEmpty
())
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"URP: request message with NEWOID received when last"
"URP: request message with NEWOID received when last"
" OID has not yet been set"
))
,
" OID has not yet been set"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
oid
=
lastOid_
;
oid
=
lastOid_
;
...
@@ -225,19 +211,15 @@ void Reader::readMessage(Unmarshal & unmarshal) {
...
@@ -225,19 +211,15 @@ void Reader::readMessage(Unmarshal & unmarshal) {
type
.
makeComplete
();
type
.
makeComplete
();
if
(
type
.
get
()
->
eTypeClass
!=
typelib_TypeClass_INTERFACE
)
{
if
(
type
.
get
()
->
eTypeClass
!=
typelib_TypeClass_INTERFACE
)
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"URP: request message with non-interface interface type"
"URP: request message with non-interface interface type"
" received"
))
,
" received"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
typelib_InterfaceTypeDescription
*
itd
=
typelib_InterfaceTypeDescription
*
itd
=
reinterpret_cast
<
typelib_InterfaceTypeDescription
*
>
(
type
.
get
());
reinterpret_cast
<
typelib_InterfaceTypeDescription
*
>
(
type
.
get
());
if
(
functionId
>=
itd
->
nMapFunctionIndexToMemberIndex
)
{
if
(
functionId
>=
itd
->
nMapFunctionIndexToMemberIndex
)
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"URP: request message with unknown function ID received"
,
RTL_CONSTASCII_USTRINGPARAM
(
"URP: request message with unknown function ID received"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
sal_Int32
memberId
=
itd
->
pMapFunctionIndexToMemberIndex
[
functionId
];
sal_Int32
memberId
=
itd
->
pMapFunctionIndexToMemberIndex
[
functionId
];
...
@@ -266,10 +248,8 @@ void Reader::readMessage(Unmarshal & unmarshal) {
...
@@ -266,10 +248,8 @@ void Reader::readMessage(Unmarshal & unmarshal) {
}
else
{
}
else
{
if
(
forceSynchronous
)
{
if
(
forceSynchronous
)
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"URP: synchronous request message with non-oneway"
"URP: synchronous request message with non-oneway"
" function ID received"
))
,
" function ID received"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
synchronous
=
true
;
synchronous
=
true
;
...
@@ -322,10 +302,8 @@ void Reader::readMessage(Unmarshal & unmarshal) {
...
@@ -322,10 +302,8 @@ void Reader::readMessage(Unmarshal & unmarshal) {
break
;
break
;
default
:
default
:
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"URP: request message with UrpProtocolProperties OID"
"URP: request message with UrpProtocolProperties OID"
" and unknown function ID received"
))
,
" and unknown function ID received"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
}
else
{
}
else
{
...
@@ -355,20 +333,16 @@ void Reader::readMessage(Unmarshal & unmarshal) {
...
@@ -355,20 +333,16 @@ void Reader::readMessage(Unmarshal & unmarshal) {
css
::
uno
::
XInterface
>
>::
get
())))))
css
::
uno
::
XInterface
>
>::
get
())))))
{
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"URP: queryInterface request message with"
"URP: queryInterface request message with"
" unknown OID received"
))
,
" unknown OID received"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
}
}
break
;
break
;
case
SPECIAL_FUNCTION_ID_RESERVED
:
case
SPECIAL_FUNCTION_ID_RESERVED
:
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"URP: request message with unknown function ID 1"
"URP: request message with unknown function ID 1"
" received"
))
,
" received"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
case
SPECIAL_FUNCTION_ID_RELEASE
:
case
SPECIAL_FUNCTION_ID_RELEASE
:
break
;
break
;
...
@@ -376,9 +350,7 @@ void Reader::readMessage(Unmarshal & unmarshal) {
...
@@ -376,9 +350,7 @@ void Reader::readMessage(Unmarshal & unmarshal) {
obj
=
bridge_
->
findStub
(
oid
,
type
);
obj
=
bridge_
->
findStub
(
oid
,
type
);
if
(
!
obj
.
is
())
{
if
(
!
obj
.
is
())
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"URP: request message with unknown OID received"
,
RTL_CONSTASCII_USTRINGPARAM
(
"URP: request message with unknown OID received"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
break
;
break
;
...
@@ -457,10 +429,8 @@ void Reader::readReplyMessage(Unmarshal & unmarshal, sal_uInt8 flags1) {
...
@@ -457,10 +429,8 @@ void Reader::readReplyMessage(Unmarshal & unmarshal, sal_uInt8 flags1) {
}
}
if
(
!
ok
)
{
if
(
!
ok
)
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"URP: reply message with bad exception type"
"URP: reply message with bad exception type"
" received"
))
,
" received"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
}
}
...
@@ -532,10 +502,8 @@ rtl::ByteSequence Reader::getTid(Unmarshal & unmarshal, bool newTid) const {
...
@@ -532,10 +502,8 @@ rtl::ByteSequence Reader::getTid(Unmarshal & unmarshal, bool newTid) const {
}
}
if
(
lastTid_
.
getLength
()
==
0
)
{
if
(
lastTid_
.
getLength
()
==
0
)
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"URP: message with NEWTID received when last TID has not"
"URP: message with NEWTID received when last TID has not"
" yet been set"
))
,
" yet been set"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
return
lastTid_
;
return
lastTid_
;
...
...
binaryurp/source/unmarshal.cxx
Dosyayı görüntüle @
a60f9112
...
@@ -146,10 +146,8 @@ css::uno::TypeDescription Unmarshal::readType() {
...
@@ -146,10 +146,8 @@ css::uno::TypeDescription Unmarshal::readType() {
case
typelib_TypeClass_ANY
:
case
typelib_TypeClass_ANY
:
if
((
flags
&
0x80
)
!=
0
)
{
if
((
flags
&
0x80
)
!=
0
)
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: cache flag of simple type is"
"binaryurp::Unmarshal: cache flag of simple type is"
" set"
))
,
" set"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
return
css
::
uno
::
TypeDescription
(
return
css
::
uno
::
TypeDescription
(
...
@@ -165,10 +163,8 @@ css::uno::TypeDescription Unmarshal::readType() {
...
@@ -165,10 +163,8 @@ css::uno::TypeDescription Unmarshal::readType() {
if
((
flags
&
0x80
)
==
0
)
{
if
((
flags
&
0x80
)
==
0
)
{
if
(
idx
==
cache
::
ignore
||
!
state_
.
typeCache
[
idx
].
is
())
{
if
(
idx
==
cache
::
ignore
||
!
state_
.
typeCache
[
idx
].
is
())
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: unknown type cache"
"binaryurp::Unmarshal: unknown type cache"
" index"
))
,
" index"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
return
state_
.
typeCache
[
idx
];
return
state_
.
typeCache
[
idx
];
...
@@ -180,10 +176,8 @@ css::uno::TypeDescription Unmarshal::readType() {
...
@@ -180,10 +176,8 @@ css::uno::TypeDescription Unmarshal::readType() {
{
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: type with unknown"
"binaryurp::Unmarshal: type with unknown"
" name: "
))
+
str
,
" name: "
+
str
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
for
(
css
::
uno
::
TypeDescription
t2
(
t
);
for
(
css
::
uno
::
TypeDescription
t2
(
t
);
...
@@ -195,20 +189,16 @@ css::uno::TypeDescription Unmarshal::readType() {
...
@@ -195,20 +189,16 @@ css::uno::TypeDescription Unmarshal::readType() {
t2
.
get
())
->
pType
);
t2
.
get
())
->
pType
);
if
(
!
t2
.
is
())
{
if
(
!
t2
.
is
())
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: sequence type with"
"binaryurp::Unmarshal: sequence type with"
" unknown component type"
))
,
" unknown component type"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
switch
(
t2
.
get
()
->
eTypeClass
)
{
switch
(
t2
.
get
()
->
eTypeClass
)
{
case
typelib_TypeClass_VOID
:
case
typelib_TypeClass_VOID
:
case
typelib_TypeClass_EXCEPTION
:
case
typelib_TypeClass_EXCEPTION
:
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: sequence type with"
"binaryurp::Unmarshal: sequence type with"
" bad component type"
))
,
" bad component type"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
default
:
default
:
break
;
break
;
...
@@ -222,9 +212,7 @@ css::uno::TypeDescription Unmarshal::readType() {
...
@@ -222,9 +212,7 @@ css::uno::TypeDescription Unmarshal::readType() {
}
}
default
:
default
:
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
"binaryurp::Unmarshal: type of unknown type class"
,
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: type of unknown type class"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
}
}
...
@@ -234,10 +222,8 @@ OUString Unmarshal::readOid() {
...
@@ -234,10 +222,8 @@ OUString Unmarshal::readOid() {
for
(
sal_Int32
i
=
0
;
i
!=
oid
.
getLength
();
++
i
)
{
for
(
sal_Int32
i
=
0
;
i
!=
oid
.
getLength
();
++
i
)
{
if
(
oid
[
i
]
>
0x7F
)
{
if
(
oid
[
i
]
>
0x7F
)
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: OID contains non-ASCII"
"binaryurp::Unmarshal: OID contains non-ASCII"
" character"
))
,
" character"
,
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
}
}
...
@@ -245,9 +231,7 @@ OUString Unmarshal::readOid() {
...
@@ -245,9 +231,7 @@ OUString Unmarshal::readOid() {
if
(
oid
.
isEmpty
()
&&
idx
!=
cache
::
ignore
)
{
if
(
oid
.
isEmpty
()
&&
idx
!=
cache
::
ignore
)
{
if
(
state_
.
oidCache
[
idx
].
isEmpty
())
{
if
(
state_
.
oidCache
[
idx
].
isEmpty
())
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
"binaryurp::Unmarshal: unknown OID cache index"
,
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: unknown OID cache index"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
return
state_
.
oidCache
[
idx
];
return
state_
.
oidCache
[
idx
];
...
@@ -271,9 +255,7 @@ rtl::ByteSequence Unmarshal::readTid() {
...
@@ -271,9 +255,7 @@ rtl::ByteSequence Unmarshal::readTid() {
if
(
tid
.
getLength
()
==
0
)
{
if
(
tid
.
getLength
()
==
0
)
{
if
(
idx
==
cache
::
ignore
||
state_
.
tidCache
[
idx
].
getLength
()
==
0
)
{
if
(
idx
==
cache
::
ignore
||
state_
.
tidCache
[
idx
].
getLength
()
==
0
)
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
"binaryurp::Unmarshal: unknown TID cache index"
,
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: unknown TID cache index"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
return
state_
.
tidCache
[
idx
];
return
state_
.
tidCache
[
idx
];
...
@@ -297,9 +279,7 @@ BinaryAny Unmarshal::readValue(css::uno::TypeDescription const & type) {
...
@@ -297,9 +279,7 @@ BinaryAny Unmarshal::readValue(css::uno::TypeDescription const & type) {
sal_uInt8
v
=
read8
();
sal_uInt8
v
=
read8
();
if
(
v
>
1
)
{
if
(
v
>
1
)
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
"binaryurp::Unmarshal: boolean of unknown value"
,
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: boolean of unknown value"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
return
BinaryAny
(
type
,
&
v
);
return
BinaryAny
(
type
,
&
v
);
...
@@ -346,9 +326,7 @@ BinaryAny Unmarshal::readValue(css::uno::TypeDescription const & type) {
...
@@ -346,9 +326,7 @@ BinaryAny Unmarshal::readValue(css::uno::TypeDescription const & type) {
css
::
uno
::
TypeDescription
t
(
readType
());
css
::
uno
::
TypeDescription
t
(
readType
());
if
(
t
.
get
()
->
eTypeClass
==
typelib_TypeClass_ANY
)
{
if
(
t
.
get
()
->
eTypeClass
==
typelib_TypeClass_ANY
)
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
"binaryurp::Unmarshal: any of type ANY"
,
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: any of type ANY"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
return
readValue
(
t
);
return
readValue
(
t
);
...
@@ -371,9 +349,7 @@ BinaryAny Unmarshal::readValue(css::uno::TypeDescription const & type) {
...
@@ -371,9 +349,7 @@ BinaryAny Unmarshal::readValue(css::uno::TypeDescription const & type) {
}
}
if
(
!
found
)
{
if
(
!
found
)
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
"binaryurp::Unmarshal: unknown enum value"
,
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: unknown enum value"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
return
BinaryAny
(
type
,
&
v
);
return
BinaryAny
(
type
,
&
v
);
...
@@ -404,9 +380,7 @@ BinaryAny Unmarshal::readValue(css::uno::TypeDescription const & type) {
...
@@ -404,9 +380,7 @@ BinaryAny Unmarshal::readValue(css::uno::TypeDescription const & type) {
void
Unmarshal
::
done
()
const
{
void
Unmarshal
::
done
()
const
{
if
(
data_
!=
end_
)
{
if
(
data_
!=
end_
)
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
"binaryurp::Unmarshal: block contains excess data"
,
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: block contains excess data"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
}
}
...
@@ -414,9 +388,7 @@ void Unmarshal::done() const {
...
@@ -414,9 +388,7 @@ void Unmarshal::done() const {
void
Unmarshal
::
check
(
sal_Int32
size
)
const
{
void
Unmarshal
::
check
(
sal_Int32
size
)
const
{
if
(
end_
-
data_
<
size
)
{
if
(
end_
-
data_
<
size
)
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
"binaryurp::Unmarshal: trying to read past end of block"
,
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: trying to read past end of block"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
}
}
...
@@ -430,9 +402,7 @@ sal_uInt16 Unmarshal::readCacheIndex() {
...
@@ -430,9 +402,7 @@ sal_uInt16 Unmarshal::readCacheIndex() {
sal_uInt16
idx
=
read16
();
sal_uInt16
idx
=
read16
();
if
(
idx
>=
cache
::
size
&&
idx
!=
cache
::
ignore
)
{
if
(
idx
>=
cache
::
size
&&
idx
!=
cache
::
ignore
)
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
"binaryurp::Unmarshal: cache index out of range"
,
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: cache index out of range"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
return
idx
;
return
idx
;
...
@@ -454,9 +424,7 @@ OUString Unmarshal::readString() {
...
@@ -454,9 +424,7 @@ OUString Unmarshal::readString() {
sal_uInt32
n
=
readCompressed
();
sal_uInt32
n
=
readCompressed
();
if
(
n
>
SAL_MAX_INT32
)
{
if
(
n
>
SAL_MAX_INT32
)
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"binaryurp::Unmarshal: string size too large"
,
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: string size too large"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
check
(
static_cast
<
sal_Int32
>
(
n
));
check
(
static_cast
<
sal_Int32
>
(
n
));
...
@@ -469,9 +437,7 @@ OUString Unmarshal::readString() {
...
@@ -469,9 +437,7 @@ OUString Unmarshal::readString() {
RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
)))
RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
)))
{
{
throw
css
::
io
::
IOException
(
throw
css
::
io
::
IOException
(
OUString
(
"binaryurp::Unmarshal: string does not contain UTF-8"
,
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: string does not contain UTF-8"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
data_
+=
n
;
data_
+=
n
;
...
@@ -483,9 +449,7 @@ BinaryAny Unmarshal::readSequence(css::uno::TypeDescription const & type) {
...
@@ -483,9 +449,7 @@ BinaryAny Unmarshal::readSequence(css::uno::TypeDescription const & type) {
sal_uInt32
n
=
readCompressed
();
sal_uInt32
n
=
readCompressed
();
if
(
n
>
SAL_MAX_INT32
)
{
if
(
n
>
SAL_MAX_INT32
)
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"binaryurp::Unmarshal: sequence size too large"
,
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: sequence size too large"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
if
(
n
==
0
)
{
if
(
n
==
0
)
{
...
@@ -513,9 +477,7 @@ BinaryAny Unmarshal::readSequence(css::uno::TypeDescription const & type) {
...
@@ -513,9 +477,7 @@ BinaryAny Unmarshal::readSequence(css::uno::TypeDescription const & type) {
// sal_uInt32 * sal_Int32 -> sal_uInt64 cannot overflow
// sal_uInt32 * sal_Int32 -> sal_uInt64 cannot overflow
if
(
size
>
SAL_MAX_SIZE
-
SAL_SEQUENCE_HEADER_SIZE
)
{
if
(
size
>
SAL_MAX_SIZE
-
SAL_SEQUENCE_HEADER_SIZE
)
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"binaryurp::Unmarshal: sequence size too large"
,
RTL_CONSTASCII_USTRINGPARAM
(
"binaryurp::Unmarshal: sequence size too large"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
void
*
buf
=
allocate
(
void
*
buf
=
allocate
(
...
...
binaryurp/source/writer.cxx
Dosyayı görüntüle @
a60f9112
...
@@ -163,10 +163,8 @@ void Writer::execute() {
...
@@ -163,10 +163,8 @@ void Writer::execute() {
(
item
.
oid
!=
"UrpProtocolProperties"
&&
(
item
.
oid
!=
"UrpProtocolProperties"
&&
!
item
.
member
.
equals
(
!
item
.
member
.
equals
(
css
::
uno
::
TypeDescription
(
css
::
uno
::
TypeDescription
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"com.sun.star.uno.XInterface::"
"com.sun.star.uno.XInterface::"
"release"
))
))
&&
"release"
))
&&
bridge_
->
isCurrentContextMode
()),
bridge_
->
isCurrentContextMode
()),
item
.
currentContext
);
item
.
currentContext
);
}
else
{
}
else
{
...
@@ -241,8 +239,7 @@ void Writer::sendRequest(
...
@@ -241,8 +239,7 @@ void Writer::sendRequest(
OSL_ASSERT
(
functionId
>=
0
);
OSL_ASSERT
(
functionId
>=
0
);
if
(
functionId
>
SAL_MAX_UINT16
)
{
if
(
functionId
>
SAL_MAX_UINT16
)
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"function ID too large for URP"
,
RTL_CONSTASCII_USTRINGPARAM
(
"function ID too large for URP"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
std
::
vector
<
unsigned
char
>
buf
;
std
::
vector
<
unsigned
char
>
buf
;
...
@@ -409,8 +406,7 @@ void Writer::sendMessage(std::vector< unsigned char > const & buffer) {
...
@@ -409,8 +406,7 @@ void Writer::sendMessage(std::vector< unsigned char > const & buffer) {
std
::
vector
<
unsigned
char
>
header
;
std
::
vector
<
unsigned
char
>
header
;
if
(
buffer
.
size
()
>
SAL_MAX_UINT32
)
{
if
(
buffer
.
size
()
>
SAL_MAX_UINT32
)
{
throw
css
::
uno
::
RuntimeException
(
throw
css
::
uno
::
RuntimeException
(
OUString
(
"message too large for URP"
,
RTL_CONSTASCII_USTRINGPARAM
(
"message too large for URP"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
}
Marshal
::
write32
(
&
header
,
static_cast
<
sal_uInt32
>
(
buffer
.
size
()));
Marshal
::
write32
(
&
header
,
static_cast
<
sal_uInt32
>
(
buffer
.
size
()));
...
@@ -435,9 +431,7 @@ void Writer::sendMessage(std::vector< unsigned char > const & buffer) {
...
@@ -435,9 +431,7 @@ void Writer::sendMessage(std::vector< unsigned char > const & buffer) {
}
catch
(
const
css
::
io
::
IOException
&
e
)
{
}
catch
(
const
css
::
io
::
IOException
&
e
)
{
css
::
uno
::
Any
exc
(
cppu
::
getCaughtException
());
css
::
uno
::
Any
exc
(
cppu
::
getCaughtException
());
throw
css
::
lang
::
WrappedTargetRuntimeException
(
throw
css
::
lang
::
WrappedTargetRuntimeException
(
(
OUString
(
(
"Binary URP write raised IO exception: "
+
RTL_CONSTASCII_USTRINGPARAM
(
"Binary URP write raised IO exception: "
))
+
e
.
Message
),
e
.
Message
),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
(),
exc
);
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
(),
exc
);
}
}
...
...
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