summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vogelheim <dvo@openoffice.org>2001-06-20 13:16:28 +0000
committerDaniel Vogelheim <dvo@openoffice.org>2001-06-20 13:16:28 +0000
commit25ca4148e9e43c19298ba2cea2c131342229ec5e (patch)
treecea0e8fc8e03201046d81911a9e479d91d607498
parent9cad287e4bab925092080557ed6e61429d936edb (diff)
#87851# sort algorithm and locale only for alphabetical and bibliography indices
(documents with indices can now be loaded and saved again)
-rw-r--r--xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx32
-rw-r--r--xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx13
-rw-r--r--xmloff/source/text/XMLIndexSourceBaseContext.cxx30
-rw-r--r--xmloff/source/text/XMLIndexSourceBaseContext.hxx13
-rw-r--r--xmloff/source/text/XMLSectionExport.cxx42
5 files changed, 66 insertions, 64 deletions
diff --git a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx
index d2b7f5750e3c..098f3d65809b 100644
--- a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx
+++ b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLIndexAlphabeticalSourceContext.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: dvo $ $Date: 2000-11-20 19:56:50 $
+ * last change: $Author: dvo $ $Date: 2001-06-20 14:16:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -137,6 +137,8 @@ const sal_Char sAPI_UseKeyAsEntry[] = "UseKeyAsEntry";
const sal_Char sAPI_UseUpperCase[] = "UseUpperCase";
const sal_Char sAPI_UseDash[] = "UseDash";
const sal_Char sAPI_UsePP[] = "UsePP";
+const sal_Char sAPI_SortAlgorithm[] = "SortAlgorithm";
+const sal_Char sAPI_Locale[] = "Locale";
TYPEINIT1( XMLIndexAlphabeticalSourceContext, XMLIndexSourceBaseContext );
@@ -169,6 +171,8 @@ XMLIndexAlphabeticalSourceContext::XMLIndexAlphabeticalSourceContext(
sUseUpperCase(RTL_CONSTASCII_USTRINGPARAM(sAPI_UseUpperCase)),
sUseDash(RTL_CONSTASCII_USTRINGPARAM(sAPI_UseDash)),
sUsePP(RTL_CONSTASCII_USTRINGPARAM(sAPI_UsePP)),
+ sSortAlgorithm(RTL_CONSTASCII_USTRINGPARAM(sAPI_SortAlgorithm)),
+ sLocale(RTL_CONSTASCII_USTRINGPARAM(sAPI_Locale)),
sIsCommaSeparated(RTL_CONSTASCII_USTRINGPARAM("IsCommaSeparated"))
{
}
@@ -245,6 +249,16 @@ void XMLIndexAlphabeticalSourceContext::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:
XMLIndexSourceBaseContext::ProcessAttribute(eParam, rValue);
break;
@@ -286,6 +300,20 @@ void XMLIndexAlphabeticalSourceContext::EndElement()
aAny.setValue(&bCommaSeparated, ::getBooleanCppuType());
rIndexPropertySet->setPropertyValue(sIsCommaSeparated, 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);
+ }
+
XMLIndexSourceBaseContext::EndElement();
}
diff --git a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx
index b091a36bee34..a51c2f729386 100644
--- a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx
+++ b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLIndexAlphabeticalSourceContext.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: dvo $ $Date: 2000-11-20 19:56:50 $
+ * last change: $Author: dvo $ $Date: 2001-06-20 14:16:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,6 +70,10 @@
#include <com/sun/star/uno/Reference.h>
#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; } }
@@ -92,6 +96,11 @@ class XMLIndexAlphabeticalSourceContext : public XMLIndexSourceBaseContext
const ::rtl::OUString sUseDash;
const ::rtl::OUString sUsePP;
const ::rtl::OUString sIsCommaSeparated;
+ const ::rtl::OUString sSortAlgorithm;
+ const ::rtl::OUString sLocale;
+
+ ::com::sun::star::lang::Locale aLocale;
+ ::rtl::OUString sAlgorithm;
::rtl::OUString sMainEntryStyleName;
sal_Bool bMainEntryStyleNameOK;
diff --git a/xmloff/source/text/XMLIndexSourceBaseContext.cxx b/xmloff/source/text/XMLIndexSourceBaseContext.cxx
index 506606aab926..3fcd4a0d8f98 100644
--- a/xmloff/source/text/XMLIndexSourceBaseContext.cxx
+++ b/xmloff/source/text/XMLIndexSourceBaseContext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLIndexSourceBaseContext.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: dvo $ $Date: 2001-06-15 17:13:32 $
+ * last change: $Author: dvo $ $Date: 2001-06-20 14:16:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -132,8 +132,6 @@ 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[] =
{
@@ -243,8 +241,6 @@ XMLIndexSourceBaseContext::XMLIndexSourceBaseContext(
bChapterIndex(sal_False),
bRelativeTabs(sal_True),
bUseLevelFormats(bLevelFormats),
- sSortAlgorithm(RTL_CONSTASCII_USTRINGPARAM(sAPI_SortAlgorithm)),
- sLocale(RTL_CONSTASCII_USTRINGPARAM(sAPI_Locale)),
sCreateFromChapter(RTL_CONSTASCII_USTRINGPARAM(sAPI_CreateFromChapter)),
sIsRelativeTabstops(RTL_CONSTASCII_USTRINGPARAM(sAPI_IsRelativeTabstops))
{
@@ -297,15 +293,6 @@ 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
@@ -322,19 +309,6 @@ 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 4e116c6613eb..78c3728d05da 100644
--- a/xmloff/source/text/XMLIndexSourceBaseContext.hxx
+++ b/xmloff/source/text/XMLIndexSourceBaseContext.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLIndexSourceBaseContext.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: dvo $ $Date: 2001-06-12 17:46:20 $
+ * last change: $Author: dvo $ $Date: 2001-06-20 14:16:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -74,10 +74,6 @@
#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; } }
@@ -127,11 +123,6 @@ 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 91fc90d0aeb0..04f2ddebc7a6 100644
--- a/xmloff/source/text/XMLSectionExport.cxx
+++ b/xmloff/source/text/XMLSectionExport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLSectionExport.cxx,v $
*
- * $Revision: 1.21 $
+ * $Revision: 1.22 $
*
- * last change: $Author: dvo $ $Date: 2001-06-15 10:37:08 $
+ * last change: $Author: dvo $ $Date: 2001-06-20 14:16:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -848,6 +848,25 @@ void XMLSectionExport::ExportAlphabeticalIndexStart(
ExportBoolean(rPropertySet, sIsCommaSeparated, sXML_comma_separated,
sal_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);
+
ExportBaseIndexSource(TEXT_SECTION_TYPE_ALPHABETICAL, rPropertySet);
}
@@ -963,25 +982,6 @@ 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)