[Libreoffice-commits] core.git: Changes to 'refs/changes/70/5770/4'

2014-09-29 Thread Janos Farago

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/70/5770/2'

2014-09-29 Thread Janos Farago

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/70/5770/1'

2014-09-29 Thread Janos Farago

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/70/5770/3'

2014-09-29 Thread Janos Farago

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/74/6074/1'

2014-09-29 Thread Janos Farago

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/74/6074/2'

2014-09-29 Thread Janos Farago

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.1' - 2 commits - configmgr/Library_configmgr.mk configmgr/source scp2/source

2013-10-17 Thread Janos Farago
 configmgr/Library_configmgr.mk|5 
 configmgr/source/components.cxx   |   23 +++
 configmgr/source/winreg.cxx   |  235 ++
 configmgr/source/winreg.hxx   |   22 +++
 configmgr/source/writemodfile.cxx |5 
 configmgr/source/writemodfile.hxx |4 
 scp2/source/ooo/common_brand.scp  |4 
 7 files changed, 291 insertions(+), 7 deletions(-)

New commits:
commit 2f0208dc68670023b0afeffd3a4b84a2ea1426bd
Author: Janos Farago 
Date:   Sun Sep 29 15:03:53 2013 +0200

winreg backend: add support for oor:op in config nodes

Change-Id: I9cc4472b37d24e426a67661806805c11b521dfb1
Reviewed-on: https://gerrit.libreoffice.org/6074
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index b68b9d2..2969598 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -36,18 +36,39 @@ namespace configmgr {
 
 namespace {
 // This is not a generic registry reader. We assume the following structure:
-// Last element of Key becomes prop, first part is the path.
+// Last element of Key becomes prop, first part is the path and optionally 
nodes,
+// when the node has oor:op attribute.
 // Values can be the following: Value (string) and Final (dword, optional)
+//
 // For example the following registry setting:
 // 
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.UserProfile\Data\o]
 // "Value"="Example Corp."
 // "Final"=dword:0001
 // becomes the following in configuration:
+// 
 // 
 // 
 // Example Corp.
 // 
 // 
+//
+// Another example:
+// 
[HKEY_LOCAL_MACHINE\Policies\LibreOffice\org.openoffice.Office.OptionsDialog\OptionsDialogGroups\ProductName/#fuse\Pages\AboutConfig/#fuse\Hide]
+// "Value"="true"
+// becomes the following in configuration:
+// 
+// 
+// 
+// 
+// 
+// 
+// true
+// 
+// 
+// 
+// 
+// 
+
 void dumpWindowsRegistryKey(HKEY hKey, OUString aKeyName, oslFileHandle 
aFileHandle)
 {
 HKEY hCurKey;
@@ -107,19 +128,59 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString aKeyName, 
oslFileHandle aFileHan
 bFinal = true;
 }
 sal_Int32 aLastSeparator = aKeyName.lastIndexOf('\\');
-OUString aPath = aKeyName.replaceAll("\\","/").copy(0, 
aLastSeparator);
+OUString aPathAndNodes = aKeyName.copy(0, aLastSeparator);
 OUString aProp = aKeyName.copy(aLastSeparator + 1);
+bool bHasNode = false;
+sal_Int32 nCloseNode = 0;
+
+writeData(aFileHandle, "");
+break;
+}
+}
 
-writeData(aFileHandle, "");
 writeValueContent(aFileHandle, aValue);
-writeData(aFileHandle, "\n");
+writeData(aFileHandle, "");
+for(; nCloseNode > 0; nCloseNode--)
+writeData(aFileHandle, "");
+writeData(aFileHandle, "\n");
     delete[] pValueName;
 delete[] pValue;
 }
commit b8d87040689d0db56867465aabddaab3932abdc0
Author: Janos Farago 
Date:   Tue Sep 3 09:42:44 2013 +0200

Windows registry configuration backend

The goal is to manage LibreOffice configuration centrally
in the enterprise. In Windows Server environment using
Group Policies is a common solution for configuration
management. Therefore it is required that LibreOffice can
read configuration data from Windows registry, too.

