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
6f0b59e3
Kaydet (Commit)
6f0b59e3
authored
Nis 25, 2013
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#46808, Convert some XMultiServiceFactory to XComponentContext
Change-Id: If7cc52ffeb35efe0969876a9822106b1fd958b10
üst
19a1d238
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
67 deletions
+45
-67
pptinanimations.cxx
sd/source/filter/ppt/pptinanimations.cxx
+5
-10
sdxmlwrp.cxx
sd/source/filter/xml/sdxmlwrp.cxx
+13
-24
ModuleController.cxx
sd/source/ui/framework/module/ModuleController.cxx
+27
-30
slideshowviewimpl.cxx
sd/source/ui/slideshow/slideshowviewimpl.cxx
+0
-3
No files found.
sd/source/filter/ppt/pptinanimations.cxx
Dosyayı görüntüle @
6f0b59e3
...
...
@@ -66,19 +66,12 @@
#include <algorithm>
using
::
std
::
map
;
using
::
com
::
sun
::
star
::
uno
::
Any
;
using
::
com
::
sun
::
star
::
uno
::
Reference
;
using
::
com
::
sun
::
star
::
uno
::
UNO_QUERY
;
using
::
com
::
sun
::
star
::
uno
::
UNO_QUERY_THROW
;
using
::
com
::
sun
::
star
::
uno
::
Sequence
;
using
::
com
::
sun
::
star
::
uno
::
makeAny
;
using
::
com
::
sun
::
star
::
uno
::
Exception
;
using
::
com
::
sun
::
star
::
uno
::
XInterface
;
using
::
com
::
sun
::
star
::
beans
::
NamedValue
;
using
::
com
::
sun
::
star
::
container
::
XEnumerationAccess
;
using
::
com
::
sun
::
star
::
container
::
XEnumeration
;
using
::
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
drawing
;
using
namespace
::
com
::
sun
::
star
::
animations
;
using
namespace
::
com
::
sun
::
star
::
presentation
;
...
...
@@ -328,8 +321,9 @@ Reference< XAnimationNode > AnimationImporter::createNode( const Atom* pAtom, co
Reference
<
XAnimationNode
>
xNode
;
if
(
pServiceName
)
{
Reference
<
XComponentContext
>
xContext
=
::
comphelper
::
getProcessComponentContext
();
const
OUString
aServiceName
(
OUString
::
createFromAscii
(
pServiceName
)
);
Reference
<
XInterface
>
xFac
(
::
comphelper
::
getProcessServiceFactory
()
->
createInstance
(
aServiceName
)
);
Reference
<
XInterface
>
xFac
(
xContext
->
getServiceManager
()
->
createInstanceWithContext
(
aServiceName
,
xContext
)
);
xNode
.
set
(
xFac
,
UNO_QUERY
);
}
...
...
@@ -1424,8 +1418,9 @@ int AnimationImporter::importTimeContainer( const Atom* pAtom, const Reference<
{
if
(
pChildAtom
->
hasChildAtom
(
DFF_msofbtAnimCommand
)
)
{
Reference
<
XComponentContext
>
xContext
=
::
comphelper
::
getProcessComponentContext
();
const
OUString
aServiceName
(
"com.sun.star.animations.Command"
);
Reference
<
XAnimationNode
>
xChildNode
(
::
comphelper
::
getProcessServiceFactory
()
->
createInstance
(
aServiceName
),
UNO_QUERY
);
Reference
<
XAnimationNode
>
xChildNode
(
xContext
->
getServiceManager
()
->
createInstanceWithContext
(
aServiceName
,
xContext
),
UNO_QUERY
);
nNodes
+=
importAnimationNodeContainer
(
pChildAtom
,
xChildNode
);
Reference
<
XTimeContainer
>
xParentContainer
(
xNode
,
UNO_QUERY
);
if
(
xParentContainer
.
is
()
&&
xChildNode
.
is
()
)
...
...
sd/source/filter/xml/sdxmlwrp.cxx
Dosyayı görüntüle @
6f0b59e3
...
...
@@ -199,7 +199,7 @@ sal_Int32 ReadThroughComponent(
Reference
<
io
::
XInputStream
>
xInputStream
,
Reference
<
XComponent
>
xModelComponent
,
const
String
&
rStreamName
,
Reference
<
lang
::
XMultiServiceFactory
>
&
rFactory
,
Reference
<
uno
::
XComponentContext
>
&
rxContext
,
const
sal_Char
*
pFilterName
,
Sequence
<
Any
>
rFilterArguments
,
const
OUString
&
rName
,
...
...
@@ -208,7 +208,7 @@ sal_Int32 ReadThroughComponent(
{
DBG_ASSERT
(
xInputStream
.
is
(),
"input stream missing"
);
DBG_ASSERT
(
xModelComponent
.
is
(),
"document missing"
);
DBG_ASSERT
(
r
Factory
.
is
(),
"factory missing"
);
DBG_ASSERT
(
r
xContext
.
is
(),
"factory missing"
);
DBG_ASSERT
(
NULL
!=
pFilterName
,
"I need a service name for the component!"
);
RTL_LOGFILE_CONTEXT
(
aLog
,
"ReadThroughComponent"
);
...
...
@@ -219,13 +219,13 @@ sal_Int32 ReadThroughComponent(
aParserInput
.
aInputStream
=
xInputStream
;
// get parser
Reference
<
xml
::
sax
::
XParser
>
xParser
=
xml
::
sax
::
Parser
::
create
(
comphelper
::
getComponentContext
(
rFactory
)
);
Reference
<
xml
::
sax
::
XParser
>
xParser
=
xml
::
sax
::
Parser
::
create
(
rxContext
);
RTL_LOGFILE_CONTEXT_TRACE
(
aLog
,
"parser created"
);
// get filter
OUString
aFilterName
(
OUString
::
createFromAscii
(
pFilterName
));
Reference
<
xml
::
sax
::
XDocumentHandler
>
xFilter
(
r
Factory
->
createInstanceWithArguments
(
aFilterName
,
rFilterArguments
),
r
xContext
->
getServiceManager
()
->
createInstanceWithArgumentsAndContext
(
aFilterName
,
rFilterArguments
,
rxContext
),
UNO_QUERY
);
SAL_WARN_IF
(
!
xFilter
.
is
(),
"sd"
,
"Can't instantiate filter component: "
<<
aFilterName
);
if
(
!
xFilter
.
is
()
)
...
...
@@ -361,7 +361,7 @@ sal_Int32 ReadThroughComponent(
Reference
<
XComponent
>
xModelComponent
,
const
sal_Char
*
pStreamName
,
const
sal_Char
*
pCompatibilityStreamName
,
Reference
<
lang
::
XMultiServiceFactory
>
&
rFactory
,
Reference
<
uno
::
XComponentContext
>
&
rxContext
,
const
sal_Char
*
pFilterName
,
Sequence
<
Any
>
rFilterArguments
,
const
OUString
&
rName
,
...
...
@@ -433,7 +433,7 @@ sal_Int32 ReadThroughComponent(
// read from the stream
return
ReadThroughComponent
(
xInputStream
,
xModelComponent
,
sStreamName
,
r
Factory
,
xInputStream
,
xModelComponent
,
sStreamName
,
r
xContext
,
pFilterName
,
rFilterArguments
,
rName
,
bMustBeSuccessfull
,
bEncrypted
);
}
...
...
@@ -464,12 +464,8 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError )
sal_uInt32
nRet
=
0
;
// Get service factory
Reference
<
lang
::
XMultiServiceFactory
>
xServiceFactory
=
comphelper
::
getProcessServiceFactory
();
DBG_ASSERT
(
xServiceFactory
.
is
(),
"XMLReader::Read: got no service manager"
);
if
(
!
xServiceFactory
.
is
()
)
return
sal_False
;
Reference
<
uno
::
XComponentContext
>
rxContext
=
comphelper
::
getProcessComponentContext
();
// -------------------------------------
...
...
@@ -660,26 +656,26 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError )
// read storage streams
// #i103539#: always read meta.xml for generator
nWarn
=
ReadThroughComponent
(
xStorage
,
xModelComp
,
"meta.xml"
,
"Meta.xml"
,
xServiceFactory
,
xStorage
,
xModelComp
,
"meta.xml"
,
"Meta.xml"
,
rxContext
,
pServices
->
mpMeta
,
aEmptyArgs
,
aName
,
sal_False
);
if
(
meFilterMode
!=
SDXMLMODE_Organizer
)
{
nWarn2
=
ReadThroughComponent
(
xStorage
,
xModelComp
,
"settings.xml"
,
NULL
,
xServiceFactory
,
xStorage
,
xModelComp
,
"settings.xml"
,
NULL
,
rxContext
,
pServices
->
mpSettings
,
aFilterArgs
,
aName
,
sal_False
);
}
nRet
=
ReadThroughComponent
(
xStorage
,
xModelComp
,
"styles.xml"
,
NULL
,
xServiceFactory
,
xStorage
,
xModelComp
,
"styles.xml"
,
NULL
,
rxContext
,
pServices
->
mpStyles
,
aFilterArgs
,
aName
,
sal_True
);
if
(
!
nRet
&&
(
meFilterMode
!=
SDXMLMODE_Organizer
)
)
nRet
=
ReadThroughComponent
(
xStorage
,
xModelComp
,
"content.xml"
,
"Content.xml"
,
xServiceFactory
,
xStorage
,
xModelComp
,
"content.xml"
,
"Content.xml"
,
rxContext
,
pServices
->
mpContent
,
aFilterArgs
,
aName
,
sal_True
);
...
...
@@ -867,15 +863,8 @@ sal_Bool SdXMLFilter::Export()
return
sal_False
;
}
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
xServiceFactory
(
::
comphelper
::
getProcessServiceFactory
()
);
uno
::
Reference
<
uno
::
XComponentContext
>
xContext
(
::
comphelper
::
getProcessComponentContext
()
);
if
(
!
xServiceFactory
.
is
()
)
{
OSL_FAIL
(
"got no service manager"
);
return
sal_False
;
}
uno
::
Reference
<
xml
::
sax
::
XWriter
>
xWriter
=
xml
::
sax
::
Writer
::
create
(
xContext
);
/** property map for export info set */
...
...
@@ -1056,7 +1045,7 @@ sal_Bool SdXMLFilter::Export()
*
pArgs
<<=
xWriter
;
uno
::
Reference
<
document
::
XFilter
>
xFilter
(
x
ServiceFactory
->
createInstanceWithArguments
(
OUString
::
createFromAscii
(
pServices
->
mpService
),
aArgs
),
uno
::
UNO_QUERY
);
uno
::
Reference
<
document
::
XFilter
>
xFilter
(
x
Context
->
getServiceManager
()
->
createInstanceWithArgumentsAndContext
(
OUString
::
createFromAscii
(
pServices
->
mpService
),
aArgs
,
xContext
),
uno
::
UNO_QUERY
);
if
(
xFilter
.
is
()
)
{
uno
::
Reference
<
document
::
XExporter
>
xExporter
(
xFilter
,
uno
::
UNO_QUERY
);
...
...
sd/source/ui/framework/module/ModuleController.cxx
Dosyayı görüntüle @
6f0b59e3
...
...
@@ -234,22 +234,20 @@ void ModuleController::ProcessStartupService (const ::std::vector<Any>& rValues)
rValues
[
0
]
>>=
sServiceName
;
// Instantiate service.
Reference
<
lang
::
XMultiServiceFactory
>
xGlobalFactory
(
::
comphelper
::
getProcessServiceFactory
(),
UNO_QUERY
);
if
(
xGlobalFactory
.
is
())
{
// Create the startup service.
Sequence
<
Any
>
aArguments
(
1
);
aArguments
[
0
]
<<=
mxController
;
// Note that when the new object will be destroyed at the end of
// this scope when it does not register itself anywhere.
// Typically it will add itself as ConfigurationChangeListener
// at the configuration controller.
xGlobalFactory
->
createInstanceWithArguments
(
sServiceName
,
aArguments
);
SAL_INFO
(
"sd.fwk"
,
OSL_THIS_FUNC
<<
": ModuleController::created startup service "
<<
OUStringToOString
(
sServiceName
,
RTL_TEXTENCODING_UTF8
).
getStr
());
}
Reference
<
uno
::
XComponentContext
>
xContext
=
::
comphelper
::
getProcessComponentContext
();
// Create the startup service.
Sequence
<
Any
>
aArguments
(
1
);
aArguments
[
0
]
<<=
mxController
;
// Note that when the new object will be destroyed at the end of
// this scope when it does not register itself anywhere.
// Typically it will add itself as ConfigurationChangeListener
// at the configuration controller.
xContext
->
getServiceManager
()
->
createInstanceWithArgumentsAndContext
(
sServiceName
,
aArguments
,
xContext
);
SAL_INFO
(
"sd.fwk"
,
OSL_THIS_FUNC
<<
": ModuleController::created startup service "
<<
OUStringToOString
(
sServiceName
,
RTL_TEXTENCODING_UTF8
).
getStr
());
}
catch
(
Exception
&
)
{
...
...
@@ -278,20 +276,19 @@ void SAL_CALL ModuleController::requestResource (const OUString& rsResourceURL)
if
(
!
xFactory
.
is
())
{
// Create a new instance of the factory.
Reference
<
lang
::
XMultiServiceFactory
>
xGlobalFactory
(
::
comphelper
::
getProcessServiceFactory
(),
UNO_QUERY
);
if
(
xGlobalFactory
.
is
())
{
// Create the factory service.
Sequence
<
Any
>
aArguments
(
1
);
aArguments
[
0
]
<<=
mxController
;
xFactory
=
xGlobalFactory
->
createInstanceWithArguments
(
iFactory
->
second
,
aArguments
);
// Remember that this factory has been instanced.
(
*
mpLoadedFactories
)[
iFactory
->
second
]
=
xFactory
;
}
Reference
<
uno
::
XComponentContext
>
xContext
=
::
comphelper
::
getProcessComponentContext
();
// Create the factory service.
Sequence
<
Any
>
aArguments
(
1
);
aArguments
[
0
]
<<=
mxController
;
xFactory
=
xContext
->
getServiceManager
()
->
createInstanceWithArgumentsAndContext
(
iFactory
->
second
,
aArguments
,
xContext
);
// Remember that this factory has been instanced.
(
*
mpLoadedFactories
)[
iFactory
->
second
]
=
xFactory
;
}
}
}
...
...
sd/source/ui/slideshow/slideshowviewimpl.cxx
Dosyayı görüntüle @
6f0b59e3
...
...
@@ -655,9 +655,6 @@ void SlideShowView::init()
mxWindow
->
addWindowListener
(
this
);
mxWindow
->
addMouseListener
(
this
);
Reference
<
lang
::
XMultiServiceFactory
>
xFactory
(
::
comphelper
::
getProcessServiceFactory
(),
uno
::
UNO_QUERY_THROW
);
mxPointer
=
awt
::
Pointer
::
create
(
::
comphelper
::
getProcessComponentContext
()
);
getTransformation
();
...
...
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