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
ce3dd82c
Kaydet (Commit)
ce3dd82c
authored
Ock 04, 2016
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Clean up configuration access
Change-Id: I0662e8ddb24f2c6a7197b8a5f23c219484628b78
üst
97df0e60
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
172 deletions
+20
-172
Library_ucpchelp1.mk
xmlhelp/Library_ucpchelp1.mk
+4
-0
provider.cxx
xmlhelp/source/cxxhelp/provider/provider.cxx
+16
-155
provider.hxx
xmlhelp/source/cxxhelp/provider/provider.hxx
+0
-17
No files found.
xmlhelp/Library_ucpchelp1.mk
Dosyayı görüntüle @
ce3dd82c
...
...
@@ -16,6 +16,10 @@ $(eval $(call gb_Library_set_include,ucpchelp1,\
$$(INCLUDE) \
))
$(eval $(call gb_Library_use_custom_headers,ucpchelp1, \
officecfg/registry \
))
$(eval $(call gb_Library_use_sdk_api,ucpchelp1))
$(eval $(call gb_Library_use_externals,ucpchelp1,\
...
...
xmlhelp/source/cxxhelp/provider/provider.cxx
Dosyayı görüntüle @
ce3dd82c
...
...
@@ -20,16 +20,14 @@
#include <config_folders.h>
#include <stdio.h>
#include <officecfg/Office/Common.hxx>
#include <officecfg/Setup.hxx>
#include <osl/file.hxx>
#include <osl/diagnose.h>
#include <ucbhelper/contentidentifier.hxx>
#include <com/sun/star/frame/XConfigManager.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/container/XContainer.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
...
...
@@ -259,73 +257,32 @@ void ContentProvider::init()
osl
::
MutexGuard
aGuard
(
m_aMutex
);
isInitialized
=
true
;
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
sProvider
(
getConfiguration
()
);
uno
::
Reference
<
container
::
XHierarchicalNameAccess
>
xHierAccess
(
getHierAccess
(
sProvider
,
"org.openoffice.Office.Common"
)
);
OUString
instPath
(
getKey
(
xHierAccess
,
"Path/Current/Help"
)
);
OUString
instPath
(
officecfg
::
Office
::
Common
::
Path
::
Current
::
Help
::
get
(
m_xContext
));
if
(
instPath
.
isEmpty
()
)
// try to determine path from default
instPath
=
"$(instpath)/"
LIBO_SHARE_HELP_FOLDER
;
// replace anything like $(instpath);
subst
(
instPath
);
OUString
stylesheet
(
getKey
(
xHierAccess
,
"Help/HelpStyleSheet"
)
);
try
{
// now adding as configuration change listener for the stylesheet
uno
::
Reference
<
container
::
XNameAccess
>
xAccess
(
xHierAccess
,
uno
::
UNO_QUERY
);
if
(
xAccess
.
is
()
)
{
uno
::
Any
aAny
=
xAccess
->
getByName
(
"Help"
);
aAny
>>=
m_xContainer
;
if
(
m_xContainer
.
is
()
)
m_xContainer
->
addContainerListener
(
this
);
}
}
catch
(
uno
::
Exception
const
&
)
{
}
OUString
stylesheet
(
officecfg
::
Office
::
Common
::
Help
::
HelpStyleSheet
::
get
(
m_xContext
));
xHierAccess
=
getHierAccess
(
sProvider
,
"org.openoffice.Setup"
);
// now adding as configuration change listener for the stylesheet
m_xContainer
.
set
(
officecfg
::
Office
::
Common
::
Help
::
get
(
m_xContext
),
css
::
uno
::
UNO_QUERY_THROW
);
m_xContainer
->
addContainerListener
(
this
);
OUString
setupversion
(
getKey
(
xHierAccess
,
"Product/ooSetupVersion"
)
);
OUString
setupextension
;
try
{
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
xConfigProvider
=
configuration
::
theDefaultProvider
::
get
(
m_xContext
);
uno
::
Sequence
<
uno
::
Any
>
lParams
(
1
);
beans
::
PropertyValue
aParam
;
aParam
.
Name
=
"nodepath"
;
aParam
.
Value
<<=
OUString
(
"/org.openoffice.Setup/Product"
);
lParams
[
0
]
=
uno
::
makeAny
(
aParam
);
// open it
uno
::
Reference
<
uno
::
XInterface
>
xCFG
(
xConfigProvider
->
createInstanceWithArguments
(
"com.sun.star.configuration.ConfigurationAccess"
,
lParams
)
);
uno
::
Reference
<
container
::
XNameAccess
>
xDirectAccess
(
xCFG
,
uno
::
UNO_QUERY
);
uno
::
Any
aRet
=
xDirectAccess
->
getByName
(
"ooSetupExtension"
);
aRet
>>=
setupextension
;
}
catch
(
uno
::
Exception
&
)
{
}
officecfg
::
Setup
::
Product
::
ooSetupVersion
::
get
(
m_xContext
));
OUString
setupextension
(
officecfg
::
Setup
::
Product
::
ooSetupExtension
::
get
(
m_xContext
));
OUString
productversion
(
setupversion
+
" "
+
setupextension
);
xHierAccess
=
getHierAccess
(
sProvider
,
"org.openoffice.Office.Common"
);
bool
showBasic
=
getBooleanKey
(
xHierAccess
,
"Help/ShowBasic"
);
bool
showBasic
=
officecfg
::
Office
::
Common
::
Help
::
ShowBasic
::
get
(
m_xContext
);
m_pDatabases
=
new
Databases
(
showBasic
,
instPath
,
utl
::
ConfigManager
::
getProductName
(),
...
...
@@ -334,102 +291,6 @@ void ContentProvider::init()
m_xContext
);
}
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
ContentProvider
::
getConfiguration
()
const
{
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
xProvider
;
if
(
m_xContext
.
is
()
)
{
try
{
xProvider
=
configuration
::
theDefaultProvider
::
get
(
m_xContext
);
}
catch
(
const
uno
::
Exception
&
)
{
OSL_ENSURE
(
xProvider
.
is
(),
"can not instantiate configuration"
);
}
}
return
xProvider
;
}
uno
::
Reference
<
container
::
XHierarchicalNameAccess
>
ContentProvider
::
getHierAccess
(
const
uno
::
Reference
<
lang
::
XMultiServiceFactory
>&
sProvider
,
const
char
*
file
)
{
uno
::
Reference
<
container
::
XHierarchicalNameAccess
>
xHierAccess
;
if
(
sProvider
.
is
()
)
{
uno
::
Sequence
<
uno
::
Any
>
seq
(
1
);
OUString
sReaderService
(
OUString
(
"com.sun.star.configuration.ConfigurationAccess"
)
);
seq
[
0
]
<<=
OUString
::
createFromAscii
(
file
);
try
{
xHierAccess
=
uno
::
Reference
<
container
::
XHierarchicalNameAccess
>
(
sProvider
->
createInstanceWithArguments
(
sReaderService
,
seq
),
uno
::
UNO_QUERY
);
}
catch
(
const
uno
::
Exception
&
)
{
}
}
return
xHierAccess
;
}
OUString
ContentProvider
::
getKey
(
const
uno
::
Reference
<
container
::
XHierarchicalNameAccess
>&
xHierAccess
,
const
char
*
key
)
{
OUString
instPath
;
if
(
xHierAccess
.
is
()
)
{
uno
::
Any
aAny
;
try
{
aAny
=
xHierAccess
->
getByHierarchicalName
(
OUString
::
createFromAscii
(
key
)
);
}
catch
(
const
container
::
NoSuchElementException
&
)
{
}
aAny
>>=
instPath
;
}
return
instPath
;
}
bool
ContentProvider
::
getBooleanKey
(
const
uno
::
Reference
<
container
::
XHierarchicalNameAccess
>&
xHierAccess
,
const
char
*
key
)
{
bool
ret
=
false
;
if
(
xHierAccess
.
is
()
)
{
uno
::
Any
aAny
;
try
{
aAny
=
xHierAccess
->
getByHierarchicalName
(
OUString
::
createFromAscii
(
key
)
);
}
catch
(
const
container
::
NoSuchElementException
&
)
{
}
aAny
>>=
ret
;
}
return
ret
;
}
void
ContentProvider
::
subst
(
OUString
&
instpath
)
{
SvtPathOptions
aOptions
;
...
...
xmlhelp/source/cxxhelp/provider/provider.hxx
Dosyayı görüntüle @
ce3dd82c
...
...
@@ -23,7 +23,6 @@
#include <rtl/ustring.hxx>
#include <osl/mutex.hxx>
#include <ucbhelper/providerhelper.hxx>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/container/XContainerListener.hpp>
#include <com/sun/star/container/XContainer.hpp>
#include <com/sun/star/lang/XComponent.hpp>
...
...
@@ -156,22 +155,6 @@ namespace chelp {
void
init
();
css
::
uno
::
Reference
<
css
::
lang
::
XMultiServiceFactory
>
getConfiguration
()
const
;
static
css
::
uno
::
Reference
<
css
::
container
::
XHierarchicalNameAccess
>
getHierAccess
(
const
css
::
uno
::
Reference
<
css
::
lang
::
XMultiServiceFactory
>&
sProvider
,
const
char
*
file
);
static
OUString
getKey
(
const
css
::
uno
::
Reference
<
css
::
container
::
XHierarchicalNameAccess
>&
xHierAccess
,
const
char
*
key
);
static
bool
getBooleanKey
(
const
css
::
uno
::
Reference
<
css
::
container
::
XHierarchicalNameAccess
>&
xHierAccess
,
const
char
*
key
);
static
void
subst
(
OUString
&
instpath
);
};
...
...
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