diff options
author | Daniel Vogelheim <dvo@openoffice.org> | 2001-04-09 12:13:23 +0000 |
---|---|---|
committer | Daniel Vogelheim <dvo@openoffice.org> | 2001-04-09 12:13:23 +0000 |
commit | de332cc5602b862f460c7908926ba011d2799020 (patch) | |
tree | aab6e30098363684eda6146e9003a8a4093ab590 /xmloff | |
parent | fb9cab292032e5ae848d2d9c4ec25d38aa8d58cd (diff) |
#85901# fixed import of empty sections
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/XMLSectionImportContext.cxx | 19 | ||||
-rw-r--r-- | xmloff/source/text/XMLSectionImportContext.hxx | 6 |
2 files changed, 17 insertions, 8 deletions
diff --git a/xmloff/source/text/XMLSectionImportContext.cxx b/xmloff/source/text/XMLSectionImportContext.cxx index 12d240a8ba85..da38bdf916ae 100644 --- a/xmloff/source/text/XMLSectionImportContext.cxx +++ b/xmloff/source/text/XMLSectionImportContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLSectionImportContext.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: dvo $ $Date: 2001-03-21 16:03:49 $ + * last change: $Author: dvo $ $Date: 2001-04-09 13:13:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -196,7 +196,8 @@ XMLSectionImportContext::XMLSectionImportContext( bCondOK(sal_False), bIsVisible(sal_True), bSequenceOK(sal_False), - bProtect(sal_False) + bProtect(sal_False), + bHasContent(sal_False) { } @@ -385,11 +386,15 @@ void XMLSectionImportContext::ProcessAttributes( void XMLSectionImportContext::EndElement() { // get rid of last paragraph + // (unless it's the only paragraph in the section) UniReference<XMLTextImportHelper> rHelper = GetImport().GetTextImport(); rHelper->GetCursor()->goRight(1, sal_False); - rHelper->GetCursor()->goLeft(1, sal_True); - rHelper->GetText()->insertString(rHelper->GetCursorAsRange(), - sEmpty, sal_True); + if (bHasContent) + { + rHelper->GetCursor()->goLeft(1, sal_True); + rHelper->GetText()->insertString(rHelper->GetCursorAsRange(), + sEmpty, sal_True); + } // and delete second marker rHelper->GetCursor()->goRight(1, sal_True); @@ -434,6 +439,8 @@ SvXMLImportContext* XMLSectionImportContext::CreateChildContext( pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); } + else + bHasContent = sal_True; } return pContext; diff --git a/xmloff/source/text/XMLSectionImportContext.hxx b/xmloff/source/text/XMLSectionImportContext.hxx index 46f3b1908915..838951e9e6e6 100644 --- a/xmloff/source/text/XMLSectionImportContext.hxx +++ b/xmloff/source/text/XMLSectionImportContext.hxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLSectionImportContext.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: dvo $ $Date: 2001-03-21 16:03:49 $ + * last change: $Author: dvo $ $Date: 2001-04-09 13:13:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -121,6 +121,8 @@ class XMLSectionImportContext : public SvXMLImportContext sal_Bool bValid; sal_Bool bSequenceOK; + sal_Bool bHasContent; + public: TYPEINFO(); |