diff options
author | Daniel Vogelheim <dvo@openoffice.org> | 2002-04-26 12:16:22 +0000 |
---|---|---|
committer | Daniel Vogelheim <dvo@openoffice.org> | 2002-04-26 12:16:22 +0000 |
commit | 5194e5994393dbc04d9c6db840de169886bc1a6e (patch) | |
tree | 5db2d4cc61173b66d58a0f0ea65b2d8137cd1a8a /xmloff | |
parent | 582240b4bd533de15d23c0a0fff88ee8d2c61fa8 (diff) |
#97450# load/save curennt hidden-status of conditional sections
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/dtd/text.mod | 3 | ||||
-rw-r--r-- | xmloff/source/text/XMLSectionExport.cxx | 13 | ||||
-rw-r--r-- | xmloff/source/text/XMLSectionExport.hxx | 6 | ||||
-rw-r--r-- | xmloff/source/text/XMLSectionImportContext.cxx | 38 | ||||
-rw-r--r-- | xmloff/source/text/XMLSectionImportContext.hxx | 7 |
5 files changed, 55 insertions, 12 deletions
diff --git a/xmloff/dtd/text.mod b/xmloff/dtd/text.mod index bab648d744e4..94ae7427bf32 100644 --- a/xmloff/dtd/text.mod +++ b/xmloff/dtd/text.mod @@ -1,5 +1,5 @@ <!-- - $Id: text.mod,v 1.48 2002-02-28 14:42:15 dvo Exp $ + $Id: text.mod,v 1.49 2002-04-26 13:14:38 dvo Exp $ The Contents of this file are made available subject to the terms of either of the following licenses @@ -734,6 +734,7 @@ <!ATTLIST text:section text:display (true|none|condition) "true"> <!ATTLIST text:section text:condition %formula; #IMPLIED> <!ATTLIST text:section text:protection-key CDATA #IMPLIED> +<!ATTLIST text:section text:is-hidden %boolean; #IMPLIED> <!ELEMENT text:section-source EMPTY> <!ATTLIST text:section-source xlink:href %string; #IMPLIED> diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index daa154c2dc34..3417dd166979 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLSectionExport.cxx,v $ * - * $Revision: 1.30 $ + * $Revision: 1.31 $ * - * last change: $Author: dvo $ $Date: 2002-01-18 11:08:29 $ + * last change: $Author: dvo $ $Date: 2002-04-26 13:16:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -264,6 +264,7 @@ XMLSectionExport::XMLSectionExport( sSortAlgorithm(RTL_CONSTASCII_USTRINGPARAM("SortAlgorithm")), sLocale(RTL_CONSTASCII_USTRINGPARAM("Locale")), sUserIndexName(RTL_CONSTASCII_USTRINGPARAM("UserIndexName")), + sIsCurrentlyVisible(RTL_CONSTASCII_USTRINGPARAM("IsCurrentlyVisible")), sEmpty() { } @@ -555,6 +556,14 @@ void XMLSectionExport::ExportRegularSectionStart( { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_CONDITION, sCond); eDisplay = XML_CONDITION; + + // #97450# store hidden-status (of conditional sections only) + aAny = xPropSet->getPropertyValue(sIsCurrentlyVisible); + if (! *(sal_Bool*)aAny.getValue()) + { + GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_IS_HIDDEN, + XML_TRUE); + } } else { diff --git a/xmloff/source/text/XMLSectionExport.hxx b/xmloff/source/text/XMLSectionExport.hxx index cee45e4d7b1c..1f7342208c48 100644 --- a/xmloff/source/text/XMLSectionExport.hxx +++ b/xmloff/source/text/XMLSectionExport.hxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLSectionExport.hxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: dvo $ $Date: 2002-01-09 12:57:21 $ + * last change: $Author: dvo $ $Date: 2002-04-26 13:16:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -181,6 +181,8 @@ class XMLSectionExport const ::rtl::OUString sLocale; const ::rtl::OUString sUserIndexName; + const ::rtl::OUString sIsCurrentlyVisible; + const ::rtl::OUString sEmpty; SvXMLExport& rExport; diff --git a/xmloff/source/text/XMLSectionImportContext.cxx b/xmloff/source/text/XMLSectionImportContext.cxx index e047c60bd759..73fa373d1749 100644 --- a/xmloff/source/text/XMLSectionImportContext.cxx +++ b/xmloff/source/text/XMLSectionImportContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLSectionImportContext.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: dvo $ $Date: 2002-03-25 15:58:03 $ + * last change: $Author: dvo $ $Date: 2002-04-26 13:16:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -147,15 +147,18 @@ const sal_Char sAPI_IndexHeaderSection[] = "com.sun.star.text.IndexHeaderSection const sal_Char sAPI_IsProtected[] = "IsProtected"; const sal_Char sAPI_Condition[] = "Condition"; const sal_Char sAPI_IsVisible[] = "IsVisible"; +const sal_Char sAPI_IsCurrentlyVisible[] = "IsCurrentlyVisible"; const sal_Char sAPI_ProtectionKey[] = "ProtectionKey"; -enum XMLSectionToken { +enum XMLSectionToken +{ XML_TOK_SECTION_STYLE_NAME, XML_TOK_SECTION_NAME, XML_TOK_SECTION_CONDITION, XML_TOK_SECTION_DISPLAY, XML_TOK_SECTION_PROTECT, - XML_TOK_SECTION_PROTECTION_KEY + XML_TOK_SECTION_PROTECTION_KEY, + XML_TOK_SECTION_IS_HIDDEN }; static __FAR_DATA SvXMLTokenMapEntry aSectionTokenMap[] = @@ -166,6 +169,7 @@ static __FAR_DATA SvXMLTokenMapEntry aSectionTokenMap[] = { XML_NAMESPACE_TEXT, XML_DISPLAY, XML_TOK_SECTION_DISPLAY }, { XML_NAMESPACE_TEXT, XML_PROTECTED, XML_TOK_SECTION_PROTECT }, { XML_NAMESPACE_TEXT, XML_PROTECTION_KEY, XML_TOK_SECTION_PROTECTION_KEY}, + { XML_NAMESPACE_TEXT, XML_IS_HIDDEN, XML_TOK_SECTION_IS_HIDDEN }, // compatibility with SRC629 (or earlier) versions { XML_NAMESPACE_TEXT, XML_PROTECT, XML_TOK_SECTION_PROTECT }, XML_TOKEN_MAP_END @@ -192,6 +196,7 @@ XMLSectionImportContext::XMLSectionImportContext( sIsVisible(RTL_CONSTASCII_USTRINGPARAM(sAPI_IsVisible)), sProtectionKey(RTL_CONSTASCII_USTRINGPARAM(sAPI_ProtectionKey)), sIsProtected(RTL_CONSTASCII_USTRINGPARAM(sAPI_IsProtected)), + sIsCurrentlyVisible(RTL_CONSTASCII_USTRINGPARAM(sAPI_IsCurrentlyVisible)), sStyleName(), sName(), sCond(), @@ -201,7 +206,9 @@ XMLSectionImportContext::XMLSectionImportContext( bIsVisible(sal_True), bSequenceOK(sal_False), bProtect(sal_False), - bHasContent(sal_False) + bHasContent(sal_False), + bIsCurrentlyVisible(sal_True), + bIsCurrentlyVisibleOK(sal_False) { } @@ -264,6 +271,17 @@ void XMLSectionImportContext::StartElement( Any aAny; aAny.setValue( &bIsVisible, ::getBooleanCppuType() ); xPropSet->setPropertyValue( sIsVisible, aAny ); + + // #97450# hidden sections must be hidden on reload + // For backwards compatibilty, set flag only if it is + // present + if( bIsCurrentlyVisibleOK ) + { + aAny.setValue( &bIsCurrentlyVisible, + ::getBooleanCppuType() ); + xPropSet->setPropertyValue( sIsCurrentlyVisible, aAny); + } + if (bCondOK) { aAny <<= sCond; @@ -364,6 +382,16 @@ void XMLSectionImportContext::ProcessAttributes( } // else: ignore break; + case XML_TOK_SECTION_IS_HIDDEN: + { + sal_Bool bTmp; + if (SvXMLUnitConverter::convertBool(bTmp, sAttr)) + { + bIsCurrentlyVisible = !bTmp; + bIsCurrentlyVisibleOK = sal_True; + } + } + break; case XML_TOK_SECTION_PROTECTION_KEY: SvXMLUnitConverter::decodeBase64(aSequence, sAttr); bSequenceOK = sal_True; diff --git a/xmloff/source/text/XMLSectionImportContext.hxx b/xmloff/source/text/XMLSectionImportContext.hxx index 089d8af8ebef..302eb1f7be8c 100644 --- a/xmloff/source/text/XMLSectionImportContext.hxx +++ b/xmloff/source/text/XMLSectionImportContext.hxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLSectionImportContext.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: dvo $ $Date: 2001-05-02 15:04:56 $ + * last change: $Author: dvo $ $Date: 2002-04-26 13:16:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -109,6 +109,7 @@ class XMLSectionImportContext : public SvXMLImportContext const ::rtl::OUString sIsVisible; const ::rtl::OUString sProtectionKey; const ::rtl::OUString sIsProtected; + const ::rtl::OUString sIsCurrentlyVisible; const ::rtl::OUString sEmpty; ::rtl::OUString sStyleName; @@ -120,6 +121,8 @@ class XMLSectionImportContext : public SvXMLImportContext sal_Bool bIsVisible; sal_Bool bValid; sal_Bool bSequenceOK; + sal_Bool bIsCurrentlyVisible; + sal_Bool bIsCurrentlyVisibleOK; sal_Bool bHasContent; |