diff options
author | Daniel Vogelheim <dvo@openoffice.org> | 2001-02-14 15:35:00 +0000 |
---|---|---|
committer | Daniel Vogelheim <dvo@openoffice.org> | 2001-02-14 15:35:00 +0000 |
commit | b7643afabab3becf514231e87e3a3e4169584dd3 (patch) | |
tree | 2e7b0da901e8b8c62e7765249a1a6af955aab9b2 /sw/source/filter | |
parent | 208aa0ca61b6b2ff898b163eae382ecb707c52d3 (diff) |
- added: import of label documents
- changed: document class for HTML/online documents now called online (rather than html)
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/xml/xmlexp.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlimp.cxx | 42 |
2 files changed, 43 insertions, 5 deletions
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index b77a459ae42c..e165409904c4 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlexp.cxx,v $ * - * $Revision: 1.24 $ + * $Revision: 1.25 $ * - * last change: $Author: dvo $ $Date: 2001-02-13 17:54:54 $ + * last change: $Author: dvo $ $Date: 2001-02-14 16:35:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -363,7 +363,7 @@ sal_uInt32 SwXMLExport::exportDoc( const sal_Char *pClass ) } else if (pDoc->IsHTMLMode()) { - pClass = sXML_html; + pClass = sXML_online; } // else: keep default pClass that we received diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index a1eb2fb9c5b8..ad9203ac405d 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlimp.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: dvo $ $Date: 2001-01-23 16:13:54 $ + * last change: $Author: dvo $ $Date: 2001-02-14 16:35:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -96,6 +96,9 @@ #ifndef _XMLOFF_TXTIMP_HXX #include <xmloff/txtimp.hxx> #endif +#ifndef _XMLOFF_NMSPMAP_HXX +#include <xmloff/nmspmap.hxx> +#endif #ifndef _XMLOFF_XMLTEXTSHAPEIMPORTHELPER_HXX_ #include <xmloff/XMLTextShapeImportHelper.hxx> #endif @@ -187,6 +190,41 @@ SwXMLDocContext_Impl::SwXMLDocContext_Impl( SwXMLImport& rImport, const Reference< xml::sax::XAttributeList > & xAttrList ) : SvXMLImportContext( rImport, nPrfx, rLName ) { + // process document class + // global-text, online are handled via document shell; + // we only handle label documents + sal_Int16 nLength = xAttrList->getLength(); + for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++) + { + OUString sLocalName; + sal_uInt16 nPrefix = GetImport().GetNamespaceMap(). + GetKeyByAttrName( xAttrList->getNameByIndex(nAttr), + &sLocalName ); + + if ( (XML_NAMESPACE_OFFICE == nPrefix) && + sLocalName.equalsAsciiL(sXML_class, sizeof(sXML_class)-1) ) + { + if (xAttrList->getValueByIndex(nAttr).equalsAsciiL( + sXML_label, sizeof(sXML_label)-1)) + { + // OK, we need to set label mode. To do this, tunnel + // to get the SwDoc, then set label mode. + + Reference<XText> xText(GetImport().GetModel(), UNO_QUERY); + Reference<XUnoTunnel> xTunnel( + GetImport().GetTextImport()->GetText(), UNO_QUERY); + DBG_ASSERT(xTunnel.is(), "I can't get the Tunnel"); + SwXText* pText = (SwXText*)xTunnel->getSomething( + SwXText::getUnoTunnelId()); + if (NULL != pText) + { + SwDoc* pDoc = pText->GetDoc(); + if (NULL != pDoc) + pDoc->SetLabelDoc(); + } + } + } + } } SwXMLDocContext_Impl::~SwXMLDocContext_Impl() |