[Libreoffice-commits] core.git: Branch 'feature/aboutconfig' - cui/source
Efe Gürkan YALAMAN
efeyalaman at gmail.com
Mon Jul 22 13:21:46 PDT 2013
cui/source/options/optaboutconfig.cxx | 53 ++++++++++++++++++++++++++++++----
cui/source/options/optaboutconfig.hxx | 6 +--
2 files changed, 51 insertions(+), 8 deletions(-)
New commits:
commit 69892393f2588767e1d380ad0fc9d8e812a9713f
Author: Efe Gürkan YALAMAN <efeyalaman at gmail.com>
Date: Mon Jul 22 23:09:28 2013 +0300
Draft for FillItems
Change-Id: Iefd8a21d1cb27496c87502755834c31b1a35ba44
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 09805c0..6bc02bf 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -16,10 +16,14 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
using namespace svx;
using namespace ::com::sun::star;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::container;
#define ITEMID_PREF 1
#define ITEMID_TYPE 2
@@ -79,12 +83,44 @@ void CuiAboutConfigTabPage::InsertEntry( OUString& rProp, OUString& rStatus, OU
pPrefBox->Insert( pEntry );
}
-sal_Bool CuiAboutConfigTabPage::FillItems()
+
+void CuiAboutConfigTabPage::FillItems( Reference< XNameAccess >xNameAccess,
+ Reference< XHierarchicalNameAccess > xHierarchicalNameAccess, OUString sPath)
{
- return sal_False;
+ sal_Bool bIsLeafNode;
+// Reference< XNameAccess > xNameAccess = getConfigAccess();
+ //Reference< XHierarchicalNameAccess > xNextHierarchicalNameAccess;
+
+ uno::Sequence< OUString > seqItems = xNameAccess->getElementNames();
+ for( sal_Int16 i = 0; i < seqItems.getLength(); ++i )
+ {
+ xHierarchicalNextNameAccess = xHierarchicalNameAccess->getByHierarchicalName( seqItems[i] );
+
+ //getConfigAccess for nextNameAccess ? with xHierarchicalNextName.getName()
+
+ bIsLeafNode = sal_True;
+
+ try
+ {
+ uno::Sequence < OUString > seqNext = xNextNameAccess->getElementNames();
+ FillItems( xHierarchicalNextAccess, sPath + OUString("/") + seqItems[i] );
+ bIsLeafNode = sal_False;
+
+ }
+ catch( uno::Exception& )
+ {
+ }
+
+ if( bIsLeafNode )
+ {
+ InsertEntry( sPath, "", "", "");
+ }
+ }
}
-uno::Reference< container::XNameAccess > CuiAboutConfigTabPage::getConfigAccess()
+//uno::Reference< XNameAccess > CuiAboutConfigTabPage::getConfigAccess( sal_Bool isHierarchical )
+void CuiAboutConfigTabPage::getConfigAccess( Reference< XNameAccess >& xNameAccess,
+ Reference< XHierarchicalNameAccess >& xHierarchicalNameAccess )
{
uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
@@ -98,11 +134,18 @@ uno::Reference< container::XNameAccess > CuiAboutConfigTabPage::getConfigAccess(
uno::Sequence< uno::Any > aArgumentList( 1 );
aArgumentList[0] = uno::makeAny( aProperty );
- uno::Reference< container::XNameAccess > xNameAccess(
+ uno::Reference< container::XNameAccess > xNameAcc(
xConfigProvider->createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationAccess", aArgumentList ),
uno::UNO_QUERY_THROW );
- return xNameAccess;
+ Reference< XHierarchicalNameAccess > xHierarchicalNameAcc(
+ xConfigProvider->createInstanceWithArguments(
+ "com.sun.star.configuration.ConfigurationAccess", aArgumentList ),
+ uno::UNO_QUERY_THROW );
+
+ xNameAccess = xNameAcc;
+ xHierarchicalNameAccess = xHierarchicalNameAcc;
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/optaboutconfig.hxx b/cui/source/options/optaboutconfig.hxx
index eb446dc..947009e 100644
--- a/cui/source/options/optaboutconfig.hxx
+++ b/cui/source/options/optaboutconfig.hxx
@@ -13,7 +13,7 @@
#include <sfx2/tabdlg.hxx>
#include <svx/simptabl.hxx>
#include "optHeaderTabListbox.hxx"
-#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
namespace svx
{
@@ -35,8 +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();
+ void FillItems( com::sun::star::uno::Reference < com::sun::star::container::XHierarchicalNameAccess > xNameAccess, OUString sPath);
+ com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess > getConfigAccess();
};
More information about the Libreoffice-commits
mailing list