summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vogelheim <dvo@openoffice.org>2001-06-12 16:46:20 +0000
committerDaniel Vogelheim <dvo@openoffice.org>2001-06-12 16:46:20 +0000
commita98f6b275f40dc8166783ca6a0268e80e2e9e577 (patch)
treec2ba814b74f83a5073c3d8b9f35e20d8a6e1c764
parent6f412bfba04acc6fa76ca8e6bfbac402235ac878 (diff)
#87851# sort algorithm for indices imported and exported
-rw-r--r--xmloff/dtd/text.mod23
-rw-r--r--xmloff/inc/XMLIndexBibliographyConfigurationContext.hxx20
-rw-r--r--xmloff/inc/xmlkywd.hxx6
-rw-r--r--xmloff/source/core/xmltoken.cxx6
-rw-r--r--xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx85
-rw-r--r--xmloff/source/text/XMLIndexSourceBaseContext.cxx36
-rw-r--r--xmloff/source/text/XMLIndexSourceBaseContext.hxx18
-rw-r--r--xmloff/source/text/XMLSectionExport.cxx59
-rw-r--r--xmloff/source/text/XMLSectionExport.hxx6
9 files changed, 215 insertions, 44 deletions
diff --git a/xmloff/dtd/text.mod b/xmloff/dtd/text.mod
index e08b3ebf220c..371f236ffe57 100644
--- a/xmloff/dtd/text.mod
+++ b/xmloff/dtd/text.mod
@@ -1,5 +1,5 @@
<!--
- $Id: text.mod,v 1.32 2001-05-29 12:32:57 dvo Exp $
+ $Id: text.mod,v 1.33 2001-06-12 17:46:19 dvo Exp $
The Contents of this file are made available subject to the terms of
either of the following licenses
@@ -760,6 +760,9 @@
"document">
<!ATTLIST text:table-of-content-source text:relative-tab-stop-position
%boolean; "true">
+<!ATTLIST text:table-of-content-source fo:language %string; #IMPLIED>
+<!ATTLIST text:table-of-content-source fo:country %string; #IMPLIED>
+<!ATTLIST text:table-of-content-source text:sort-algorithm %string; #IMPLIED>
<!ELEMENT text:table-of-content-entry-template (text:index-entry-chapter-number |
text:index-entry-page-number |
@@ -789,6 +792,9 @@
%string; #IMPLIED>
<!ATTLIST text:illustration-index-source text:caption-sequence-format
(text|category-and-value|caption) "text">
+<!ATTLIST text:illustration-index-source fo:language %string; #IMPLIED>
+<!ATTLIST text:illustration-index-source fo:country %string; #IMPLIED>
+<!ATTLIST text:illustration-index-source text:sort-algorithm %string; #IMPLIED>
<!ELEMENT text:illustration-index-entry-template
( text:index-entry-page-number |
@@ -813,6 +819,9 @@
%string; #IMPLIED>
<!ATTLIST text:table-index-source text:caption-sequence-format
(text|category-and-value|caption) "text">
+<!ATTLIST text:table-index-source fo:language %string; #IMPLIED>
+<!ATTLIST text:table-index-source fo:country %string; #IMPLIED>
+<!ATTLIST text:table-index-source text:sort-algorithm %string; #IMPLIED>
<!ELEMENT text:table-index-entry-template ( text:index-entry-page-number |
text:index-entry-text |
@@ -837,6 +846,9 @@
<!ATTLIST text:object-index-source text:use-chart-objects %boolean; "false">
<!ATTLIST text:object-index-source text:use-other-objects %boolean; "false">
<!ATTLIST text:object-index-source text:use-math-objects %boolean; "false">
+<!ATTLIST text:object-index-source fo:language %string; #IMPLIED>
+<!ATTLIST text:object-index-source fo:country %string; #IMPLIED>
+<!ATTLIST text:object-index-source text:sort-algorithm %string; #IMPLIED>
<!ELEMENT text:object-index-entry-template ( text:index-entry-page-number |
text:index-entry-text |
@@ -864,6 +876,9 @@
<!ATTLIST text:user-index-source text:use-index-source-styles
%boolean; "false">
<!ATTLIST text:user-index-source text:copy-outline-level %boolean; "false">
+<!ATTLIST text:user-index-source fo:language %string; #IMPLIED>
+<!ATTLIST text:user-index-source fo:country %string; #IMPLIED>
+<!ATTLIST text:user-index-source text:sort-algorithm %string; #IMPLIED>
<!ELEMENT text:user-index-entry-template ( text:index-entry-chapter |
text:index-entry-page-number |
@@ -901,6 +916,9 @@
%boolean; "false">
<!ATTLIST text:alphabetical-index-source text:comma-separated
%boolean; "false">
+<!ATTLIST text:alphabetical-index-source fo:language %string; #IMPLIED>
+<!ATTLIST text:alphabetical-index-source fo:country %string; #IMPLIED>
+<!ATTLIST text:alphabetical-index-source text:sort-algorithm %string; #IMPLIED>
<!ELEMENT text:alphabetical-index-entry-template ( text:index-entry-chapter |
text:index-entry-page-number |
@@ -1039,6 +1057,9 @@ indices, and there may be only one text:index-title element.
<!ATTLIST text:bibliography-configuration text:suffix %string; #IMPLIED>
<!ATTLIST text:bibliography-configuration text:sort-by-position %boolean; "true">
<!ATTLIST text:bibliography-configuration text:numbered-entries %boolean; "false">
+<!ATTLIST text:bibliography-configuration fo:language %string; #IMPLIED>
+<!ATTLIST text:bibliography-configuration fo:country %string; #IMPLIED>
+<!ATTLIST text:bibliography-configuration text:sort-algorithm %string; #IMPLIED>
<!ELEMENT text:sort-key EMPTY>
<!ATTLIST text:sort-key text:key ( address | annote | author |
diff --git a/xmloff/inc/XMLIndexBibliographyConfigurationContext.hxx b/xmloff/inc/XMLIndexBibliographyConfigurationContext.hxx
index 8c9825f70eea..1fe03daff9b1 100644
--- a/xmloff/inc/XMLIndexBibliographyConfigurationContext.hxx
+++ b/xmloff/inc/XMLIndexBibliographyConfigurationContext.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLIndexBibliographyConfigurationContext.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: dvo $ $Date: 2001-01-25 11:35:25 $
+ * last change: $Author: dvo $ $Date: 2001-06-12 17:46:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,12 +78,21 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#endif
+#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_
+#include <com/sun/star/lang/Locale.hpp>
+#endif
+
+#ifndef _RTL_USTRING_HXX_
+#include <rtl/ustring.hxx>
+#endif
+
+
#include <vector>
namespace com { namespace sun { namespace star {
namespace xml { namespace sax { class XAttributeList; } }
} } }
-namespace rtl { class OUString; }
+
/**
* Import bibliography configuration.
@@ -100,9 +109,13 @@ class XMLIndexBibliographyConfigurationContext : public SvXMLStyleContext
const ::rtl::OUString sSortKeys;
const ::rtl::OUString sSortKey;
const ::rtl::OUString sIsSortAscending;
+ const ::rtl::OUString sSortAlgorithm;
+ const ::rtl::OUString sLocale;
::rtl::OUString sSuffix;
::rtl::OUString sPrefix;
+ ::rtl::OUString sAlgorithm;
+ ::com::sun::star::lang::Locale aLocale;
sal_Bool bNumberedEntries;
sal_Bool bSortByPosition;
@@ -137,6 +150,7 @@ protected:
::com::sun::star::xml::sax::XAttributeList> & xAttrList );
void ProcessAttribute(
+ sal_uInt16 nPrefix,
const ::rtl::OUString sLocalName,
const ::rtl::OUString sValue);
};
diff --git a/xmloff/inc/xmlkywd.hxx b/xmloff/inc/xmlkywd.hxx
index 8f380fc7c5cf..b2a7ab0b0d9b 100644
--- a/xmloff/inc/xmlkywd.hxx
+++ b/xmloff/inc/xmlkywd.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlkywd.hxx,v $
*
- * $Revision: 1.165 $
+ * $Revision: 1.166 $
*
- * last change: $Author: bm $ $Date: 2001-06-05 16:05:21 $
+ * last change: $Author: dvo $ $Date: 2001-06-12 17:46:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2015,4 +2015,6 @@ XML_CONSTASCII_ACTION( sXML_escape_direction, "escape-direction" );
XML_CONSTASCII_ACTION( sXML_glue_point, "glue-point" );
XML_CONSTASCII_ACTION( sXML_text_style_name, "text-style-name" );
+
+XML_CONSTASCII_ACTION( sXML_sort_algorithm, "sort-algorithm" );
#endif
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 7d83ae28b40a..8cc45bdf3eb5 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmltoken.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: bm $ $Date: 2001-06-05 16:05:43 $
+ * last change: $Author: dvo $ $Date: 2001-06-12 17:46:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1985,7 +1985,7 @@ namespace xmloff { namespace token {
TOKEN( "use-regular-expressions" ), // XML_USE_REGULAR_EXPRESSIONS
TOKEN( "data-source-has-labels" ), // XML_DATA_SOURCE_HAS_LABELS
TOKEN( "link-data-style-to-source" ), // XML_LINK_DATA_STYLE_TO_SOURCE
-
+ TOKEN( "sort-algorithm" ), // XML_SORT_ALGORITHM
{ 0, NULL, NULL } // XML_TOKEN_END
};
diff --git a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
index eb4f6f8d8987..bb8c0ebb03e2 100644
--- a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
+++ b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLIndexBibliographyConfigurationContext.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: sab $ $Date: 2001-03-21 10:52:49 $
+ * last change: $Author: dvo $ $Date: 2001-06-12 17:46:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -92,6 +92,10 @@
#include "xmlkywd.hxx"
#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include "xmltoken.hxx"
+#endif
+
#ifndef _XMLOFF_XMLUCONV_HXX
#include "xmluconv.hxx"
#endif
@@ -114,6 +118,7 @@
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::uno;
+using namespace ::xmloff::token;
using ::rtl::OUString;
using ::com::sun::star::xml::sax::XAttributeList;
@@ -142,8 +147,12 @@ XMLIndexBibliographyConfigurationContext::XMLIndexBibliographyConfigurationConte
sSortKeys(RTL_CONSTASCII_USTRINGPARAM("SortKeys")),
sSortKey(RTL_CONSTASCII_USTRINGPARAM("SortKey")),
sIsSortAscending(RTL_CONSTASCII_USTRINGPARAM("IsSortAscending")),
+ sSortAlgorithm(RTL_CONSTASCII_USTRINGPARAM("SortAlgorithm")),
+ sLocale(RTL_CONSTASCII_USTRINGPARAM("Locale")),
sSuffix(),
sPrefix(),
+ sAlgorithm(),
+ aLocale(),
bNumberedEntries(sal_False),
bSortByPosition(sal_True)
{
@@ -164,42 +173,57 @@ void XMLIndexBibliographyConfigurationContext::StartElement(
GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
&sLocalName );
- if (nPrefix == XML_NAMESPACE_TEXT)
- {
- ProcessAttribute(sLocalName, xAttrList->getValueByIndex(nAttr));
- }
+ ProcessAttribute(nPrefix, sLocalName,
+ xAttrList->getValueByIndex(nAttr));
// else: ignore
}
}
void XMLIndexBibliographyConfigurationContext::ProcessAttribute(
+ sal_uInt16 nPrefix,
OUString sLocalName,
OUString sValue)
{
- if (sLocalName.equalsAsciiL(sXML_prefix, sizeof(sXML_prefix)-1))
- {
- sPrefix = sValue;
- }
- else if (sLocalName.equalsAsciiL(sXML_suffix, sizeof(sXML_suffix)-1))
+ if( XML_NAMESPACE_TEXT == nPrefix )
{
- sSuffix = sValue;
- }
- else if (sLocalName.equalsAsciiL(sXML_numbered_entries,
- sizeof(sXML_numbered_entries)-1))
- {
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(bTmp, sValue))
+ if( IsXMLToken(sLocalName, XML_PREFIX) )
+ {
+ sPrefix = sValue;
+ }
+ else if( IsXMLToken(sLocalName, XML_SUFFIX) )
{
- bNumberedEntries = bTmp;
+ sSuffix = sValue;
+ }
+ else if( IsXMLToken(sLocalName, XML_NUMBERED_ENTRIES) )
+ {
+ sal_Bool bTmp;
+ if( SvXMLUnitConverter::convertBool(bTmp, sValue) )
+ {
+ bNumberedEntries = bTmp;
+ }
+ }
+ else if( IsXMLToken(sLocalName, XML_SORT_BY_POSITION) )
+ {
+ sal_Bool bTmp;
+ if (SvXMLUnitConverter::convertBool(bTmp, sValue))
+ {
+ bSortByPosition = bTmp;
+ }
+ }
+ else if( IsXMLToken(sLocalName, XML_SORT_ALGORITHM) )
+ {
+ sAlgorithm = sValue;
}
}
- else if (sLocalName.equalsAsciiL(sXML_sort_by_position,
- sizeof(sXML_sort_by_position)-1))
+ else if( XML_NAMESPACE_FO == nPrefix )
{
- sal_Bool bTmp;
- if (SvXMLUnitConverter::convertBool(bTmp, sValue))
+ if( IsXMLToken(sLocalName, XML_LANGUAGE) )
+ {
+ aLocale.Language = sValue;
+ }
+ else if( IsXMLToken(sLocalName, XML_COUNTRY) )
{
- bSortByPosition = bTmp;
+ aLocale.Country = sValue;
}
}
}
@@ -325,6 +349,19 @@ void XMLIndexBibliographyConfigurationContext::CreateAndInsert(
aAny.setValue(&bSortByPosition, ::getBooleanCppuType());
xPropSet->setPropertyValue(sIsSortByPosition, aAny);
+ if( (aLocale.Language.getLength() > 0) &&
+ (aLocale.Country.getLength() > 0) )
+ {
+ aAny <<= aLocale;
+ xPropSet->setPropertyValue(sLocale, aAny);
+ }
+
+ if( sAlgorithm.getLength() > 0 )
+ {
+ aAny <<= sAlgorithm;
+ xPropSet->setPropertyValue(sSortAlgorithm, aAny);
+ }
+
sal_Int32 nCount = aSortKeys.size();
Sequence<Sequence<PropertyValue> > aKeysSeq(nCount);
for(sal_Int32 i = 0; i < nCount; i++)
diff --git a/xmloff/source/text/XMLIndexSourceBaseContext.cxx b/xmloff/source/text/XMLIndexSourceBaseContext.cxx
index c57fc3f80b04..abb9690d87b8 100644
--- a/xmloff/source/text/XMLIndexSourceBaseContext.cxx
+++ b/xmloff/source/text/XMLIndexSourceBaseContext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLIndexSourceBaseContext.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: dvo $ $Date: 2001-01-02 14:41:37 $
+ * last change: $Author: dvo $ $Date: 2001-06-12 17:46:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -131,6 +131,8 @@ using ::com::sun::star::xml::sax::XAttributeList;
const sal_Char sAPI_CreateFromChapter[] = "CreateFromChapter";
const sal_Char sAPI_IsRelativeTabstops[] = "IsRelativeTabstops";
+const sal_Char sAPI_SortAlgorithm[] = "SortAlgorithm";
+const sal_Char sAPI_Locale[] = "Locale";
static __FAR_DATA SvXMLTokenMapEntry aIndexSourceTokenMap[] =
{
@@ -218,6 +220,10 @@ static __FAR_DATA SvXMLTokenMapEntry aIndexSourceTokenMap[] =
{ XML_NAMESPACE_TEXT,
sXML_use_index_source_styles,
XML_TOK_INDEXSOURCE_USE_INDEX_SOURCE_STYLES },
+ { XML_NAMESPACE_TEXT, sXML_sort_algorithm,
+ XML_TOK_INDEXSOURCE_SORT_ALGORITHM },
+ { XML_NAMESPACE_FO, sXML_language, XML_TOK_INDEXSOURCE_LANGUAGE },
+ { XML_NAMESPACE_FO, sXML_country, XML_TOK_INDEXSOURCE_COUNTRY },
XML_TOKEN_MAP_END
};
@@ -236,7 +242,9 @@ XMLIndexSourceBaseContext::XMLIndexSourceBaseContext(
bChapterIndex(sal_False),
bRelativeTabs(sal_True),
bUseLevelFormats(bLevelFormats),
- sCreateFromChapter(RTL_CONSTASCII_USTRINGPARAM(sAPI_CreateFromChapter)),
+ sSortAlgorithm(RTL_CONSTASCII_USTRINGPARAM(sAPI_SortAlgorithm)),
+ sLocale(RTL_CONSTASCII_USTRINGPARAM(sAPI_Locale)),
+ sCreateFromChapter(RTL_CONSTASCII_USTRINGPARAM(sAPI_CreateFromChapter)),
sIsRelativeTabstops(RTL_CONSTASCII_USTRINGPARAM(sAPI_IsRelativeTabstops))
{
}
@@ -288,6 +296,15 @@ void XMLIndexSourceBaseContext::ProcessAttribute(
}
break;
}
+ case XML_TOK_INDEXSOURCE_SORT_ALGORITHM:
+ sAlgorithm = rValue;
+ break;
+ case XML_TOK_INDEXSOURCE_LANGUAGE:
+ aLocale.Language = rValue;
+ break;
+ case XML_TOK_INDEXSOURCE_COUNTRY:
+ aLocale.Country = rValue;
+ break;
default:
// unknown attribute -> ignore
@@ -304,6 +321,19 @@ void XMLIndexSourceBaseContext::EndElement()
aAny.setValue(&bChapterIndex, ::getBooleanCppuType());
rIndexPropertySet->setPropertyValue(sCreateFromChapter, aAny);
+
+ if (sAlgorithm.getLength() > 0)
+ {
+ aAny <<= sAlgorithm;
+ rIndexPropertySet->setPropertyValue(sSortAlgorithm, aAny);
+ }
+
+ if ( (aLocale.Language.getLength() > 0) &&
+ (aLocale.Country.getLength() > 0) )
+ {
+ aAny <<= aLocale;
+ rIndexPropertySet->setPropertyValue(sLocale, aAny);
+ }
}
SvXMLImportContext* XMLIndexSourceBaseContext::CreateChildContext(
diff --git a/xmloff/source/text/XMLIndexSourceBaseContext.hxx b/xmloff/source/text/XMLIndexSourceBaseContext.hxx
index 66e2e40c4029..4e116c6613eb 100644
--- a/xmloff/source/text/XMLIndexSourceBaseContext.hxx
+++ b/xmloff/source/text/XMLIndexSourceBaseContext.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLIndexSourceBaseContext.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: dvo $ $Date: 2000-11-21 11:53:19 $
+ * last change: $Author: dvo $ $Date: 2001-06-12 17:46:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -74,6 +74,10 @@
#include <rtl/ustring.hxx>
#endif
+#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_
+#include <com/sun/star/lang/Locale.hpp>
+#endif
+
namespace com { namespace sun { namespace star {
namespace xml { namespace sax { class XAttributeList; } }
@@ -109,7 +113,10 @@ enum IndexSourceParamEnum
XML_TOK_INDEXSOURCE_SEQUENCE_NAME,
XML_TOK_INDEXSOURCE_SEQUENCE_FORMAT,
XML_TOK_INDEXSOURCE_COMMA_SEPARATED,
- XML_TOK_INDEXSOURCE_USE_INDEX_SOURCE_STYLES
+ XML_TOK_INDEXSOURCE_USE_INDEX_SOURCE_STYLES,
+ XML_TOK_INDEXSOURCE_SORT_ALGORITHM,
+ XML_TOK_INDEXSOURCE_LANGUAGE,
+ XML_TOK_INDEXSOURCE_COUNTRY
};
@@ -120,6 +127,11 @@ class XMLIndexSourceBaseContext : public SvXMLImportContext
{
const ::rtl::OUString sCreateFromChapter;
const ::rtl::OUString sIsRelativeTabstops;
+ const ::rtl::OUString sSortAlgorithm;
+ const ::rtl::OUString sLocale;
+
+ ::com::sun::star::lang::Locale aLocale;
+ ::rtl::OUString sAlgorithm;
sal_Bool bUseLevelFormats;
diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx
index 05ef1ed4f97b..04a02dc1d67f 100644
--- a/xmloff/source/text/XMLSectionExport.cxx
+++ b/xmloff/source/text/XMLSectionExport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLSectionExport.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: dvo $ $Date: 2001-05-31 16:11:06 $
+ * last change: $Author: dvo $ $Date: 2001-06-12 17:46:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -82,6 +82,10 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#endif
+#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_
+#include <com/sun/star/lang/Locale.hpp>
+#endif
+
#ifndef _COM_SUN_STAR_CONTAINER_XINDEXREPLACE_HPP_
#include <com/sun/star/container/XIndexReplace.hpp>
#endif
@@ -142,6 +146,10 @@
#include "xmlkywd.hxx"
#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include "xmltoken.hxx"
+#endif
+
#ifndef _XMLOFF_XMLNMSPE_HXX
#include "xmlnmspe.hxx"
#endif
@@ -178,6 +186,7 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::uno;
using namespace ::std;
+using namespace ::xmloff::token;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -189,6 +198,7 @@ using ::com::sun::star::container::XIndexReplace;
using ::com::sun::star::container::XNameAccess;
using ::com::sun::star::container::XNamed;
using ::com::sun::star::lang::XServiceInfo;
+using ::com::sun::star::lang::Locale;
using ::com::sun::star::uno::XInterface;
@@ -260,6 +270,8 @@ XMLSectionExport::XMLSectionExport(
sTextSection(RTL_CONSTASCII_USTRINGPARAM("TextSection")),
sIsGlobalDocumentSection(RTL_CONSTASCII_USTRINGPARAM("IsGlobalDocumentSection")),
sProtectionKey(RTL_CONSTASCII_USTRINGPARAM("ProtectionKey")),
+ sSortAlgorithm(RTL_CONSTASCII_USTRINGPARAM("SortAlgorithm")),
+ sLocale(RTL_CONSTASCII_USTRINGPARAM("Locale")),
sEmpty()
{
}
@@ -951,6 +963,25 @@ void XMLSectionExport::ExportBaseIndexSource(
sXML_relative_tab_stop_position,
sXML_false);
}
+
+ // sort algorithm
+ aAny = rPropertySet->getPropertyValue(sSortAlgorithm);
+ OUString sAlgorithm;
+ aAny >>= sAlgorithm;
+ if (sAlgorithm.getLength() > 0)
+ {
+ GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_SORT_ALGORITHM,
+ sAlgorithm );
+ }
+
+ // locale
+ aAny = rPropertySet->getPropertyValue(sLocale);
+ Locale aLocale;
+ aAny >>= aLocale;
+ GetExport().AddAttribute(XML_NAMESPACE_FO, XML_LANGUAGE,
+ aLocale.Language);
+ GetExport().AddAttribute(XML_NAMESPACE_FO, XML_COUNTRY,
+ aLocale.Country);
}
// the index source element (all indices)
@@ -1644,6 +1675,10 @@ void XMLSectionExport::ExportBibliographyConfiguration(SvXMLExport& rExport)
RTL_CONSTASCII_USTRINGPARAM("IsSortByPosition"));
const OUString sSortKeys(
RTL_CONSTASCII_USTRINGPARAM("SortKeys"));
+ const OUString sSortAlgorithm(
+ RTL_CONSTASCII_USTRINGPARAM("SortAlgorithm"));
+ const OUString sLocale(
+ RTL_CONSTASCII_USTRINGPARAM("Locale"));
OUString sTmp;
@@ -1669,8 +1704,26 @@ void XMLSectionExport::ExportBibliographyConfiguration(SvXMLExport& rExport)
sXML_sort_by_position, sXML_false);
}
- // configuration elementXML_CONSTASCII_ACTION( sXML_suffix, "suffix" );
+ // sort algorithm
+ aAny = xPropSet->getPropertyValue(sSortAlgorithm);
+ OUString sAlgorithm;
+ aAny >>= sAlgorithm;
+ if( sAlgorithm.getLength() > 0 )
+ {
+ rExport.AddAttribute( XML_NAMESPACE_TEXT,
+ XML_SORT_ALGORITHM, sAlgorithm );
+ }
+
+ // locale
+ aAny = xPropSet->getPropertyValue(sLocale);
+ Locale aLocale;
+ aAny >>= aLocale;
+ rExport.AddAttribute(XML_NAMESPACE_FO, XML_LANGUAGE,
+ aLocale.Language);
+ rExport.AddAttribute(XML_NAMESPACE_FO, XML_COUNTRY,
+ aLocale.Country);
+ // configuration element
SvXMLElementExport aElement(rExport, XML_NAMESPACE_TEXT,
sXML_bibliography_configuration,
sal_True, sal_True);
diff --git a/xmloff/source/text/XMLSectionExport.hxx b/xmloff/source/text/XMLSectionExport.hxx
index 45658a38666b..95a1b3612b35 100644
--- a/xmloff/source/text/XMLSectionExport.hxx
+++ b/xmloff/source/text/XMLSectionExport.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLSectionExport.hxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: dvo $ $Date: 2001-05-02 15:04:56 $
+ * last change: $Author: dvo $ $Date: 2001-06-12 17:46:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -184,6 +184,8 @@ class XMLSectionExport
const ::rtl::OUString sTextSection;
const ::rtl::OUString sIsGlobalDocumentSection;
const ::rtl::OUString sProtectionKey;
+ const ::rtl::OUString sSortAlgorithm;
+ const ::rtl::OUString sLocale;
const ::rtl::OUString sEmpty;