[Libreoffice-commits] .: configmgr/source

2012-03-15 Thread Stephan Bergmann
 configmgr/source/components.cxx |   40 +++-
 1 file changed, 31 insertions(+), 9 deletions(-)

New commits:
commit 84ecea9655267afc266b79059baa4512a285b1f2
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Mar 15 09:34:56 2012 +0100

fdo#42961 Don't let env vars interfere with internal bootstrap vars

diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 0e1c7e4..6f18508 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -53,6 +53,7 @@
 #include rtl/oustringostreaminserter.hxx
 #include rtl/ref.hxx
 #include rtl/string.h
+#include rtl/ustrbuf.hxx
 #include rtl/ustring.h
 #include rtl/ustring.hxx
 #include rtl/instance.hxx
@@ -827,17 +828,38 @@ void Components::parseXcsXcuLayer(int layer, 
rtl::OUString const  url) {
 void Components::parseXcsXcuIniLayer(
 int layer, rtl::OUString const  url, bool recordAdditions)
 {
-//TODO: rtl::Bootstrap::getFrom first trie[s] to retrieve the value via 
the
-// global function
+// Check if ini file exists (otherwise .override would still read global
+// SCHEMA/DATA variables, which could interfere with unrelated environment
+// variables):
 rtl::Bootstrap ini(url);
-rtl::OUString urls;
-if (ini.getFrom(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SCHEMA)), 
urls))
+if (ini.getHandle() != 0)
 {
-parseFileList(layer, parseXcsFile, urls, ini, false);
-}
-if (ini.getFrom(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DATA)), urls))
-{
-parseFileList(layer + 1, parseXcuFile, urls, ini, recordAdditions);
+rtl::OUStringBuffer prefix(${.override:);
+for (sal_Int32 i = 0; i != url.getLength(); ++i) {
+sal_Unicode c = url[i];
+switch (c) {
+case '$':
+case ':':
+case '\\':
+prefix.append('\\');
+// fall through
+default:
+prefix.append(c);
+}
+}
+prefix.append(':');
+rtl::OUString urls(prefix.toString() + rtl::OUString(SCHEMA}));
+rtl::Bootstrap::expandMacros(urls);
+if (!urls.isEmpty())
+{
+parseFileList(layer, parseXcsFile, urls, ini, false);
+}
+urls = prefix.makeStringAndClear() + rtl::OUString(DATA});
+rtl::Bootstrap::expandMacros(urls);
+if (!urls.isEmpty())
+{
+parseFileList(layer + 1, parseXcuFile, urls, ini, 
recordAdditions);
+}
 }
 }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: configmgr/source

2012-03-09 Thread Stephan Bergmann
 configmgr/source/writemodfile.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit c7ad399a535d21cc73f0e99fbea361e559b34d4f
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Mar 9 16:32:57 2012 +0100

Line breaks in registrymodifications.xcu

diff --git a/configmgr/source/writemodfile.cxx 
b/configmgr/source/writemodfile.cxx
index 8683302..272e739 100644
--- a/configmgr/source/writemodfile.cxx
+++ b/configmgr/source/writemodfile.cxx
@@ -509,7 +509,7 @@ void writeModifications(
 break;
 }
 }
