cui/source/options/optaboutconfig.cxx | 34 ++++++++++++++++++++++++++++++++++ cui/source/options/optaboutconfig.hxx | 3 +++ 2 files changed, 37 insertions(+)
New commits: commit f41b3971e2ee6a371e1afaa327dd5b3d107e0518 Author: Efe Gürkan YALAMAN <efeyala...@gmail.com> Date: Mon Jul 22 16:22:49 2013 +0300 Configuration Access method implemented. This method is used for getting access to configurations. Change-Id: Ia4aa82a3f2df02e26f750133f7a7d2c85a75710c diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx index e6ec794..09805c0 100644 --- a/cui/source/options/optaboutconfig.cxx +++ b/cui/source/options/optaboutconfig.cxx @@ -11,8 +11,15 @@ #include "optHeaderTabListbox.hxx" #include <svtools/svlbitm.hxx> #include <svtools/treelistentry.hxx> +#include <comphelper/processfactory.hxx> +#include <com/sun/star/configuration/theDefaultProvider.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/beans/NamedValue.hpp> + using namespace svx; +using namespace ::com::sun::star; #define ITEMID_PREF 1 #define ITEMID_TYPE 2 @@ -71,4 +78,31 @@ void CuiAboutConfigTabPage::InsertEntry( OUString& rProp, OUString& rStatus, OU pPrefBox->Insert( pEntry ); } + +sal_Bool CuiAboutConfigTabPage::FillItems() +{ + return sal_False; +} + +uno::Reference< container::XNameAccess > CuiAboutConfigTabPage::getConfigAccess() +{ + uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + + uno::Reference< lang::XMultiServiceFactory > xConfigProvider( + com::sun::star::configuration::theDefaultProvider::get( xContext ) ); + + beans::NamedValue aProperty; + aProperty.Name = "nodepath"; + aProperty.Value = uno::makeAny( OUString("org.openoffice") ); + + uno::Sequence< uno::Any > aArgumentList( 1 ); + aArgumentList[0] = uno::makeAny( aProperty ); + + uno::Reference< container::XNameAccess > xNameAccess( + xConfigProvider->createInstanceWithArguments( + "com.sun.star.configuration.ConfigurationAccess", aArgumentList ), + uno::UNO_QUERY_THROW ); + + return xNameAccess; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/options/optaboutconfig.hxx b/cui/source/options/optaboutconfig.hxx index cdfb1d5..eb446dc 100644 --- a/cui/source/options/optaboutconfig.hxx +++ b/cui/source/options/optaboutconfig.hxx @@ -13,6 +13,7 @@ #include <sfx2/tabdlg.hxx> #include <svx/simptabl.hxx> #include "optHeaderTabListbox.hxx" +#include <com/sun/star/container/XNameAccess.hpp> namespace svx { @@ -34,6 +35,8 @@ public: static SfxTabPage* Create( Window* pParent, const SfxItemSet& rItemset ); void InsertEntry(OUString& rProp, OUString& rStatus, OUString& rType, OUString& rValue); + sal_Bool FillItems(); + com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > getConfigAccess(); };
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits