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
d2f6f863
Kaydet (Commit)
d2f6f863
authored
Ock 04, 2016
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:stringconstant
Change-Id: I08430479a2c8d1fd6e3fc357ba3069b3a7bb6ac8
üst
eb760663
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
133 additions
and
146 deletions
+133
-146
unoevent.hxx
include/svtools/unoevent.hxx
+0
-13
unoevent.cxx
svtools/source/uno/unoevent.cxx
+133
-133
No files found.
include/svtools/unoevent.hxx
Dosyayı görüntüle @
d2f6f863
...
...
@@ -150,19 +150,6 @@ protected:
/// get the event ID for the name; return 0 if not supported
sal_uInt16
getMacroID
(
const
OUString
&
rName
)
const
;
/// create PropertyValues and Any from macro
void
getAnyFromMacro
(
css
::
uno
::
Any
&
aAny
,
// Any to be filled by Macro values
const
SvxMacro
&
rMacro
);
/// create macro from PropertyValues (in an Any)
void
getMacroFromAny
(
SvxMacro
&
aMacro
,
// reference to be filled by Any
const
css
::
uno
::
Any
&
rAny
)
throw
(
css
::
lang
::
IllegalArgumentException
);
};
...
...
svtools/source/uno/unoevent.cxx
Dosyayı görüntüle @
d2f6f863
...
...
@@ -45,138 +45,9 @@ static const char sJavaScript[] = "JavaScript";
static
const
char
sScript
[]
=
"Script"
;
static
const
char
sNone
[]
=
"None"
;
namespace
{
SvBaseEventDescriptor
::
SvBaseEventDescriptor
(
const
SvEventDescription
*
pSupportedMacroItems
)
:
mpSupportedMacroItems
(
pSupportedMacroItems
),
mnMacroItems
(
0
)
{
assert
(
pSupportedMacroItems
!=
nullptr
&&
"Need a list of supported events!"
);
for
(
;
mpSupportedMacroItems
[
mnMacroItems
].
mnEvent
!=
0
;
mnMacroItems
++
)
;
}
SvBaseEventDescriptor
::~
SvBaseEventDescriptor
()
{
}
void
SvBaseEventDescriptor
::
replaceByName
(
const
OUString
&
rName
,
const
Any
&
rElement
)
throw
(
IllegalArgumentException
,
NoSuchElementException
,
WrappedTargetException
,
RuntimeException
,
std
::
exception
)
{
sal_uInt16
nMacroID
=
getMacroID
(
rName
);
// error checking
if
(
0
==
nMacroID
)
throw
NoSuchElementException
();
if
(
rElement
.
getValueType
()
!=
getElementType
())
throw
IllegalArgumentException
();
// get sequence
Sequence
<
PropertyValue
>
aSequence
;
rElement
>>=
aSequence
;
// perform replace (in subclass)
SvxMacro
aMacro
(
""
,
""
);
getMacroFromAny
(
aMacro
,
rElement
);
replaceByName
(
nMacroID
,
aMacro
);
}
Any
SvBaseEventDescriptor
::
getByName
(
const
OUString
&
rName
)
throw
(
NoSuchElementException
,
WrappedTargetException
,
RuntimeException
,
std
::
exception
)
{
sal_uInt16
nMacroID
=
getMacroID
(
rName
);
// error checking
if
(
0
==
nMacroID
)
throw
NoSuchElementException
();
// perform get (in subclass)
Any
aAny
;
SvxMacro
aMacro
(
""
,
""
);
getByName
(
aMacro
,
nMacroID
);
getAnyFromMacro
(
aAny
,
aMacro
);
return
aAny
;
}
Sequence
<
OUString
>
SvBaseEventDescriptor
::
getElementNames
()
throw
(
RuntimeException
,
std
::
exception
)
{
// create and fill sequence
Sequence
<
OUString
>
aSequence
(
mnMacroItems
);
for
(
sal_Int16
i
=
0
;
i
<
mnMacroItems
;
i
++
)
{
aSequence
[
i
]
=
OUString
::
createFromAscii
(
mpSupportedMacroItems
[
i
].
mpEventName
);
}
return
aSequence
;
}
sal_Bool
SvBaseEventDescriptor
::
hasByName
(
const
OUString
&
rName
)
throw
(
RuntimeException
,
std
::
exception
)
{
sal_uInt16
nMacroID
=
getMacroID
(
rName
);
return
(
nMacroID
!=
0
);
}
Type
SvBaseEventDescriptor
::
getElementType
()
throw
(
RuntimeException
,
std
::
exception
)
{
return
cppu
::
UnoType
<
Sequence
<
PropertyValue
>>::
get
();
}
sal_Bool
SvBaseEventDescriptor
::
hasElements
()
throw
(
RuntimeException
,
std
::
exception
)
{
return
mnMacroItems
!=
0
;
}
sal_Bool
SvBaseEventDescriptor
::
supportsService
(
const
OUString
&
rServiceName
)
throw
(
RuntimeException
,
std
::
exception
)
{
return
cppu
::
supportsService
(
this
,
rServiceName
);
}
Sequence
<
OUString
>
SvBaseEventDescriptor
::
getSupportedServiceNames
()
throw
(
RuntimeException
,
std
::
exception
)
{
Sequence
<
OUString
>
aSequence
{
sAPI_ServiceName
};
return
aSequence
;
}
sal_uInt16
SvBaseEventDescriptor
::
mapNameToEventID
(
const
OUString
&
rName
)
const
{
// iterate over known event names
for
(
sal_Int16
i
=
0
;
i
<
mnMacroItems
;
i
++
)
{
if
(
rName
.
equalsAscii
(
mpSupportedMacroItems
[
i
].
mpEventName
))
{
return
mpSupportedMacroItems
[
i
].
mnEvent
;
}
}
// not found -> return zero
return
0
;
}
sal_uInt16
SvBaseEventDescriptor
::
getMacroID
(
const
OUString
&
rName
)
const
{
return
mapNameToEventID
(
rName
);
}
void
SvBaseEventDescriptor
::
getAnyFromMacro
(
Any
&
rAny
,
const
SvxMacro
&
rMacro
)
void
getAnyFromMacro
(
Any
&
rAny
,
const
SvxMacro
&
rMacro
)
{
bool
bRetValueOK
=
false
;
// do we have a ret value?
...
...
@@ -266,8 +137,7 @@ void SvBaseEventDescriptor::getAnyFromMacro(Any& rAny,
}
}
void
SvBaseEventDescriptor
::
getMacroFromAny
(
void
getMacroFromAny
(
SvxMacro
&
rMacro
,
const
Any
&
rAny
)
throw
(
IllegalArgumentException
)
...
...
@@ -363,6 +233,136 @@ void SvBaseEventDescriptor::getMacroFromAny(
}
}
}
SvBaseEventDescriptor
::
SvBaseEventDescriptor
(
const
SvEventDescription
*
pSupportedMacroItems
)
:
mpSupportedMacroItems
(
pSupportedMacroItems
),
mnMacroItems
(
0
)
{
assert
(
pSupportedMacroItems
!=
nullptr
&&
"Need a list of supported events!"
);
for
(
;
mpSupportedMacroItems
[
mnMacroItems
].
mnEvent
!=
0
;
mnMacroItems
++
)
;
}
SvBaseEventDescriptor
::~
SvBaseEventDescriptor
()
{
}
void
SvBaseEventDescriptor
::
replaceByName
(
const
OUString
&
rName
,
const
Any
&
rElement
)
throw
(
IllegalArgumentException
,
NoSuchElementException
,
WrappedTargetException
,
RuntimeException
,
std
::
exception
)
{
sal_uInt16
nMacroID
=
getMacroID
(
rName
);
// error checking
if
(
0
==
nMacroID
)
throw
NoSuchElementException
();
if
(
rElement
.
getValueType
()
!=
getElementType
())
throw
IllegalArgumentException
();
// get sequence
Sequence
<
PropertyValue
>
aSequence
;
rElement
>>=
aSequence
;
// perform replace (in subclass)
SvxMacro
aMacro
(
""
,
""
);
getMacroFromAny
(
aMacro
,
rElement
);
replaceByName
(
nMacroID
,
aMacro
);
}
Any
SvBaseEventDescriptor
::
getByName
(
const
OUString
&
rName
)
throw
(
NoSuchElementException
,
WrappedTargetException
,
RuntimeException
,
std
::
exception
)
{
sal_uInt16
nMacroID
=
getMacroID
(
rName
);
// error checking
if
(
0
==
nMacroID
)
throw
NoSuchElementException
();
// perform get (in subclass)
Any
aAny
;
SvxMacro
aMacro
(
""
,
""
);
getByName
(
aMacro
,
nMacroID
);
getAnyFromMacro
(
aAny
,
aMacro
);
return
aAny
;
}
Sequence
<
OUString
>
SvBaseEventDescriptor
::
getElementNames
()
throw
(
RuntimeException
,
std
::
exception
)
{
// create and fill sequence
Sequence
<
OUString
>
aSequence
(
mnMacroItems
);
for
(
sal_Int16
i
=
0
;
i
<
mnMacroItems
;
i
++
)
{
aSequence
[
i
]
=
OUString
::
createFromAscii
(
mpSupportedMacroItems
[
i
].
mpEventName
);
}
return
aSequence
;
}
sal_Bool
SvBaseEventDescriptor
::
hasByName
(
const
OUString
&
rName
)
throw
(
RuntimeException
,
std
::
exception
)
{
sal_uInt16
nMacroID
=
getMacroID
(
rName
);
return
(
nMacroID
!=
0
);
}
Type
SvBaseEventDescriptor
::
getElementType
()
throw
(
RuntimeException
,
std
::
exception
)
{
return
cppu
::
UnoType
<
Sequence
<
PropertyValue
>>::
get
();
}
sal_Bool
SvBaseEventDescriptor
::
hasElements
()
throw
(
RuntimeException
,
std
::
exception
)
{
return
mnMacroItems
!=
0
;
}
sal_Bool
SvBaseEventDescriptor
::
supportsService
(
const
OUString
&
rServiceName
)
throw
(
RuntimeException
,
std
::
exception
)
{
return
cppu
::
supportsService
(
this
,
rServiceName
);
}
Sequence
<
OUString
>
SvBaseEventDescriptor
::
getSupportedServiceNames
()
throw
(
RuntimeException
,
std
::
exception
)
{
Sequence
<
OUString
>
aSequence
{
sAPI_ServiceName
};
return
aSequence
;
}
sal_uInt16
SvBaseEventDescriptor
::
mapNameToEventID
(
const
OUString
&
rName
)
const
{
// iterate over known event names
for
(
sal_Int16
i
=
0
;
i
<
mnMacroItems
;
i
++
)
{
if
(
rName
.
equalsAscii
(
mpSupportedMacroItems
[
i
].
mpEventName
))
{
return
mpSupportedMacroItems
[
i
].
mnEvent
;
}
}
// not found -> return zero
return
0
;
}
sal_uInt16
SvBaseEventDescriptor
::
getMacroID
(
const
OUString
&
rName
)
const
{
return
mapNameToEventID
(
rName
);
}
SvEventDescriptor
::
SvEventDescriptor
(
XInterface
&
rParent
,
...
...
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