-writeData(handle, RTL_CONSTASCII_STRINGPARAM(/item));
+writeData(handle, RTL_CONSTASCII_STRINGPARAM(/item\n));
 } else {
 assert(node.is());
 rtl::OUString pathRep(
@@ -573,10 +573,10 @@ void writeModFile(
 writeData(
 tmp.handle,
 RTL_CONSTASCII_STRINGPARAM(
-?xml version=\1.0\ encoding=\UTF-8\?oor:items
+?xml version=\1.0\ encoding=\UTF-8\?\noor:items
  xmlns:oor=\http://openoffice.org/2001/registry\;
  xmlns:xs=\http://www.w3.org/2001/XMLSchema\;
- xmlns:xsi=\http://www.w3.org/2001/XMLSchema-instance\;));
+ xmlns:xsi=\http://www.w3.org/2001/XMLSchema-instance\;\n));
 //TODO: Do not write back information about those removed items that did 
not
 // come from the .xcs/.xcu files, anyway (but had been added dynamically
 // instead):
@@ -590,7 +590,7 @@ void writeModFile(
 Data::findNode(Data::NO_LAYER, data.getComponents(), j-first),
 j-second);
 }
-writeData(tmp.handle, RTL_CONSTASCII_STRINGPARAM(/oor:items));
+writeData(tmp.handle, RTL_CONSTASCII_STRINGPARAM(/oor:items\n));
 oslFileError e = osl_closeFile(tmp.handle);
 tmp.closed = true;
 if (e != osl_File_E_None) {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: configmgr/source

2012-01-12 Thread Stephan Bergmann
 configmgr/source/xcuparser.cxx |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit ab93e1b483d7af9bcac997e838e5a62a924e28c3
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Jan 12 09:15:19 2012 +0100

Check for xcu node that should rather be prop.

diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx
index 6ee5c82..2d65923 100644
--- a/configmgr/source/xcuparser.cxx
+++ b/configmgr/source/xcuparser.cxx
@@ -934,6 +934,16 @@ void XcuParser::handleGroupNode(
 state_.push(State(true)); // ignored
 return;
 }
+Node::Kind kind = child-kind();
+if (kind != Node::KIND_GROUP  kind != Node::KIND_SET) {
+throw css::uno::RuntimeException(
+(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(bad node \)) +
+ name +
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(\ of non group/set kind in )) +
+ reader.getUrl()),
+css::uno::Reference css::uno::XInterface ());
+}
 if (op != OPERATION_MODIFY  op != OPERATION_FUSE) {
 throw css::uno::RuntimeException(
 (rtl::OUString(
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: configmgr/source

2011-12-13 Thread Stephan Bergmann
 configmgr/source/access.cxx|   41 +++
 configmgr/source/components.cxx|6 +--
 configmgr/source/data.cxx  |7 +++-
 configmgr/source/data.hxx  |4 +-
 configmgr/source/groupnode.cxx |4 +-
 configmgr/source/groupnode.hxx |2 -
 configmgr/source/localizedpropertynode.cxx |4 +-
 configmgr/source/localizedpropertynode.hxx |2 -
 configmgr/source/node.cxx  |   18 ++
 configmgr/source/node.hxx  |3 -
 configmgr/source/rootnode.cxx  |   10 +
 configmgr/source/rootnode.hxx  |9 +
 configmgr/source/setnode.cxx   |4 +-
 configmgr/source/setnode.hxx   |2 -
 configmgr/source/valueparser.cxx   |9 ++---
 configmgr/source/writemodfile.cxx  |3 +
 configmgr/source/xcsparser.cxx |   31 -
 configmgr/source/xcuparser.cxx |   50 -
 18 files changed, 97 insertions(+), 112 deletions(-)

New commits:
commit db4bc6812d69d960a558b89c18f08b17a2e38d27
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Dec 13 22:16:31 2011 +0100

Unified configmgr::Node::getMember{s,Map} again.

(With the insight that Data::components is RootNode::members.)

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 7fc239c..b6617b4 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1607,31 +1607,28 @@ void Access::commitChildChanges(
 // children); clarify what exactly should happen here for
 // directly inserted children
 }
-NodeMap * members = getNode()-getMemberMap();
-if (members != 0) {
-NodeMap::iterator j(members-find(i-first));
-if (child.is()) {
-// Inserted:
-if (j != members-end()) {
-childValid = childValid 
-j-second-getFinalized() == Data::NO_LAYER;
-if (childValid) {
-child-getNode()-setMandatory(
-j-second-getMandatory());
-}
-}
-if (childValid) {
-(*members)[i-first] = child-getNode();
-}
-} else {
-// Removed:
-childValid = childValid  j != members-end() 
-j-second-getFinalized() == Data::NO_LAYER 
-j-second-getMandatory() == Data::NO_LAYER;
+NodeMap  members = getNode()-getMembers();
+NodeMap::iterator j(members.find(i-first));
+if (child.is()) {
+// Inserted:
+if (j != members.end()) {
+childValid = childValid 
+j-second-getFinalized() == Data::NO_LAYER;
 if (childValid) {
-members-erase(j);
+child-getNode()-setMandatory(j-second-getMandatory());
 }
 }
+if (childValid) {
+members[i-first] = child-getNode();
+}
+} else {
+// Removed:
+childValid = childValid  j != members.end() 
+j-second-getFinalized() == Data::NO_LAYER 
+j-second-getMandatory() == Data::NO_LAYER;
+if (childValid) {
+members.erase(j);
+}
 }
 if (childValid  i-second.directlyModified) {
 Path path(getAbsolutePath());
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 56c5975..77f8c01 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -385,7 +385,7 @@ void Components::removeExtensionXcuFile(
  i != item-additions.rend(); ++i)
 {
 rtl::Reference Node  parent;
-NodeMap const * map = data_.components;
+NodeMap const * map = data_.getComponents();
 rtl::Reference Node  node;
 for (Path::const_iterator j(i-begin()); j != i-end(); ++j) {
 parent = node;
@@ -402,9 +402,7 @@ void Components::removeExtensionXcuFile(
 node-kind() == Node::KIND_GROUP ||
 node-kind() == Node::KIND_SET);
 if (canRemoveFromLayer(item-layer, node)) {
-NodeMap * members = parent-getMemberMap();
-assert(members != 0);
-members-erase(i-back());
+parent-getMembers().erase(i-back());
 data_.modifications.remove(*i);
 modifications-add(*i);
 }
diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx
index fcc42e9..df7ce60 100644
--- a/configmgr/source/data.cxx
+++ b/configmgr/source/data.cxx

[Libreoffice-commits] .: configmgr/source sc/CppunitTest_sc_macros_test.mk sc/qa test/prj test/user-template

2011-10-26 Thread Noel Power
 configmgr/source/components.cxx|   12 +
 sc/CppunitTest_sc_macros_test.mk   |1 
 sc/qa/unit/macros-test.cxx |4 -
 test/prj/d.lst |5 ++
 test/user-template/user/data/registrymodifications.xcu |   37 +
 test/user-template/user/registrymodifications.xcu  |   37 -
 6 files changed, 56 insertions(+), 40 deletions(-)

New commits:
commit 8e68391fc99b34702d76526e6b3ab4720ac017e4
Author: Noel Power noel.po...@novell.com
Date:   Wed Oct 26 19:05:50 2011 +0100

more tweaks to unittests, also move registrymodifications.xcu

registrymodifications.xcu has been moved to the solver ( unittest/user/data 
)
new OOO_CONFIG_REGISTRY_EXTRA_DIR env var will be used to specify the 
directory 'data' will be contained in so we can override various config items.

diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index f6257b6..0549f8a 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -520,7 +520,17 @@ Components::Components(
 parseXcsXcuLayer( 0, aUnitTestDir );
 // next is required for the (somewhat strange) filter configuration
 parseModuleLayer( 1, aUnitTestDir + 
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(/spool)));
-parseModificationLayer();
+// allow a directory to be specified to allow extra configuration to 
be stored
+// for example to place a registrymodifications.xcu to override some 
configuration
+rtl::OUString extra;
+if (rtl::Bootstrap::get(
+rtl::OUString(
+RTL_CONSTASCII_USTRINGPARAM(
+OOO_CONFIG_REGISTRY_EXTRA_DIR)),
+extra))
+{
+parseXcsXcuLayer(3, extra);
+}
 return;
 }
 
diff --git a/sc/CppunitTest_sc_macros_test.mk b/sc/CppunitTest_sc_macros_test.mk
index 8a9bd3d..0da6348 100644
--- a/sc/CppunitTest_sc_macros_test.mk
+++ b/sc/CppunitTest_sc_macros_test.mk
@@ -100,6 +100,7 @@ $(eval $(call gb_CppunitTest_set_args,sc_macros_test,\
 --headless \
 --protector unoexceptionprotector$(gb_Library_DLLEXT) 
unoexceptionprotector \
 -env:OOO_CONFIG_REGISTRY_DIR=$(call 
gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry) \
+-env:OOO_CONFIG_REGISTRY_EXTRA_DIR=$(call 
gb_CppunitTarget__make_url,$(OUTDIR)/unittest/user) \
 ))
 
 # we need to
diff --git a/sc/qa/unit/macros-test.cxx b/sc/qa/unit/macros-test.cxx
index 067a255..a971d20 100644
--- a/sc/qa/unit/macros-test.cxx
+++ b/sc/qa/unit/macros-test.cxx
@@ -129,10 +129,10 @@ public:
 CPPUNIT_TEST_SUITE(ScMacrosTest);
 //enable this test if you want to play with star basic macros in unit tests
 //works but does nothing useful yet
-//CPPUNIT_TEST(testStarBasic);
+CPPUNIT_TEST(testStarBasic);
 //enable if you want to hack vba support for unit tests
 //does not work, still problems during loading
-//CPPUNIT_TEST(testVba);
+CPPUNIT_TEST(testVba);
 
 
 CPPUNIT_TEST_SUITE_END();
diff --git a/test/prj/d.lst b/test/prj/d.lst
index 9211e33..9ec65ba 100644
--- a/test/prj/d.lst
+++ b/test/prj/d.lst
@@ -6,3 +6,8 @@ mkdir: %_DEST%\inc\test
 ..\%__SRC%\lib\libtest.dll.a %_DEST%\lib\libtest.dll.a
 ..\inc\test\testdllapi.hxx %_DEST%\inc\test\testdllapi.hxx
 ..\inc\test\bootstrapfixture.hxx %_DEST%\inc\test\bootstrapfixture.hxx
+mkdir: %_DEST%\unittest
+mkdir: %_DEST%\unittest\user
+mkdir: %_DEST%\unittest\user\data
+..\user-template\user\data\registrymodifications.xcu 
%_DEST%\unittest\user\data\registrymodifications.xcu
+
diff --git a/test/user-template/user/data/registrymodifications.xcu 
b/test/user-template/user/data/registrymodifications.xcu
new file mode 100644
index 000..cdfda4a
--- /dev/null
+++ b/test/user-template/user/data/registrymodifications.xcu
@@ -0,0 +1,37 @@
+?xml version=1.0 encoding=UTF-8?
+!--
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the License); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an AS IS basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 Stephan Bergmann sberg...@redhat.com (initial
+ *   developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the GPLv3+), or
+ * the GNU Lesser General Public License Version 3 or later (the LGPLv3+),
+ * in which