summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2010-06-22 09:36:55 +0200
committerJoachim Lingner <jl@openoffice.org>2010-06-22 09:36:55 +0200
commitb589c0d0ac45d7fced8c9b6af1d262fa5a22ad65 (patch)
tree7e5d6104f3013afecad82aaaa378f4b9181ae87c /configmgr
parentff245f8b8955fa3010c30e91a4c9bc94d8ba4e27 (diff)
parent99e133f3abede854db3c78e1aca60fa16ffa412b (diff)
jl152 merge with DEV300_m83
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/access.cxx14
-rw-r--r--configmgr/source/components.cxx7
-rw-r--r--configmgr/source/components.hxx5
-rw-r--r--configmgr/source/data.cxx14
-rw-r--r--configmgr/source/data.hxx5
-rw-r--r--configmgr/source/rootaccess.cxx11
-rw-r--r--configmgr/source/rootaccess.hxx2
-rw-r--r--configmgr/source/xcuparser.cxx3
8 files changed, 48 insertions, 13 deletions
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 60f6a4a54e..190db364cd 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1229,7 +1229,19 @@ rtl::OUString Access::getHierarchicalName() throw (css::uno::RuntimeException) {
OSL_ASSERT(thisIs(IS_ANY));
osl::MutexGuard g(lock);
checkLocalizedPropertyAccess();
- return getRelativePathRepresentation();
+ // For backwards compatibility, return an absolute path representation where
+ // available:
+ rtl::OUStringBuffer path;
+ rtl::Reference< RootAccess > root(getRootAccess());
+ if (root.is()) {
+ path.append(root->getAbsolutePathRepresentation());
+ }
+ rtl::OUString rel(getRelativePathRepresentation());
+ if (path.getLength() != 0 && rel.getLength() != 0) {
+ path.append(sal_Unicode('/'));
+ }
+ path.append(rel);
+ return path.makeStringAndClear();
}
rtl::OUString Access::composeHierarchicalName(
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index f7f39a9403..b0f525f1c5 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -149,11 +149,12 @@ bool Components::allLocales(rtl::OUString const & locale) {
}
rtl::Reference< Node > Components::resolvePathRepresentation(
- rtl::OUString const & pathRepresentation, Path * path,
- int * finalizedLayer) const
+ rtl::OUString const & pathRepresentation,
+ rtl::OUString * canonicRepresentation, Path * path, int * finalizedLayer)
+ const
{
return data_.resolvePathRepresentation(
- pathRepresentation, path, finalizedLayer);
+ pathRepresentation, canonicRepresentation, path, finalizedLayer);
}
rtl::Reference< Node > Components::getTemplate(
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index a78ed32596..2e635680c1 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -72,8 +72,9 @@ public:
static bool allLocales(rtl::OUString const & locale);
rtl::Reference< Node > resolvePathRepresentation(
- rtl::OUString const & pathRepresentation, Path * path,
- int * finalizedLayer) const;
+ rtl::OUString const & pathRepresentation,
+ rtl::OUString * canonicRepresenation, Path * path, int * finalizedLayer)
+ const;
rtl::Reference< Node > getTemplate(
int layer, rtl::OUString const & fullName) const;
diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx
index 5540a40fd5..e12f959694 100644
--- a/configmgr/source/data.cxx
+++ b/configmgr/source/data.cxx
@@ -205,7 +205,8 @@ rtl::Reference< Node > Data::findNode(
}
rtl::Reference< Node > Data::resolvePathRepresentation(
- rtl::OUString const & pathRepresentation, Path * path, int * finalizedLayer)
+ rtl::OUString const & pathRepresentation,
+ rtl::OUString * canonicRepresentation, Path * path, int * finalizedLayer)
const
{
if (pathRepresentation.getLength() == 0 || pathRepresentation[0] != '/') {
@@ -216,6 +217,7 @@ rtl::Reference< Node > Data::resolvePathRepresentation(
}
rtl::OUString seg;
bool setElement;
+ rtl::OUString templateName;
sal_Int32 n = parseSegment(pathRepresentation, 1, &seg, &setElement, 0);
if (n == -1 || setElement)
{
@@ -225,6 +227,7 @@ rtl::Reference< Node > Data::resolvePathRepresentation(
css::uno::Reference< css::uno::XInterface >());
}
NodeMap::const_iterator i(components.find(seg));
+ rtl::OUStringBuffer canonic;
if (path != 0) {
path->clear();
}
@@ -234,6 +237,10 @@ rtl::Reference< Node > Data::resolvePathRepresentation(
if (!p.is()) {
return p;
}
+ if (canonicRepresentation != 0) {
+ canonic.append(sal_Unicode('/'));
+ canonic.append(createSegment(templateName, seg));
+ }
if (path != 0) {
path->push_back(seg);
}
@@ -248,13 +255,16 @@ rtl::Reference< Node > Data::resolvePathRepresentation(
}
// for backwards compatibility, ignore a final slash
if (n == pathRepresentation.getLength()) {
+ if (canonicRepresentation != 0) {
+ *canonicRepresentation = canonic.makeStringAndClear();
+ }
if (finalizedLayer != 0) {
*finalizedLayer = finalized;
}
return p;
}
parent = p;
- rtl::OUString templateName;
+ templateName = rtl::OUString();
n = parseSegment(
pathRepresentation, n, &seg, &setElement, &templateName);
if (n == -1) {
diff --git a/configmgr/source/data.hxx b/configmgr/source/data.hxx
index 495ca12338..52353d066b 100644
--- a/configmgr/source/data.hxx
+++ b/configmgr/source/data.hxx
@@ -74,8 +74,9 @@ struct Data: private boost::noncopyable {
int layer, NodeMap const & map, rtl::OUString const & name);
rtl::Reference< Node > resolvePathRepresentation(
- rtl::OUString const & pathRepresentation, Path * path,
- int * finalizedLayer) const;
+ rtl::OUString const & pathRepresentation,
+ rtl::OUString * canonicRepresenation, Path * path, int * finalizedLayer)
+ const;
rtl::Reference< Node > getTemplate(
int layer, rtl::OUString const & fullName) const;
diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx
index f8ccc6a315..95a346d720 100644
--- a/configmgr/source/rootaccess.cxx
+++ b/configmgr/source/rootaccess.cxx
@@ -113,6 +113,11 @@ void RootAccess::release() throw () {
Access::release();
}
+rtl::OUString RootAccess::getAbsolutePathRepresentation() {
+ getNode(); // turn pathRepresentation_ into canonic form
+ return pathRepresentation_;
+}
+
rtl::OUString RootAccess::getLocale() const {
return locale_;
}
@@ -136,9 +141,10 @@ rtl::OUString RootAccess::getRelativePathRepresentation() {
rtl::Reference< Node > RootAccess::getNode() {
if (!node_.is()) {
+ rtl::OUString canonic;
int finalizedLayer;
node_ = getComponents().resolvePathRepresentation(
- pathRepresentation_, &path_, &finalizedLayer);
+ pathRepresentation_, &canonic, &path_, &finalizedLayer);
if (!node_.is()) {
throw css::uno::RuntimeException(
(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot find ")) +
@@ -150,6 +156,7 @@ rtl::Reference< Node > RootAccess::getNode() {
// queryInterface on it would cause trouble; therefore,
// RuntimeException.Context is left null here
}
+ pathRepresentation_ = canonic;
OSL_ASSERT(!path_.empty());
name_ = path_.back();
finalized_ = finalizedLayer != Data::NO_LAYER;
@@ -285,7 +292,7 @@ void RootAccess::commitChanges()
Modifications globalMods;
commitChildChanges(
((getComponents().resolvePathRepresentation(
- pathRepresentation_, 0, &finalizedLayer)
+ pathRepresentation_, 0, 0, &finalizedLayer)
== node_) &&
finalizedLayer == Data::NO_LAYER),
&globalMods);
diff --git a/configmgr/source/rootaccess.hxx b/configmgr/source/rootaccess.hxx
index 45d4193d70..77d945cdbb 100644
--- a/configmgr/source/rootaccess.hxx
+++ b/configmgr/source/rootaccess.hxx
@@ -78,6 +78,8 @@ public:
virtual void SAL_CALL release() throw ();
+ rtl::OUString getAbsolutePathRepresentation();
+
rtl::OUString getLocale() const;
bool isUpdate() const;
diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx
index f9f439c989..eda478b18b 100644
--- a/configmgr/source/xcuparser.cxx
+++ b/configmgr/source/xcuparser.cxx
@@ -395,7 +395,8 @@ void XcuParser::handleItem(XmlReader & reader) {
rtl::OUString path(xmldata::convertFromUtf8(attrPath));
int finalizedLayer;
rtl::Reference< Node > node(
- data_.resolvePathRepresentation(path, &path_, &finalizedLayer));
+ data_.resolvePathRepresentation(
+ path, 0, &path_, &finalizedLayer));
if (!node.is()) {
OSL_TRACE(
"configmgr unknown item %s in %s",