summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorDaniel Vogelheim <dvo@openoffice.org>2001-05-29 11:32:58 +0000
committerDaniel Vogelheim <dvo@openoffice.org>2001-05-29 11:32:58 +0000
commitff7f86555334668938db818cd31c42c2902f378e (patch)
treed9f36735f9be60af0a894f32cfdd2c33e468cb82 /xmloff
parentf1a2da716a51da3c8f3d8bb480ed376fb34b511b (diff)
#87316# load/save protected attribute for indices
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/dtd/text.mod9
-rw-r--r--xmloff/source/text/XMLIndexTOCContext.cxx40
-rw-r--r--xmloff/source/text/XMLIndexTOCContext.hxx5
-rw-r--r--xmloff/source/text/XMLSectionExport.cxx12
4 files changed, 49 insertions, 17 deletions
diff --git a/xmloff/dtd/text.mod b/xmloff/dtd/text.mod
index 97890a9dbc96..e08b3ebf220c 100644
--- a/xmloff/dtd/text.mod
+++ b/xmloff/dtd/text.mod
@@ -1,5 +1,5 @@
<!--
- $Id: text.mod,v 1.31 2001-05-07 12:06:55 dvo Exp $
+ $Id: text.mod,v 1.32 2001-05-29 12:32:57 dvo Exp $
The Contents of this file are made available subject to the terms of
either of the following licenses
@@ -747,6 +747,7 @@
<!ELEMENT text:table-of-content (text:table-of-content-source,
text:index-body) >
<!ATTLIST text:table-of-content text:style-name %styleName; #IMPLIED>
+<!ATTLIST text:table-of-content text:protected %boolean; "false">
<!ELEMENT text:table-of-content-source (text:index-title-template? ,
text:table-of-content-entry-template*,
@@ -775,6 +776,7 @@
<!ELEMENT text:illustration-index
(text:illustration-index-source, text:index-body)>
<!ATTLIST text:illustration-index text:style-name %styleName; #IMPLIED>
+<!ATTLIST text:illustration-index text:protected %boolean; "false">
<!ELEMENT text:illustration-index-source (text:index-title-template?,
text:illustration-index-entry-template?) >
@@ -798,6 +800,7 @@
<!ELEMENT text:table-index (text:table-index-source, text:index-body)>
<!ATTLIST text:table-index text:style-name %styleName; #IMPLIED>
+<!ATTLIST text:table-index text:protected %boolean; "false">
<!ELEMENT text:table-index-source (text:index-title-template?,
text:table-index-entry-template?) >
@@ -820,6 +823,7 @@
<!ELEMENT text:object-index ( text:object-index-source, text:index-body ) >
<!ATTLIST text:object-index text:style-name %styleName; #IMPLIED>
+<!ATTLIST text:object-index text:protected %boolean; "false">
<!ELEMENT text:object-index-source ( text:index-title-template?,
text:object-index-entry-template? ) >
@@ -843,6 +847,7 @@
<!ELEMENT text:user-index (text:user-index-source, text:index-body) >
<!ATTLIST text:user-index text:style-name %styleName; #IMPLIED>
+<!ATTLIST text:user-index text:protected %boolean; "false">
<!ELEMENT text:user-index-source ( text:index-title-template?,
text:user-index-entry-template*,
@@ -871,6 +876,7 @@
<!ELEMENT text:alphabetical-index (text:alphabetical-index-source,
text:index-body)>
<!ATTLIST text:alphabetical-index text:style-name %styleName; #IMPLIED>
+<!ATTLIST text:alphabetical-index text:protected %boolean; "false">
<!ELEMENT text:alphabetical-index-source ( text:index-title-template?,
text:alphabetical-index-entry-template* ) >
@@ -912,6 +918,7 @@
<!ELEMENT text:bibliography (text:bibliography-source, text:index-body) >
<!ATTLIST text:bibliography text:style-name %styleName; #IMPLIED>
+<!ATTLIST text:bibliography text:protected %boolean; "false">
<!ELEMENT text:bibliography-source ( text:index-title-template?,
text:bibliography-entry-template* ) >
diff --git a/xmloff/source/text/XMLIndexTOCContext.cxx b/xmloff/source/text/XMLIndexTOCContext.cxx
index 4e3060ee08ba..61cab7dcab19 100644
--- a/xmloff/source/text/XMLIndexTOCContext.cxx
+++ b/xmloff/source/text/XMLIndexTOCContext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLIndexTOCContext.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-05-29 12:32:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -219,7 +219,8 @@ XMLIndexTOCContext::XMLIndexTOCContext(
SvXMLImportContext(rImport, nPrfx, rLocalName),
pSourceElementName(NULL),
bValid(sal_False),
- sTitle(RTL_CONSTASCII_USTRINGPARAM("Title"))
+ sTitle(RTL_CONSTASCII_USTRINGPARAM("Title")),
+ sIsProtected(RTL_CONSTASCII_USTRINGPARAM("IsProtected"))
{
if (XML_NAMESPACE_TEXT == nPrfx)
{
@@ -376,26 +377,43 @@ void XMLIndexTOCContext::StartElement(
}
// find text:style-name attribute and set section style
+ // find text:protected and set value
sal_Int16 nCount = xAttrList->getLength();
+ sal_Bool bProtected = sal_False;
for(sal_Int16 nAttr = 0; nAttr < nCount; nAttr++)
{
OUString sLocalName;
sal_uInt16 nPrefix = GetImport().GetNamespaceMap().
GetKeyByAttrName( xAttrList->getNameByIndex(nAttr),
&sLocalName );
- if ( (XML_NAMESPACE_TEXT == nPrefix) &&
- (sLocalName.equalsAsciiL(sXML_style_name,
- sizeof(sXML_style_name)-1)) )
+ if ( XML_NAMESPACE_TEXT == nPrefix)
{
- XMLPropStyleContext* pStyle =
- GetImport().GetTextImport()->FindSectionStyle(
- xAttrList->getValueByIndex(nAttr));
- if (pStyle != NULL)
+ if ( sLocalName.equalsAsciiL(sXML_style_name,
+ sizeof(sXML_style_name)-1) )
{
- pStyle->FillPropertySet( xTOCPropertySet );
+ XMLPropStyleContext* pStyle =
+ GetImport().GetTextImport()->FindSectionStyle(
+ xAttrList->getValueByIndex(nAttr));
+ if (pStyle != NULL)
+ {
+ pStyle->FillPropertySet( xTOCPropertySet );
+ }
+ }
+ else if ( sLocalName.equalsAsciiL(sXML_protected,
+ sizeof(sXML_protected)-1) )
+ {
+ sal_Bool bTmp;
+ if ( SvXMLUnitConverter::convertBool(
+ bTmp, xAttrList->getValueByIndex(nAttr) ) )
+ {
+ bProtected = bTmp;
+ }
}
}
}
+ Any aAny;
+ aAny.setValue( &bProtected, ::getBooleanCppuType() );
+ xTOCPropertySet->setPropertyValue( sIsProtected, aAny );
}
}
diff --git a/xmloff/source/text/XMLIndexTOCContext.hxx b/xmloff/source/text/XMLIndexTOCContext.hxx
index dd46313c13b0..05e2dd4716d8 100644
--- a/xmloff/source/text/XMLIndexTOCContext.hxx
+++ b/xmloff/source/text/XMLIndexTOCContext.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLIndexTOCContext.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: dvo $ $Date: 2000-11-30 16:46:20 $
+ * last change: $Author: dvo $ $Date: 2001-05-29 12:32:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -103,6 +103,7 @@ enum IndexTypeEnum
class XMLIndexTOCContext : public SvXMLImportContext
{
const ::rtl::OUString sTitle;
+ const ::rtl::OUString sIsProtected;
/** XPropertySet of the index */
::com::sun::star::uno::Reference<
diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx
index 6f03cdf84614..13f4761e4956 100644
--- a/xmloff/source/text/XMLSectionExport.cxx
+++ b/xmloff/source/text/XMLSectionExport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLSectionExport.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: dvo $ $Date: 2001-05-02 15:04:56 $
+ * last change: $Author: dvo $ $Date: 2001-05-29 12:32:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -889,7 +889,13 @@ void XMLSectionExport::ExportBaseIndexStart(
const OUString sElementName,
const Reference<XPropertySet> & rPropertySet)
{
- // rPropertySet not used any more; should be removed
+ // protect + protection key
+ Any aAny = rPropertySet->getPropertyValue(sIsProtected);
+ if (*(sal_Bool*)aAny.getValue())
+ {
+ GetExport().AddAttributeASCII(XML_NAMESPACE_TEXT, sXML_protected,
+ sXML_true);
+ }
// index Element start
GetExport().GetDocHandler()->ignorableWhitespace( GetExport().sWS );