summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2010-03-24 16:04:08 +0100
committersb <sb@openoffice.org>2010-03-24 16:04:08 +0100
commit41b28993173f98f858a90fb7d8f259e24207ccbe (patch)
treece74a26be96cf8a64f7f7ca9402518f424e9e6b1
parent22cf34ac5ea7aea96b9f50078cb4b0874f031dd6 (diff)
sb121: #i110203# use <it> in Setup.xcu string-list values; pass it through XSLT scripts intact; handle it correctly in configmgr::ValueParser
-rw-r--r--configmgr/source/valueparser.cxx22
-rw-r--r--configmgr/source/valueparser.hxx4
-rw-r--r--configmgr/source/xcsparser.cxx2
-rw-r--r--configmgr/source/xcuparser.cxx4
-rw-r--r--officecfg/registry/data/org/openoffice/Setup.xcu119
-rw-r--r--officecfg/util/alllang.xsl6
6 files changed, 74 insertions, 83 deletions
diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx
index f951aac5ca01..4adf452c409b 100644
--- a/configmgr/source/valueparser.cxx
+++ b/configmgr/source/valueparser.cxx
@@ -270,6 +270,10 @@ XmlReader::Text ValueParser::getTextMode() const {
if (node_.is()) {
switch (state_) {
case STATE_TEXT:
+ if (!items_.empty()) {
+ break;
+ }
+ // fall through
case STATE_IT:
return
(type_ == TYPE_STRING || type_ == TYPE_STRING_LIST ||
@@ -294,7 +298,9 @@ bool ValueParser::startElement(
name.equals(RTL_CONSTASCII_STRINGPARAM("it")) &&
isListType(type_) && separator_.getLength() == 0)
{
- checkEmptyPad(reader);
+ pad_.clear();
+ // before first <it>, characters are not ignored; assume they
+ // are only whitespace
state_ = STATE_IT;
return true;
}
@@ -351,7 +357,7 @@ bool ValueParser::startElement(
css::uno::Reference< css::uno::XInterface >());
}
-bool ValueParser::endElement(XmlReader const & reader) {
+bool ValueParser::endElement() {
if (!node_.is()) {
return false;
}
@@ -363,7 +369,6 @@ bool ValueParser::endElement(XmlReader const & reader) {
value = parseValue(separator_, pad_.get(), type_);
pad_.clear();
} else {
- checkEmptyPad(reader);
switch (type_) {
case TYPE_BOOLEAN_LIST:
value = convertItems< sal_Bool >();
@@ -454,17 +459,6 @@ int ValueParser::getLayer() const {
return layer_;
}
-void ValueParser::checkEmptyPad(XmlReader const & reader) const {
- if (pad_.is()) {
- throw css::uno::RuntimeException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "mixed text and <it> elements in ")) +
- reader.getUrl()),
- css::uno::Reference< css::uno::XInterface >());
- }
-}
-
template< typename T > css::uno::Any ValueParser::convertItems() {
css::uno::Sequence< T > seq(items_.size());
for (sal_Int32 i = 0; i < seq.getLength(); ++i) {
diff --git a/configmgr/source/valueparser.hxx b/configmgr/source/valueparser.hxx
index c328fe7eddce..4e899f4632dd 100644
--- a/configmgr/source/valueparser.hxx
+++ b/configmgr/source/valueparser.hxx
@@ -61,7 +61,7 @@ public:
bool startElement(
XmlReader & reader, XmlReader::Namespace ns, Span const & name);
- bool endElement(XmlReader const & reader);
+ bool endElement();
void characters(Span const & text);
@@ -75,8 +75,6 @@ public:
rtl::OString separator_;
private:
- void checkEmptyPad(XmlReader const & reader) const;
-
template< typename T > com::sun::star::uno::Any convertItems();
enum State { STATE_TEXT, STATE_TEXT_UNICODE, STATE_IT, STATE_IT_UNICODE };
diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx
index 4de9973594c1..3fc719f00fe9 100644
--- a/configmgr/source/xcsparser.cxx
+++ b/configmgr/source/xcsparser.cxx
@@ -266,7 +266,7 @@ bool XcsParser::startElement(
}
void XcsParser::endElement(XmlReader const & reader) {
- if (valueParser_.endElement(reader)) {
+ if (valueParser_.endElement()) {
return;
}
if (ignoring_ > 0) {
diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx
index 60ea59ca0248..80dc501e9435 100644
--- a/configmgr/source/xcuparser.cxx
+++ b/configmgr/source/xcuparser.cxx
@@ -209,8 +209,8 @@ bool XcuParser::startElement(
return true;
}
-void XcuParser::endElement(XmlReader const & reader) {
- if (valueParser_.endElement(reader)) {
+void XcuParser::endElement(XmlReader const &) {
+ if (valueParser_.endElement()) {
return;
}
OSL_ASSERT(!state_.empty());
diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu
index 4acf93dee764..6720ab5c37a3 100644
--- a/officecfg/registry/data/org/openoffice/Setup.xcu
+++ b/officecfg/registry/data/org/openoffice/Setup.xcu
@@ -765,12 +765,12 @@
<value>org.openoffice.Office.DataAccess</value>
</prop>
<prop oor:name="ExcludedNodes">
- <value>
- org.openoffice.Office.DataAccess/Bibliography
- org.openoffice.Office.DataAccess/ConnectionPool
- org.openoffice.Office.DataAccess/DataSources
- org.openoffice.Office.DataAccess/DriverManager
- </value>
+ <value>
+ <it>org.openoffice.Office.DataAccess/Bibliography</it>
+ <it>org.openoffice.Office.DataAccess/ConnectionPool</it>
+ <it>org.openoffice.Office.DataAccess/DataSources</it>
+ <it>org.openoffice.Office.DataAccess/DriverManager</it>
+ </value>
</prop>
</node>
<node oor:name="Deployment" oor:op="replace">
@@ -780,8 +780,7 @@
</node>
<node oor:name="Inet" oor:op="replace">
<prop oor:name="IncludedNodes">
- <value>org.openoffice.Inet
- </value>
+ <value>org.openoffice.Inet</value>
</prop>
</node>
<node oor:name="Basic" oor:op="replace">
@@ -796,63 +795,63 @@
</node>
<node oor:name="Common" oor:op="replace">
<prop oor:name="IncludedFiles">
- <value>
- .*/autotext/.*
- .*/autocorr/.*
- .*/config/.*\.so[bcdegh]
- .*/config/soffice.cfg/modules/.*/toolbar/custom.*\.xml
- .*/config/soffice.cfg/modules/.*/images/.*
- .*/gallery/.*
- .*/template/.*
+ <value>
+ <it>.*/autotext/.*</it>
+ <it>.*/autocorr/.*</it>
+ <it>.*/config/.*\.so[bcdegh]</it>
+ <it>.*/config/soffice.cfg/modules/.*/toolbar/custom.*\.xml</it>
+ <it>.*/config/soffice.cfg/modules/.*/images/.*</it>
+ <it>.*/gallery/.*</it>
+ <it>.*/template/.*</it>
</value>
</prop>
<prop oor:name="IncludedNodes">
<value>
- org.openoffice.Office.Compatibility
- org.openoffice.Office.Custom
- org.openoffice.Office.Embedding
- org.openoffice.Office.Events
- org.openoffice.Office.ExtendedColorScheme
- org.openoffice.Office.Common/Accessibility
- org.openoffice.Office.Common/Accessibility/AutoDetectSystemHC
- org.openoffice.Office.Common/AsianLayout
- org.openoffice.Office.Common/AutoCorrect
- org.openoffice.Office.Common/Cache
- org.openoffice.Office.Common/DateFormat
- org.openoffice.Office.Common/ExternalMailer/Program
- org.openoffice.Office.Common/Filter
- org.openoffice.Office.Common/Font
- org.openoffice.Office.Common/Forms
- org.openoffice.Office.Common/Gallery
- org.openoffice.Office.Common/Help
- org.openoffice.Office.Common/History
- org.openoffice.Office.Common/I18N
- org.openoffice.Office.Common/InternalMSExport
- org.openoffice.Office.Common/Load
- org.openoffice.Office.Common/Misc/FormControlPilotsEnabled
- org.openoffice.Office.Common/Misc/PluginsEnabled
- org.openoffice.Office.Common/Misc/SymbolSet
- org.openoffice.Office.Common/Misc/UseSystemFileDialog
- org.openoffice.Office.Common/Misc/UseSystemPrintDialog
- org.openoffice.Office.Common/Misc/SymbolStyle
- org.openoffice.Office.Common/Passwords
- org.openoffice.Office.Common/Print/PrintingModifiesDocument
- org.openoffice.Office.Common/Print/Warning
- org.openoffice.Office.Common/Vectorize
- org.openoffice.Office.Common/Save
- org.openoffice.Office.Common/SearchOptions
- org.openoffice.Office.Common/Undo
- org.openoffice.Office.Common/View/Dialog/Dialog/MiddleMouseButton
- org.openoffice.Office.Common/View/Dialog/MousePositioning
- org.openoffice.Office.Common/View/Localization
- org.openoffice.Office.Common/View/Menu
- org.openoffice.Office.Common/_3D_Engine
+ <it>org.openoffice.Office.Compatibility</it>
+ <it>org.openoffice.Office.Custom</it>
+ <it>org.openoffice.Office.Embedding</it>
+ <it>org.openoffice.Office.Events</it>
+ <it>org.openoffice.Office.ExtendedColorScheme</it>
+ <it>org.openoffice.Office.Common/Accessibility</it>
+ <it>org.openoffice.Office.Common/Accessibility/AutoDetectSystemHC</it>
+ <it>org.openoffice.Office.Common/AsianLayout</it>
+ <it>org.openoffice.Office.Common/AutoCorrect</it>
+ <it>org.openoffice.Office.Common/Cache</it>
+ <it>org.openoffice.Office.Common/DateFormat</it>
+ <it>org.openoffice.Office.Common/ExternalMailer/Program</it>
+ <it>org.openoffice.Office.Common/Filter</it>
+ <it>org.openoffice.Office.Common/Font</it>
+ <it>org.openoffice.Office.Common/Forms</it>
+ <it>org.openoffice.Office.Common/Gallery</it>
+ <it>org.openoffice.Office.Common/Help</it>
+ <it>org.openoffice.Office.Common/History</it>
+ <it>org.openoffice.Office.Common/I18N</it>
+ <it>org.openoffice.Office.Common/InternalMSExport</it>
+ <it>org.openoffice.Office.Common/Load</it>
+ <it>org.openoffice.Office.Common/Misc/FormControlPilotsEnabled</it>
+ <it>org.openoffice.Office.Common/Misc/PluginsEnabled</it>
+ <it>org.openoffice.Office.Common/Misc/SymbolSet</it>
+ <it>org.openoffice.Office.Common/Misc/UseSystemFileDialog</it>
+ <it>org.openoffice.Office.Common/Misc/UseSystemPrintDialog</it>
+ <it>org.openoffice.Office.Common/Misc/SymbolStyle</it>
+ <it>org.openoffice.Office.Common/Passwords</it>
+ <it>org.openoffice.Office.Common/Print/PrintingModifiesDocument</it>
+ <it>org.openoffice.Office.Common/Print/Warning</it>
+ <it>org.openoffice.Office.Common/Vectorize</it>
+ <it>org.openoffice.Office.Common/Save</it>
+ <it>org.openoffice.Office.Common/SearchOptions</it>
+ <it>org.openoffice.Office.Common/Undo</it>
+ <it>org.openoffice.Office.Common/View/Dialog/Dialog/MiddleMouseButton</it>
+ <it>org.openoffice.Office.Common/View/Dialog/MousePositioning</it>
+ <it>org.openoffice.Office.Common/View/Localization</it>
+ <it>org.openoffice.Office.Common/View/Menu</it>
+ <it>org.openoffice.Office.Common/_3D_Engine</it>
</value>
</prop>
<prop oor:name="ExcludedNodes">
<value>
- org.openoffice.Office.Common/_3D_Engine/OpenGL
- org.openoffice.Office.Common/Help/Registration
+ <it>org.openoffice.Office.Common/_3D_Engine/OpenGL</it>
+ <it>org.openoffice.Office.Common/Help/Registration</it>
</value>
</prop>
</node>
@@ -910,9 +909,9 @@
<node oor:name="Writer" oor:op="replace">
<prop oor:name="IncludedNodes">
<value>
- org.openoffice.Office.Writer
- org.openoffice.Office.WriterWeb
- </value>
+ <it>org.openoffice.Office.Writer</it>
+ <it>org.openoffice.Office.WriterWeb</it>
+ </value>
</prop>
<prop oor:name="ExcludedNodes">
<value>org.openoffice.Office.Writer/Wizard</value>
diff --git a/officecfg/util/alllang.xsl b/officecfg/util/alllang.xsl
index 339c6685fa0e..dafb45c85c11 100644
--- a/officecfg/util/alllang.xsl
+++ b/officecfg/util/alllang.xsl
@@ -100,7 +100,7 @@
<xsl:if test="@xml:lang=$locale and not(@install:module)">
<xsl:copy>
<xsl:apply-templates select = "@*" mode="locale"/>
- <xsl:value-of select="."/>
+ <xsl:copy-of select="node()"/>
</xsl:copy>
</xsl:if>
</xsl:template>
@@ -275,7 +275,7 @@
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select = "@*"/>
- <xsl:value-of select="."/>
+ <xsl:copy-of select="node()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
@@ -285,7 +285,7 @@
<xsl:if test="@xml:lang=$fallback-locale and not(@install:module)">
<xsl:copy>
<xsl:apply-templates select = "@*"/>
- <xsl:value-of select="."/>
+ <xsl:copy-of select="node()"/>
</xsl:copy>
</xsl:if>
</xsl:template>