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
376ae93f
Kaydet (Commit)
376ae93f
authored
Mar 17, 2017
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ofz#887 support avoiding reading config
Change-Id: Ic7e0e65b15c7b6a01a10d6004230ad71a2d439d2
üst
b165f0f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
60 deletions
+65
-60
Library_canvasfactory.mk
canvas/Library_canvasfactory.mk
+1
-0
cf_service.cxx
canvas/source/factory/cf_service.cxx
+64
-60
No files found.
canvas/Library_canvasfactory.mk
Dosyayı görüntüle @
376ae93f
...
...
@@ -29,6 +29,7 @@ $(eval $(call gb_Library_use_libraries,canvasfactory,\
cppu \
cppuhelper \
sal \
utl \
vcl \
$(gb_UWINAPI) \
))
...
...
canvas/source/factory/cf_service.cxx
Dosyayı görüntüle @
376ae93f
...
...
@@ -43,6 +43,7 @@
#if HAVE_FEATURE_OPENGL
#include <vcl/opengl/OpenGLWrapper.hxx>
#endif
#include <unotools/configmgr.hxx>
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
...
...
@@ -123,76 +124,79 @@ CanvasFactory::CanvasFactory( Reference<XComponentContext> const & xContext ) :
m_bCacheHasUseAcceleratedEntry
(),
m_bCacheHasUseAAEntry
()
{
try
if
(
!
utl
::
ConfigManager
::
IsAvoidConfig
())
{
// read out configuration for preferred services:
Reference
<
lang
::
XMultiServiceFactory
>
xConfigProvider
(
configuration
::
theDefaultProvider
::
get
(
m_xContext
)
);
Any
propValue
(
Any
(
beans
::
PropertyValue
(
"nodepath"
,
-
1
,
Any
(
OUString
(
"/org.openoffice.Office.Canvas"
)
),
beans
::
PropertyState_DIRECT_VALUE
)
)
);
m_xCanvasConfigNameAccess
.
set
(
xConfigProvider
->
createInstanceWithArguments
(
"com.sun.star.configuration.ConfigurationAccess"
,
Sequence
<
Any
>
(
&
propValue
,
1
)
),
UNO_QUERY_THROW
);
propValue
<<=
beans
::
PropertyValue
(
"nodepath"
,
-
1
,
Any
(
OUString
(
"/org.openoffice.Office.Canvas/CanvasServiceList"
)
),
beans
::
PropertyState_DIRECT_VALUE
);
Reference
<
container
::
XNameAccess
>
xNameAccess
(
xConfigProvider
->
createInstanceWithArguments
(
"com.sun.star.configuration.ConfigurationAccess"
,
Sequence
<
Any
>
(
&
propValue
,
1
)
),
UNO_QUERY_THROW
);
Reference
<
container
::
XHierarchicalNameAccess
>
xHierarchicalNameAccess
(
xNameAccess
,
UNO_QUERY_THROW
);
Sequence
<
OUString
>
serviceNames
=
xNameAccess
->
getElementNames
();
const
OUString
*
pCurr
=
serviceNames
.
getConstArray
();
const
OUString
*
const
pEnd
=
pCurr
+
serviceNames
.
getLength
();
while
(
pCurr
!=
pEnd
)
try
{
Reference
<
container
::
XNameAccess
>
xEntryNameAccess
(
xHierarchicalNameAccess
->
getByHierarchicalName
(
*
pCurr
),
UNO_QUERY
);
if
(
xEntryNameAccess
.
is
()
)
// read out configuration for preferred services:
Reference
<
lang
::
XMultiServiceFactory
>
xConfigProvider
(
configuration
::
theDefaultProvider
::
get
(
m_xContext
)
);
Any
propValue
(
Any
(
beans
::
PropertyValue
(
"nodepath"
,
-
1
,
Any
(
OUString
(
"/org.openoffice.Office.Canvas"
)
),
beans
::
PropertyState_DIRECT_VALUE
)
)
);
m_xCanvasConfigNameAccess
.
set
(
xConfigProvider
->
createInstanceWithArguments
(
"com.sun.star.configuration.ConfigurationAccess"
,
Sequence
<
Any
>
(
&
propValue
,
1
)
),
UNO_QUERY_THROW
);
propValue
<<=
beans
::
PropertyValue
(
"nodepath"
,
-
1
,
Any
(
OUString
(
"/org.openoffice.Office.Canvas/CanvasServiceList"
)
),
beans
::
PropertyState_DIRECT_VALUE
);
Reference
<
container
::
XNameAccess
>
xNameAccess
(
xConfigProvider
->
createInstanceWithArguments
(
"com.sun.star.configuration.ConfigurationAccess"
,
Sequence
<
Any
>
(
&
propValue
,
1
)
),
UNO_QUERY_THROW
);
Reference
<
container
::
XHierarchicalNameAccess
>
xHierarchicalNameAccess
(
xNameAccess
,
UNO_QUERY_THROW
);
Sequence
<
OUString
>
serviceNames
=
xNameAccess
->
getElementNames
();
const
OUString
*
pCurr
=
serviceNames
.
getConstArray
();
const
OUString
*
const
pEnd
=
pCurr
+
serviceNames
.
getLength
();
while
(
pCurr
!=
pEnd
)
{
Sequence
<
OUString
>
implementationList
;
if
(
(
xEntryNameAccess
->
getByName
(
"PreferredImplementations"
)
>>=
implementationList
)
)
{
m_aAvailableImplementations
.
push_back
(
std
::
make_pair
(
*
pCurr
,
implementationList
)
);
}
if
(
(
xEntryNameAccess
->
getByName
(
"AcceleratedImplementations"
)
>>=
implementationList
)
)
{
m_aAcceleratedImplementations
.
push_back
(
std
::
make_pair
(
*
pCurr
,
implementationList
)
);
}
if
(
(
xEntryNameAccess
->
getByName
(
"AntialiasingImplementations"
)
>>=
implementationList
)
)
Reference
<
container
::
XNameAccess
>
xEntryNameAccess
(
xHierarchicalNameAccess
->
getByHierarchicalName
(
*
pCurr
),
UNO_QUERY
);
if
(
xEntryNameAccess
.
is
()
)
{
m_aAAImplementations
.
push_back
(
std
::
make_pair
(
*
pCurr
,
implementationList
)
);
Sequence
<
OUString
>
implementationList
;
if
(
(
xEntryNameAccess
->
getByName
(
"PreferredImplementations"
)
>>=
implementationList
)
)
{
m_aAvailableImplementations
.
push_back
(
std
::
make_pair
(
*
pCurr
,
implementationList
)
);
}
if
(
(
xEntryNameAccess
->
getByName
(
"AcceleratedImplementations"
)
>>=
implementationList
)
)
{
m_aAcceleratedImplementations
.
push_back
(
std
::
make_pair
(
*
pCurr
,
implementationList
)
);
}
if
(
(
xEntryNameAccess
->
getByName
(
"AntialiasingImplementations"
)
>>=
implementationList
)
)
{
m_aAAImplementations
.
push_back
(
std
::
make_pair
(
*
pCurr
,
implementationList
)
);
}
}
++
pCurr
;
}
++
pCurr
;
}
}
catch
(
const
RuntimeException
&
)
{
throw
;
}
catch
(
const
Exception
&
)
{
catch
(
const
RuntimeException
&
)
{
throw
;
}
catch
(
const
Exception
&
)
{
}
}
if
(
m_aAvailableImplementations
.
empty
()
)
if
(
m_aAvailableImplementations
.
empty
()
)
{
// Ugh. Looks like configuration is borked. Fake minimal
// setup.
...
...
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