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
4fe2c8f9
Kaydet (Commit)
4fe2c8f9
authored
Eyl 10, 2003
tarafından
Noel Power
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#i12906#
Updates from code inspection
üst
de11ba9e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
70 deletions
+51
-70
ActiveMSPList.cxx
scripting/source/provider/ActiveMSPList.cxx
+0
-0
ActiveMSPList.hxx
scripting/source/provider/ActiveMSPList.hxx
+9
-7
MasterScriptProvider.cxx
scripting/source/provider/MasterScriptProvider.cxx
+18
-48
MasterScriptProvider.hxx
scripting/source/provider/MasterScriptProvider.hxx
+24
-15
No files found.
scripting/source/provider/ActiveMSPList.cxx
Dosyayı görüntüle @
4fe2c8f9
This diff is collapsed.
Click to expand it.
scripting/source/provider/ActiveMSPList.hxx
Dosyayı görüntüle @
4fe2c8f9
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
*
*
* $RCSfile: ActiveMSPList.hxx,v $
* $RCSfile: ActiveMSPList.hxx,v $
*
*
* $Revision: 1.
1
$
* $Revision: 1.
2
$
*
*
* last change: $Author: npower $ $Date: 2003-09-
04 07:23:12
$
* last change: $Author: npower $ $Date: 2003-09-
10 08:08:14
$
*
*
* The Contents of this file are made available subject to the terms of
* The Contents of this file are made available subject to the terms of
* either of the following licenses
* either of the following licenses
...
@@ -87,19 +87,21 @@ namespace func_provider
...
@@ -87,19 +87,21 @@ namespace func_provider
//Typedefs
//Typedefs
//=============================================================================
//=============================================================================
typedef
::
std
::
hash_map
<
::
rtl
::
OUString
,
css
::
uno
::
Reference
<
dcsssf
::
provider
::
XScriptProvider
>
,
::
rtl
::
OUStringHash
,
::
std
::
equal_to
<
::
rtl
::
OUString
>
>
Msp_hash
;
struct
MspInst
struct
MspInst
{
{
css
::
uno
::
Reference
<
dcsssf
::
provider
::
XScriptProvider
>
provider
;
css
::
uno
::
Reference
<
dcsssf
::
provider
::
XScriptProvider
>
provider
;
::
rtl
::
OUString
docNam
e
;
css
::
uno
::
Reference
<
dcsssf
::
browse
::
XBrowseNode
>
nod
e
;
};
};
typedef
::
std
::
map
<
css
::
uno
::
Reference
<
css
::
frame
::
XModel
>
,
typedef
::
std
::
map
<
css
::
uno
::
Reference
<
css
::
frame
::
XModel
>
,
MspInst
>
Model_map
;
MspInst
>
Model_map
;
typedef
::
std
::
hash_map
<
::
rtl
::
OUString
,
MspInst
,
::
rtl
::
OUStringHash
,
::
std
::
equal_to
<
::
rtl
::
OUString
>
>
Msp_hash
;
class
ActiveMSPList
:
public
::
cppu
::
WeakImplHelper2
<
css
::
lang
::
XEventListener
,
dcsssf
::
browse
::
XBrowseNode
>
class
ActiveMSPList
:
public
::
cppu
::
WeakImplHelper2
<
css
::
lang
::
XEventListener
,
dcsssf
::
browse
::
XBrowseNode
>
{
{
...
...
scripting/source/provider/MasterScriptProvider.cxx
Dosyayı görüntüle @
4fe2c8f9
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
*
*
* $RCSfile: MasterScriptProvider.cxx,v $
* $RCSfile: MasterScriptProvider.cxx,v $
*
*
* $Revision: 1.
3
$
* $Revision: 1.
4
$
*
*
* last change: $Author: npower $ $Date: 2003-09-
04 07:24:47
$
* last change: $Author: npower $ $Date: 2003-09-
10 08:08:14
$
*
*
* The Contents of this file are made available subject to the terms of
* The Contents of this file are made available subject to the terms of
* either of the following licenses
* either of the following licenses
...
@@ -98,7 +98,7 @@ Sequence< ::rtl::OUString > s_serviceNames = Sequence <
...
@@ -98,7 +98,7 @@ Sequence< ::rtl::OUString > s_serviceNames = Sequence <
//
//
//*************************************************************************
//*************************************************************************
MasterScriptProvider
::
MasterScriptProvider
(
const
Reference
<
XComponentContext
>
&
xContext
)
throw
(
RuntimeException
)
:
MasterScriptProvider
::
MasterScriptProvider
(
const
Reference
<
XComponentContext
>
&
xContext
)
throw
(
RuntimeException
)
:
m_xContext
(
xContext
),
m_bI
nitialised
(
false
),
m_bIsVali
d
(
false
),
m_xContext
(
xContext
),
m_bI
sValid
(
false
),
m_bInitialise
d
(
false
),
m_pPCache
(
0
)
m_pPCache
(
0
)
{
{
OSL_TRACE
(
"< MasterScriptProvider ctor called >
\n
"
);
OSL_TRACE
(
"< MasterScriptProvider ctor called >
\n
"
);
...
@@ -135,7 +135,13 @@ MasterScriptProvider::MasterScriptProvider( const Reference< XComponentContext >
...
@@ -135,7 +135,13 @@ MasterScriptProvider::MasterScriptProvider( const Reference< XComponentContext >
throw
RuntimeException
(
temp
.
concat
(
e
.
Message
),
Reference
<
XInterface
>
()
);
throw
RuntimeException
(
temp
.
concat
(
e
.
Message
),
Reference
<
XInterface
>
()
);
}
}
//Sequence< ::rtl::OUString >& providers = getProviderNames();
// Set up contextless cache
// if initialise method is called a new ProviderCache will be
// created with the appropriate context supplied as an argument
Sequence
<
Any
>
invokeArgs
(
1
);
invokeArgs
[
0
]
<<=
m_XScriptingContext
;
m_pPCache
=
new
ProviderCache
(
m_xContext
,
invokeArgs
);
m_bIsValid
=
true
;
m_bIsValid
=
true
;
}
}
...
@@ -165,6 +171,7 @@ throw ( Exception, RuntimeException )
...
@@ -165,6 +171,7 @@ throw ( Exception, RuntimeException )
m_bIsValid
=
false
;
m_bIsValid
=
false
;
// related to issue 11866
// related to issue 11866
// warning dialog gets launched when adding binding to script in doc
// warning dialog gets launched when adding binding to script in doc
// workaround issue: no functionProvider created on doc open
// workaround issue: no functionProvider created on doc open
...
@@ -339,12 +346,15 @@ throw ( Exception, RuntimeException )
...
@@ -339,12 +346,15 @@ throw ( Exception, RuntimeException )
//invokeArgs[ 0 ] <<= m_XScriptingContext;
//invokeArgs[ 0 ] <<= m_XScriptingContext;
invokeArgs
=
Sequence
<
Any
>
(
0
);
// no arguments
invokeArgs
=
Sequence
<
Any
>
(
0
);
// no arguments
}
}
// should be initialised from ctor ( in case createInstance called
//
should be zero, if not initialised, put assert here
//
instead of createInsanceWithArgs.... )
if
(
m_pPCache
=
=
0
)
if
(
m_pPCache
!
=
0
)
{
{
m_pPCache
=
new
ProviderCache
(
m_xContext
,
invokeArgs
);
OSL_TRACE
(
"** MSP init, creating provider cache"
);
delete
m_pPCache
;
}
}
m_pPCache
=
new
ProviderCache
(
m_xContext
,
invokeArgs
);
if
(
m_xModel
.
is
()
)
if
(
m_xModel
.
is
()
)
{
{
// This MSP created from a document, add to ActiveMSPList
// This MSP created from a document, add to ActiveMSPList
...
@@ -496,46 +506,6 @@ MasterScriptProvider::getLanguageFromURI( const ::rtl::OUString& scriptURI )
...
@@ -496,46 +506,6 @@ MasterScriptProvider::getLanguageFromURI( const ::rtl::OUString& scriptURI )
//*************************************************************************
//*************************************************************************
Reference
<
provider
::
XScriptProvider
>
MasterScriptProvider
::
getScriptProvider
(
const
::
rtl
::
OUString
&
language
,
const
Sequence
<
Any
>&
aArgs
)
throw
(
RuntimeException
)
{
Reference
<
provider
::
XScriptProvider
>
xScriptProvider
;
try
{
// need to attempt to get the runtime service (not singleton) for the lang
::
rtl
::
OUStringBuffer
buf
(
80
);
buf
.
appendAscii
(
"drafts.com.sun.star.script.framework.provider.ScriptProviderFor"
);
buf
.
append
(
language
);
::
rtl
::
OUString
serviceName
=
buf
.
makeStringAndClear
();
OSL_TRACE
(
"Service name is %s"
,
::
rtl
::
OUStringToOString
(
serviceName
,
RTL_TEXTENCODING_ASCII_US
).
pData
->
buffer
);
Reference
<
XInterface
>
xInterface
=
m_xMgr
->
createInstanceWithArgumentsAndContext
(
serviceName
,
aArgs
,
m_xContext
);
// need to get the XScriptProvider interface from the service
validateXRef
(
xInterface
,
"MasterScriptProvider::getScriptProvider: cannot get appropriate language ScriptProvider Service"
);
xScriptProvider
=
Reference
<
provider
::
XScriptProvider
>
(
xInterface
,
UNO_QUERY_THROW
);
validateXRef
(
xScriptProvider
,
"Service doesn't support XScriptProvider interface"
);
}
catch
(
RuntimeException
&
e
)
{
::
rtl
::
OUString
temp
=
OUSTR
(
"MasterScriptProvider::getScriptProvider: can't get ScriptProvider for "
);
temp
.
concat
(
language
);
temp
.
concat
(
OUSTR
(
" :"
)
);
throw
RuntimeException
(
temp
.
concat
(
e
.
Message
),
Reference
<
XInterface
>
()
);
}
return
xScriptProvider
;
}
::
rtl
::
OUString
SAL_CALL
::
rtl
::
OUString
SAL_CALL
MasterScriptProvider
::
getName
()
MasterScriptProvider
::
getName
()
throw
(
css
::
uno
::
RuntimeException
)
throw
(
css
::
uno
::
RuntimeException
)
...
...
scripting/source/provider/MasterScriptProvider.hxx
Dosyayı görüntüle @
4fe2c8f9
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
*
*
* $RCSfile: MasterScriptProvider.hxx,v $
* $RCSfile: MasterScriptProvider.hxx,v $
*
*
* $Revision: 1.
3
$
* $Revision: 1.
4
$
*
*
* last change: $Author: npower $ $Date: 2003-09-
04 07:24:47
$
* last change: $Author: npower $ $Date: 2003-09-
10 08:08:14
$
*
*
* The Contents of this file are made available subject to the terms of
* The Contents of this file are made available subject to the terms of
* either of the following licenses
* either of the following licenses
...
@@ -63,13 +63,12 @@
...
@@ -63,13 +63,12 @@
#define _FRAMEWORK_SCRIPT_PROVIDER_XFUNCTIONPROVIDER_HXX_
#define _FRAMEWORK_SCRIPT_PROVIDER_XFUNCTIONPROVIDER_HXX_
#include <rtl/ustring>
#include <rtl/ustring>
#include <cppuhelper/implbase
5
.hxx>
#include <cppuhelper/implbase
4
.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <drafts/com/sun/star/script/framework/provider/XScriptProvider.hpp>
#include <drafts/com/sun/star/script/framework/provider/XScriptProvider.hpp>
#include <drafts/com/sun/star/script/framework/provider/XScriptProviderAccess.hpp>
#include <drafts/com/sun/star/script/framework/runtime/XScriptInvocation.hpp>
#include <drafts/com/sun/star/script/framework/runtime/XScriptInvocation.hpp>
#include <drafts/com/sun/star/script/framework/storage/XScriptStorageManager.hpp>
#include <drafts/com/sun/star/script/framework/storage/XScriptStorageManager.hpp>
#include <drafts/com/sun/star/script/framework/browse/XBrowseNode.hpp>
#include <drafts/com/sun/star/script/framework/browse/XBrowseNode.hpp>
...
@@ -83,9 +82,9 @@ namespace func_provider
...
@@ -83,9 +82,9 @@ namespace func_provider
#define dcsssf ::drafts::com::sun::star::script::framework
#define dcsssf ::drafts::com::sun::star::script::framework
class
MasterScriptProvider
:
class
MasterScriptProvider
:
public
::
cppu
::
WeakImplHelper
5
<
dcsssf
::
provider
::
XScriptProvider
,
public
::
cppu
::
WeakImplHelper
4
<
dcsssf
::
provider
::
XScriptProvider
,
dcsssf
::
browse
::
XBrowseNode
,
dcsssf
::
provider
::
XScriptProviderAccess
,
dcsssf
::
browse
::
XBrowseNode
,
css
::
lang
::
XServiceInfo
,
css
::
lang
::
X
ServiceInfo
,
css
::
lang
::
X
Initialization
>
css
::
lang
::
XInitialization
>
{
{
public
:
public
:
MasterScriptProvider
(
MasterScriptProvider
(
...
@@ -107,9 +106,7 @@ public:
...
@@ -107,9 +106,7 @@ public:
virtual
sal_Int16
SAL_CALL
getType
()
virtual
sal_Int16
SAL_CALL
getType
()
throw
(
css
::
uno
::
RuntimeException
);
throw
(
css
::
uno
::
RuntimeException
);
// XBrowseNode implementation
virtual
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
dcsssf
::
provider
::
XScriptProvider
>
>
SAL_CALL
getAllProviders
()
throw
(
css
::
uno
::
RuntimeException
);
virtual
sal_Bool
SAL_CALL
supportsService
(
const
::
rtl
::
OUString
&
ServiceName
)
virtual
sal_Bool
SAL_CALL
supportsService
(
const
::
rtl
::
OUString
&
ServiceName
)
throw
(
css
::
uno
::
RuntimeException
);
throw
(
css
::
uno
::
RuntimeException
);
virtual
css
::
uno
::
Sequence
<
::
rtl
::
OUString
>
SAL_CALL
getSupportedServiceNames
(
)
virtual
css
::
uno
::
Sequence
<
::
rtl
::
OUString
>
SAL_CALL
getSupportedServiceNames
(
)
...
@@ -128,22 +125,34 @@ public:
...
@@ -128,22 +125,34 @@ public:
*/
*/
virtual
void
SAL_CALL
initialize
(
const
css
::
uno
::
Sequence
<
css
::
uno
::
Any
>
&
args
)
virtual
void
SAL_CALL
initialize
(
const
css
::
uno
::
Sequence
<
css
::
uno
::
Any
>
&
args
)
throw
(
css
::
uno
::
Exception
,
css
::
uno
::
RuntimeException
);
throw
(
css
::
uno
::
Exception
,
css
::
uno
::
RuntimeException
);
// Public method to return all Language Providers in this MasterScriptProviders
// context.
css
::
uno
::
Sequence
<
css
::
uno
::
Reference
<
dcsssf
::
provider
::
XScriptProvider
>
>
SAL_CALL
getAllProviders
()
throw
(
css
::
uno
::
RuntimeException
);
private
:
private
:
void
addStorageAsListener
()
throw
(
css
::
uno
::
RuntimeException
);
void
addStorageAsListener
()
throw
(
css
::
uno
::
RuntimeException
);
bool
isValid
();
bool
isValid
();
const
css
::
uno
::
Sequence
<
::
rtl
::
OUString
>&
getProviderNames
();
const
css
::
uno
::
Sequence
<
::
rtl
::
OUString
>&
getProviderNames
();
::
rtl
::
OUString
getLanguageFromURI
(
const
::
rtl
::
OUString
&
scriptURI
);
::
rtl
::
OUString
getLanguageFromURI
(
const
::
rtl
::
OUString
&
scriptURI
);
css
::
uno
::
Reference
<
dcsssf
::
provider
::
XScriptProvider
>
getScriptProvider
(
const
::
rtl
::
OUString
&
language
,
const
css
::
uno
::
Sequence
<
css
::
uno
::
Any
>&
args
)
throw
(
css
::
uno
::
RuntimeException
);
/* to obtain other services if needed */
/* to obtain other services if needed */
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
m_xContext
;
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
m_xContext
;
css
::
uno
::
Reference
<
css
::
lang
::
XMultiComponentFactory
>
m_xMgr
;
css
::
uno
::
Reference
<
css
::
lang
::
XMultiComponentFactory
>
m_xMgr
;
css
::
uno
::
Reference
<
css
::
frame
::
XModel
>
m_xModel
;
css
::
uno
::
Reference
<
css
::
frame
::
XModel
>
m_xModel
;
css
::
uno
::
Reference
<
dcsssf
::
storage
::
XScriptStorageManager
>
m_xScriptStorageMgr
;
css
::
uno
::
Reference
<
dcsssf
::
storage
::
XScriptStorageManager
>
m_xScriptStorageMgr
;
bool
m_bInitialised
;
// This component supports XInitialization, it can be created
// using createInstanceXXX() or createInstanceWithArgumentsXXX using
// the service Mangager.
// Need to detect proper initialisation and validity
// for the object, so m_bIsValid indicates that the object is valid is set in ctor
// in case of createInstanceWithArgumentsXXX() called m_bIsValid is set to reset
// and then set to true when initialisation is complete
bool
m_bIsValid
;
bool
m_bIsValid
;
// m_bInitialised ensure initialisation only takes place once.
bool
m_bInitialised
;
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySet
>
m_XScriptingContext
;
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySet
>
m_XScriptingContext
;
ProviderCache
*
m_pPCache
;
ProviderCache
*
m_pPCache
;
osl
::
Mutex
m_mutex
;
osl
::
Mutex
m_mutex
;
...
...
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