summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMichael Brauer <mib@openoffice.org>2000-10-26 08:29:25 +0000
committerMichael Brauer <mib@openoffice.org>2000-10-26 08:29:25 +0000
commit19078e8786e6fa9179a06ef5cacc94fbff113dc6 (patch)
treee7e692c9c3689b4bbc531fdd0fadabdb10f498d6 /xmloff
parent3eb2ecd4eda1251d554f7a1929de79e35b1b199c (diff)
tables within headers and footers
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/prj/d.lst1
-rw-r--r--xmloff/source/text/XMLTextHeaderFooterContext.cxx37
-rw-r--r--xmloff/source/text/XMLTextTableContext.cxx82
-rw-r--r--xmloff/source/text/makefile.mk10
-rw-r--r--xmloff/source/text/txtimp.cxx7
5 files changed, 123 insertions, 14 deletions
diff --git a/xmloff/prj/d.lst b/xmloff/prj/d.lst
index 8c6b9d84f6fe..45a669bbf56f 100644
--- a/xmloff/prj/d.lst
+++ b/xmloff/prj/d.lst
@@ -78,3 +78,4 @@ hedabu: ..\inc\PageMasterStyleMap.hxx %_DEST%\inc%_EXT%\xmloff\PageMasterStyleMa
hedabu: ..\inc\XMLTextMasterPageExport.hxx %_DEST%\inc%_EXT%\xmloff\XMLTextMasterPageExport.hxx
hedabu: ..\inc\XMLTextMasterStylesContext.hxx %_DEST%\inc%_EXT%\xmloff\XMLTextMasterStylesContext.hxx
hedabu: ..\inc\XMLTextMasterPageContext.hxx %_DEST%\inc%_EXT%\xmloff\XMLTextMasterPageContext.hxx
+hedabu: ..\inc\XMLTextTableContext.hxx %_DEST%\inc%_EXT%\xmloff\XMLTextTableContext.hxx
diff --git a/xmloff/source/text/XMLTextHeaderFooterContext.cxx b/xmloff/source/text/XMLTextHeaderFooterContext.cxx
index 8a928f190cbd..6493c734e444 100644
--- a/xmloff/source/text/XMLTextHeaderFooterContext.cxx
+++ b/xmloff/source/text/XMLTextHeaderFooterContext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: XMLTextHeaderFooterContext.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: mib $ $Date: 2000-10-23 11:56:25 $
+ * last change: $Author: mib $ $Date: 2000-10-26 09:25:33 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,6 +62,9 @@
#ifndef _COM_SUN_STAR_TEXT_XTEXT_HPP_
#include <com/sun/star/text/XText.hpp>
#endif
+#ifndef _COM_SUN_STAR_TEXT_XRELATIVETEXTCONTENTREMOVE_HPP_
+#include <com/sun/star/text/XRelativeTextContentRemove.hpp>
+#endif
#ifndef _XMLOFF_NMSPMAP_HXX
#include "nmspmap.hxx"
#endif
@@ -74,6 +77,9 @@
#ifndef _XMLOFF_TEXTHEADERFOOTERCONTEXT_HXX_
#include "XMLTextHeaderFooterContext.hxx"
#endif
+#ifndef _XMLOFF_TEXTTABLECONTEXT_HXX_
+#include "XMLTextTableContext.hxx"
+#endif
#ifndef _XMLOFF_XMLIMP_HXX
#include "xmlimp.hxx"
#endif
@@ -103,7 +109,7 @@ XMLTextHeaderFooterContext::XMLTextHeaderFooterContext( SvXMLImport& rImport, sa
xPropSet( rPageStylePropSet ),
sOn( OUString::createFromAscii( bFooter ? "FooterIsOn" : "HeaderIsOn" ) ),
sShareContent( OUString::createFromAscii( bFooter ? "FooterIsShared"
- : "HeaderShared" ) ),
+ : "HeaderIsShared" ) ),
sText( OUString::createFromAscii( bFooter ? "FooterText" : "HeaderText" ) ),
sTextLeft( OUString::createFromAscii( bFooter ? "FooterTextLeft"
: "HeaderTextLeft" ) ),
@@ -207,10 +213,16 @@ SvXMLImportContext *XMLTextHeaderFooterContext::CreateChildContext(
}
pContext =
- GetImport().GetTextImport()->CreateTextChildContext(GetImport(),
- nPrefix,
- rLocalName,
- xAttrList);
+ GetImport().GetTextImport()->CreateTextChildContext(
+ GetImport(), nPrefix, rLocalName, xAttrList,
+ XML_TEXT_TYPE_HEADER_FOOTER );
+ if( pContext && pContext->ISA( XMLTextTableContext ) )
+ {
+ xTextContent = PTR_CAST( XMLTextTableContext, pContext )
+ ->GetXTextContent();
+ }
+ else
+ xTextContent = 0;
}
if( !pContext )
pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
@@ -229,6 +241,17 @@ void XMLTextHeaderFooterContext::EndElement()
GetImport().GetTextImport()->GetCursorAsRange(), sEmpty,
sal_True );
}
+ else if( xTextContent.is() )
+ {
+ Reference< XRelativeTextContentRemove > xRemove(
+ GetImport().GetTextImport()->GetText(), UNO_QUERY );
+ if( xRemove.is() )
+ {
+ GetImport().GetTextImport()->ResetCursor();
+ xRemove->removeTextContentAfter( xTextContent );
+ }
+ }
+
GetImport().GetTextImport()->SetCursor( xOldTextCursor );
}
else if( !bLeft )
diff --git a/xmloff/source/text/XMLTextTableContext.cxx b/xmloff/source/text/XMLTextTableContext.cxx
new file mode 100644
index 000000000000..08c2cdecd2ac
--- /dev/null
+++ b/xmloff/source/text/XMLTextTableContext.cxx
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * $RCSfile: XMLTextTableContext.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: mib $ $Date: 2000-10-26 09:23:47 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _XMLTEXTTABLECONTEXT_HXX
+#include "XMLTextTableContext.hxx"
+#endif
+
+using namespace ::rtl;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::text;
+
+
+TYPEINIT1( XMLTextTableContext, SvXMLImportContext );
+
+XMLTextTableContext::XMLTextTableContext(
+ SvXMLImport& rImport,
+ sal_uInt16 nPrfx, const OUString& rLName ) :
+ SvXMLImportContext( rImport, nPrfx, rLName )
+{
+}
+
+XMLTextTableContext::~XMLTextTableContext()
+{
+}
diff --git a/xmloff/source/text/makefile.mk b/xmloff/source/text/makefile.mk
index f5c31f6f600e..be5a1a6d6e30 100644
--- a/xmloff/source/text/makefile.mk
+++ b/xmloff/source/text/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.7 $
+# $Revision: 1.8 $
#
-# last change: $Author: dvo $ $Date: 2000-10-16 13:01:58 $
+# last change: $Author: mib $ $Date: 2000-10-26 09:25:33 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -112,7 +112,8 @@ CXXFILES = \
XMLTextMasterPageExport.cxx \
XMLTextMasterStylesContext.cxx \
XMLTextNumRuleInfo.cxx \
- XMLTextPropertySetContext.cxx
+ XMLTextPropertySetContext.cxx \
+ XMLTextTableContext.cxx
SLOFILES = \
$(SLO)$/txtdrope.obj \
@@ -150,7 +151,8 @@ SLOFILES = \
$(SLO)$/XMLTextMasterPageExport.obj \
$(SLO)$/XMLTextMasterStylesContext.obj \
$(SLO)$/XMLTextNumRuleInfo.obj \
- $(SLO)$/XMLTextPropertySetContext.obj
+ $(SLO)$/XMLTextPropertySetContext.obj \
+ $(SLO)$/XMLTextTableContext.obj
# --- Tagets -------------------------------------------------------
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 3ac03adc458d..cadb472bfcbb 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txtimp.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: mib $ $Date: 2000-10-23 11:28:11 $
+ * last change: $Author: mib $ $Date: 2000-10-26 09:25:33 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -890,7 +890,8 @@ SvXMLImportContext *XMLTextImportHelper::CreateTextChildContext(
xAttrList, bOrdered );
break;
case XML_TOK_TABLE_TABLE:
- if( XML_TEXT_TYPE_BODY == eType || XML_TEXT_TYPE_TEXTBOX == eType )
+ if( XML_TEXT_TYPE_BODY == eType || XML_TEXT_TYPE_TEXTBOX == eType ||
+ XML_TEXT_TYPE_HEADER_FOOTER == eType )
pContext = CreateTableChildContext( rImport, nPrefix, rLocalName,
xAttrList );
break;