Windows registry is another configuration layer on the
top of normal xml based configuration.

For example the following registry setting:

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.UserProfile\Data\o]
"Value"="Example Corp."
"Final"=dword:0001
becomes the following in configuration:


Example Corp.



Signed-off-by: Stephan Bergmann 

Conflicts:
scp2/source/ooo/common_brand.scp

Change-Id: I2cdd83fc93922bf2806417bfd1b83f85cc926d4c

diff --git a/configmgr/Library_configmgr.mk b/configmgr/Library_configmgr.mk
index 791782d..2243350 100644
--- a/configmgr/Library_configmgr.mk
+++ b/configmgr/Library_configmgr.mk
@@ -36,6 +36,7 @@ $(eval $(call gb_Library_add_exception_objects,configmgr, \
 configmgr/source/type \
 configmgr/source/update \
 configmgr/source/valueparser \
+$(if $(filter $(OS),WNT), configmgr/source/winreg ) \
 configmgr/source/writemodfile \
 configmgr/source/xcdparser \
 configmgr/source/xcsparser \
@@ -54,8 +55,8 @@ $(eval $(call gb_Librar

[Libreoffice-commits] core.git: configmgr/source

2013-10-02 Thread Janos Farago
 configmgr/source/winreg.cxx |   73 
 1 file changed, 67 insertions(+), 6 deletions(-)

New commits:
commit a434091ba31c9e7c7725b6e25c2c534b798058a4
Author: Janos Farago 
Date:   Sun Sep 29 15:03:53 2013 +0200

winreg backend: add support for oor:op in config nodes

Change-Id: I9cc4472b37d24e426a67661806805c11b521dfb1
Reviewed-on: https://gerrit.libreoffice.org/6074
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index b68b9d2..2969598 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -36,18 +36,39 @@ namespace configmgr {
 
 namespace {
 // This is not a generic registry reader. We assume the following structure:
-// Last element of Key becomes prop, first part is the path.
+// Last element of Key becomes prop, first part is the path and optionally 
nodes,
+// when the node has oor:op attribute.
 // Values can be the following: Value (string) and Final (dword, optional)
+//
 // For example the following registry setting:
 // 
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.UserProfile\Data\o]
 // "Value"="Example Corp."
 // "Final"=dword:0001
 // becomes the following in configuration:
+// 
 // 
 // 
 // Example Corp.
 // 
 // 
+//
+// Another example:
+// 
[HKEY_LOCAL_MACHINE\Policies\LibreOffice\org.openoffice.Office.OptionsDialog\OptionsDialogGroups\ProductName/#fuse\Pages\AboutConfig/#fuse\Hide]
+// "Value"="true"
+// becomes the following in configuration:
+// 
+// 
+// 
+// 
+// 
+// 
+// true
+// 
+// 
+// 
+// 
+// 
+
 void dumpWindowsRegistryKey(HKEY hKey, OUString aKeyName, oslFileHandle 
aFileHandle)
 {
 HKEY hCurKey;
@@ -107,19 +128,59 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString aKeyName, 
oslFileHandle aFileHan
 bFinal = true;
 }
 sal_Int32 aLastSeparator = aKeyName.lastIndexOf('\\');
-OUString aPath = aKeyName.replaceAll("\\","/").copy(0, 
aLastSeparator);
+OUString aPathAndNodes = aKeyName.copy(0, aLastSeparator);
 OUString aProp = aKeyName.copy(aLastSeparator + 1);
+bool bHasNode = false;
+sal_Int32 nCloseNode = 0;
+
+writeData(aFileHandle, "");
+break;
+}
+}
 
-writeData(aFileHandle, "");
 writeValueContent(aFileHandle, aValue);
-writeData(aFileHandle, "\n");
+writeData(aFileHandle, "");
+for(; nCloseNode > 0; nCloseNode--)
+writeData(aFileHandle, "");
+writeData(aFileHandle, "\n");
 delete[] pValueName;
 delete[] pValue;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/Library_configmgr.mk configmgr/source scp2/source

2013-09-10 Thread Janos Farago
 configmgr/Library_configmgr.mk|5 -
 configmgr/source/components.cxx   |   23 -
 configmgr/source/winreg.cxx   |  174 ++
 configmgr/source/winreg.hxx   |   22 
 configmgr/source/writemodfile.cxx |5 -
 configmgr/source/writemodfile.hxx |4 
 scp2/source/ooo/common_brand.scp  |4 
 7 files changed, 230 insertions(+), 7 deletions(-)

New commits:
commit 5a02076358a547bae8a9b596d9722a7cd2d46c34
Author: Janos Farago 
Date:   Tue Sep 3 09:42:44 2013 +0200

Windows registry configuration backend

The goal is to manage LibreOffice configuration centrally
in the enterprise. In Windows Server environment using
Group Policies is a common solution for configuration
management. Therefore it is required that LibreOffice can
read configuration data from Windows registry, too.

Windows registry is another configuration layer on the
top of normal xml based configuration.

For example the following registry setting:

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.UserProfile\Data\o]
"Value"="Example Corp."
"Final"=dword:0001
becomes the following in configuration:


Example Corp.



Change-Id: I2cdd83fc93922bf2806417bfd1b83f85cc926d4c
Signed-off-by: Stephan Bergmann 

diff --git a/configmgr/Library_configmgr.mk b/configmgr/Library_configmgr.mk
index 791782d..2243350 100644
--- a/configmgr/Library_configmgr.mk
+++ b/configmgr/Library_configmgr.mk
@@ -36,6 +36,7 @@ $(eval $(call gb_Library_add_exception_objects,configmgr, \
 configmgr/source/type \
 configmgr/source/update \
 configmgr/source/valueparser \
+$(if $(filter $(OS),WNT), configmgr/source/winreg ) \
 configmgr/source/writemodfile \
 configmgr/source/xcdparser \
 configmgr/source/xcsparser \
@@ -54,8 +55,8 @@ $(eval $(call gb_Library_use_libraries,configmgr, \
 sal \
 salhelper \
 xmlreader \
-   i18nlangtag \
-   $(gb_UWINAPI) \
+i18nlangtag \
+$(gb_UWINAPI) \
 ))
 
 $(eval $(call 
gb_Library_set_componentfile,configmgr,configmgr/source/configmgr))
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 4a1b719..b5b38b5 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -66,6 +66,9 @@
 #include "xcdparser.hxx"
 #include "xcuparser.hxx"
 #include "xcsparser.hxx"
+#ifdef WNT
+#include "winreg.hxx"
+#endif
 
 namespace configmgr {
 
@@ -541,7 +544,25 @@ Components::Components(
 }
 modificationFileUrl_ = url;
 parseModificationLayer(url);
-} else {
+}
+#ifdef WNT
+else if ( type == "winreg" )
+{
+if (!url.isEmpty()) {
+SAL_WARN(
+"configmgr",
+"winreg URL is not empty, URL handling is not implemented 
for winreg");
+}
+OUString aTempFileURL;
+if ( dumpWindowsRegistry(&aTempFileURL) )
+{
+parseFileLeniently(&parseXcuFile, aTempFileURL, layer, data_, 
0, 0, 0);
+layer++;
+osl::File::remove(aTempFileURL);
+}
+}
+#endif
+else {
 throw css::uno::RuntimeException(
 "CONFIGURATION_LAYERS: unknown layer type \"" + type + "\"",
 css::uno::Reference< css::uno::XInterface >());
diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
new file mode 100644
index 000..b68b9d2
--- /dev/null
+++ b/configmgr/source/winreg.cxx
@@ -0,0 +1,174 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include 
+#ifdef _MSC_VER
+#pragma warning(push, 1) /* disable warnings within system headers */
+#endif
+#define WIN32_LEAN_AND_MEAN
+#include 
+#include 
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "rtl/ustring.hxx"
+#include "osl/file.h"
+#include "osl/file.hxx"
+#include "winreg.hxx"
+#include "writemodfile.hxx"
+
+#define MAX_KEY_LENGTH 255
+
+namespace configmgr {
+
+namespace {
+// This is not a generic registry reader. We assume the following structure:
+// Last element of Key become