summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorMichael Brauer <mib@openoffice.org>2000-12-02 09:57:15 +0000
committerMichael Brauer <mib@openoffice.org>2000-12-02 09:57:15 +0000
commit89bbf41f22528a65b315c6e0e0d1ecfb0d6fe5ae (patch)
treef3f5c6c5f0c63695043f45db9c751507a2531f58 /sw/source/filter
parente6fe15be1d26c68a87107ff95c88db5e511deb02 (diff)
#80795#: use packages
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/xml/swxml.cxx126
-rw-r--r--sw/source/filter/xml/wrtxml.cxx68
-rw-r--r--sw/source/filter/xml/wrtxml.hxx11
-rw-r--r--sw/source/filter/xml/xmlbrsh.cxx90
-rw-r--r--sw/source/filter/xml/xmlbrshe.hxx41
-rw-r--r--sw/source/filter/xml/xmlexp.cxx15
-rw-r--r--sw/source/filter/xml/xmlexp.hxx8
-rw-r--r--sw/source/filter/xml/xmlfmte.cxx13
-rw-r--r--sw/source/filter/xml/xmlimp.cxx10
-rw-r--r--sw/source/filter/xml/xmlimp.hxx8
-rw-r--r--sw/source/filter/xml/xmliteme.cxx25
-rw-r--r--sw/source/filter/xml/xmltble.cxx8
-rw-r--r--sw/source/filter/xml/xmltexte.hxx10
13 files changed, 224 insertions, 209 deletions
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 65f647d05fab..61d29f710f9a 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: swxml.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jp $ $Date: 2000-11-20 09:18:37 $
+ * last change: $Author: mib $ $Date: 2000-12-02 10:57:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -86,6 +86,9 @@
#ifndef _SFXDOCFILE_HXX //autogen wg. SfxMedium
#include <sfx2/docfile.hxx>
#endif
+#ifndef _UTL_STREAM_WRAPPER_HXX_
+#include <unotools/streamwrap.hxx>
+#endif
#ifndef _SWSWERROR_H
#include <swerror.h>
@@ -102,6 +105,9 @@
#ifndef _DOCSH_HXX //autogen wg. SwDoc
#include <docsh.hxx>
#endif
+#ifndef _XMLGRHLP_HXX
+#include <svx/xmlgrhlp.hxx>
+#endif
#ifndef _XMLIMP_HXX
#include "xmlimp.hxx"
@@ -109,12 +115,18 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::container;
using namespace ::rtl;
XMLReader::XMLReader()
{
}
+int XMLReader::GetReaderType()
+{
+ return SW_STORAGE_READER | SW_STREAM_READER;
+}
+
sal_uInt32 XMLReader::Read( SwDoc &rDoc, SwPaM &rPaM, const String & rName )
{
Reference< lang::XMultiServiceFactory > xServiceFactory =
@@ -137,47 +149,58 @@ sal_uInt32 XMLReader::Read( SwDoc &rDoc, SwPaM &rPaM, const String & rName )
return ERR_SWG_READ_ERROR;
// Get data source ...
+ DBG_ASSERT( pMedium, "There is the medium" );
+ if( !pMedium )
+ return ERR_SWG_READ_ERROR;
+
Reference< io::XActiveDataSource > xSource;
- if( pMedium /* && pMedium->GetLoadEnvironment_Impl() */ )
+ Reference< XInterface > xPipe;
+
+ xml::sax::InputSource aParserInput;
+ aParserInput.sSystemId = rName;
+
+ Reference< XIndexContainer > xEmbeddedGraphicExport;
+ SvXMLGraphicHelper *pGraphicHelper = 0;
+ SvStorageStreamRef xDocStream;
+ SvStorage *pStorage = pMedium->GetStorage();
+ if( pStorage )
+ {
+ pGraphicHelper = SvXMLGraphicHelper::Create( *pStorage,
+ GRAPHICHELPER_MODE_READ,
+ sal_False );
+ xEmbeddedGraphicExport = pGraphicHelper;
+
+ OUString sDocName( RTL_CONSTASCII_USTRINGPARAM( "Content" ) );
+ xDocStream = pStorage->OpenStream( sDocName,
+ STREAM_READ | STREAM_NOCREATE );
+ xDocStream->SetBufferSize( 16*1024 );
+ aParserInput.aInputStream = new utl::OInputStreamWrapper( *xDocStream );
+ }
+ else
{
// if there is a medium and if this medium has a load environment,
// we get an active data source from the medium.
pMedium->GetInStream()->Seek( 0 );
xSource = pMedium->GetDataSource();
ASSERT( xSource.is(), "XMLReader:: got no data source from medium" );
+ if( !xSource.is() )
+ return ERR_SWG_READ_ERROR;
+
+ // get a pipe for connecting the data source to the parser
+ xPipe = xServiceFactory->createInstance(
+ OUString::createFromAscii("com.sun.star.io.Pipe") );
+ ASSERT( xPipe.is(),
+ "XMLReader::Read: com.sun.star.io.Pipe service missing" );
+ if( !xPipe.is() )
+ return ERR_SWG_READ_ERROR;
+
+ // connect pipe's output stream to the data source
+ Reference< io::XOutputStream > xPipeOutput( xPipe, UNO_QUERY );
+ xSource->setOutputStream( xPipeOutput );
+
+ aParserInput.aInputStream = Reference< io::XInputStream >( xPipe,
+ UNO_QUERY );
}
- if( !xSource.is() )
- {
- // If we didn't get a data source from a medium, we have to create
- // one.
- Reference< XInterface > xFactory = xServiceFactory->createInstance(
- OUString::createFromAscii("com.sun.star.frame.DataSourceFactory") );
- if( xFactory.is() )
- {
- Reference< lang::XMultiServiceFactory > xMFactory( xFactory,
- UNO_QUERY );
- if( xMFactory.is() )
- {
- OUString sURL( rName );
- Sequence< Any > aArgs(1);
- Any* pArgs = aArgs.getArray();
- *pArgs <<= sURL;
-
- Reference< XInterface > xSrc =
- xMFactory->createInstanceWithArguments( sURL, aArgs );
- if( xSrc.is() )
- {
- Reference< io::XActiveDataSource > xTmp( xSrc, UNO_QUERY );
- xSource = xTmp;
- }
- }
- }
- }
-
- // get data source
- ASSERT( xSource.is(), "XMLReader::Read: data source missing" );
- if( !xSource.is() )
- return ERR_SWG_READ_ERROR;
// get parser
Reference< XInterface > xXMLParser = xServiceFactory->createInstance(
@@ -187,14 +210,6 @@ sal_uInt32 XMLReader::Read( SwDoc &rDoc, SwPaM &rPaM, const String & rName )
if( !xXMLParser.is() )
return ERR_SWG_READ_ERROR;
- // get a pipe for connecting the data source to the parser
- Reference< XInterface > xPipe = xServiceFactory->createInstance(
- OUString::createFromAscii("com.sun.star.io.Pipe") );
- ASSERT( xPipe.is(),
- "XMLReader::Read: com.sun.star.io.Pipe service missing" );
- if( !xPipe.is() )
- return ERR_SWG_READ_ERROR;
-
sal_uInt16 nStyleFamilyMask = SFX_STYLE_FAMILY_ALL;
sal_Bool bLoadDoc;
sal_Bool bInsert;
@@ -223,17 +238,7 @@ sal_uInt32 XMLReader::Read( SwDoc &rDoc, SwPaM &rPaM, const String & rName )
// get filter
Reference< xml::sax::XDocumentHandler > xFilter =
new SwXMLImport( rDoc, rPaM, bLoadDoc, bInsert, nStyleFamilyMask,
- xModel );
-
- // connect pipe's output stream to the data source
- Reference< io::XOutputStream > xPipeOutput( xPipe, UNO_QUERY );
- xSource->setOutputStream( xPipeOutput );
-
- // connect pipe's input stream to the parser
- xml::sax::InputSource aParserInput;
- Reference< io::XInputStream > xPipeInput( xPipe, UNO_QUERY );
- aParserInput.aInputStream = xPipeInput;
- aParserInput.sSystemId = rName;
+ xModel, xEmbeddedGraphicExport );
// connect parser and filter
Reference< xml::sax::XParser > xParser( xXMLParser, UNO_QUERY );
@@ -243,8 +248,11 @@ sal_uInt32 XMLReader::Read( SwDoc &rDoc, SwPaM &rPaM, const String & rName )
sal_uInt32 nRet = 0;
// parse
- Reference< io::XActiveDataControl > xSourceControl( xSource, UNO_QUERY );
- xSourceControl->start();
+ if( xSource.is() )
+ {
+ Reference< io::XActiveDataControl > xSourceControl( xSource, UNO_QUERY );
+ xSourceControl->start();
+ }
try
{
xParser->parseStream( aParserInput );
@@ -262,6 +270,9 @@ sal_uInt32 XMLReader::Read( SwDoc &rDoc, SwPaM &rPaM, const String & rName )
nRet = ERR_SWG_READ_ERROR;
}
+ if( pGraphicHelper )
+ SvXMLGraphicHelper::Destroy( pGraphicHelper );
+ xEmbeddedGraphicExport = 0;
rDoc.RemoveLink();
return nRet;
@@ -271,6 +282,9 @@ sal_uInt32 XMLReader::Read( SwDoc &rDoc, SwPaM &rPaM, const String & rName )
/*************************************************************************
$Log: not supported by cvs2svn $
+ Revision 1.4 2000/11/20 09:18:37 jp
+ must change: processfactory moved
+
Revision 1.3 2000/10/26 09:38:52 mib
tables within headers and footers
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index c25f25feca1f..19b36ea6682c 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: wrtxml.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: mib $ $Date: 2000-11-27 13:44:40 $
+ * last change: $Author: mib $ $Date: 2000-12-02 10:57:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,12 +65,21 @@
#pragma hdrstop
+#ifndef _COM_SUN_STAR_CONTAINER_XINDEXCONTAINER_HPP_
+#include <com/sun/star/container/XIndexContainer.hpp>
+#endif
#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
#include <comphelper/processfactory.hxx>
#endif
#ifndef _XMLOFF_XMLKYWD_HXX
#include <xmloff/xmlkywd.hxx>
#endif
+#ifndef _UTL_STREAM_WRAPPER_HXX_
+#include <unotools/streamwrap.hxx>
+#endif
+#ifndef _XMLGRHLP_HXX
+#include <svx/xmlgrhlp.hxx>
+#endif
#ifndef _SFXDOCFILE_HXX //autogen wg. SfxMedium
#include <sfx2/docfile.hxx>
@@ -101,8 +110,10 @@
using namespace ::rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::container;
-SwXMLWriter::SwXMLWriter()
+SwXMLWriter::SwXMLWriter( sal_Bool bPl ) :
+ bPlain( bPl )
{
}
@@ -118,6 +129,13 @@ sal_uInt32 SwXMLWriter::WriteStream()
return ERR_SWG_WRITE_ERROR;
}
+sal_uInt32 SwXMLWriter::WriteStorage()
+{
+ ASSERT( !this, "SwXMLWriter::WriteStorage: use Write!" );
+
+ return ERR_SWG_WRITE_ERROR;
+}
+
sal_uInt32 SwXMLWriter::Write( SwPaM& rPaM, SfxMedium& rMed,
const String* pFileName )
{
@@ -145,18 +163,49 @@ sal_uInt32 SwXMLWriter::Write( SwPaM& rPaM, SfxMedium& rMed,
PutNumFmtFontsInAttrPool();
// PutEditEngFontsInAttrPool();
- Reference< io::XOutputStream > xOut = rMed.GetDataSink();
+ Reference< io::XOutputStream > xOut;
+ SvStorageStreamRef xDocStream;
+ SvStorage *pStorage = bPlain ? 0 : rMed.GetOutputStorage( sal_True );
+ if( pStorage )
+ {
+ OUString sDocName( RTL_CONSTASCII_USTRINGPARAM( "Content" ) );
+ xDocStream = pStorage->OpenStream( sDocName,
+ STREAM_WRITE | STREAM_SHARE_DENYWRITE );
+// xDocStream->SetBufferSize( 16*1024 );
+ xOut = new utl::OOutputStreamWrapper( *xDocStream );
+ }
+ else
+ {
+ xOut = rMed.GetDataSink();
+ }
+
Reference< io::XActiveDataSource > xSrc( xWriter, UNO_QUERY );
xSrc->setOutputStream( xOut );
+ Reference< XIndexContainer > xEmbeddedGraphicExport;
+ SvXMLGraphicHelper *pGraphicHelper = 0;
+ if( pStorage )
+ {
+ pGraphicHelper = SvXMLGraphicHelper::Create( *pStorage,
+ GRAPHICHELPER_MODE_WRITE,
+ sal_False );
+ xEmbeddedGraphicExport = pGraphicHelper;
+ }
+
Reference< xml::sax::XDocumentHandler > xHandler( xWriter, UNO_QUERY );
SwXMLExport *pExp = new SwXMLExport( xModel, rPaM, *pFileName, xHandler,
+ xEmbeddedGraphicExport,
bWriteAll, bWriteOnlyFirstTable,
- bShowProgress );
+ bShowProgress, pStorage );
sal_uInt32 nRet = pExp->exportDoc( sXML_text );
+ if( xDocStream.Is() )
+ xDocStream->Commit();
+ if( pGraphicHelper )
+ SvXMLGraphicHelper::Destroy( pGraphicHelper );
+ xEmbeddedGraphicExport = 0;
delete pExp;
ResetWriter();
@@ -166,9 +215,9 @@ sal_uInt32 SwXMLWriter::Write( SwPaM& rPaM, SfxMedium& rMed,
// -----------------------------------------------------------------------
-void GetXMLWriter( const String&, WriterRef& xRet )
+void GetXMLWriter( const String& rName, WriterRef& xRet )
{
- xRet = new SwXMLWriter;
+ xRet = new SwXMLWriter( rName.EqualsAscii( "XML" ) );
}
// -----------------------------------------------------------------------
@@ -177,11 +226,14 @@ void GetXMLWriter( const String&, WriterRef& xRet )
Source Code Control System - Header
- $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/xml/wrtxml.cxx,v 1.6 2000-11-27 13:44:40 mib Exp $
+ $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/xml/wrtxml.cxx,v 1.7 2000-12-02 10:57:15 mib Exp $
Source Code Control System - Update
$Log: not supported by cvs2svn $
+ Revision 1.6 2000/11/27 13:44:40 mib
+ #80795#: Use packages within XML filter
+
Revision 1.5 2000/11/20 11:17:53 mib
Put edit engine's and numbering rules' fonts into the pool
diff --git a/sw/source/filter/xml/wrtxml.hxx b/sw/source/filter/xml/wrtxml.hxx
index bdc91f054444..9af78027ab0f 100644
--- a/sw/source/filter/xml/wrtxml.hxx
+++ b/sw/source/filter/xml/wrtxml.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: wrtxml.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:14:59 $
+ * last change: $Author: mib $ $Date: 2000-12-02 10:57:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,14 +70,17 @@ class SwDoc;
class SwPaM;
class SfxMedium;
-class SwXMLWriter : public Writer
+class SwXMLWriter : public StgWriter
{
+ sal_Bool bPlain;
+
protected:
virtual sal_uInt32 WriteStream();
+ virtual sal_uInt32 WriteStorage();
public:
- SwXMLWriter();
+ SwXMLWriter( sal_Bool bPl );
virtual ~SwXMLWriter();
virtual sal_uInt32 Write( SwPaM& rPam, SfxMedium& rMed,
diff --git a/sw/source/filter/xml/xmlbrsh.cxx b/sw/source/filter/xml/xmlbrsh.cxx
index e500fc83ae4e..8701485ba80e 100644
--- a/sw/source/filter/xml/xmlbrsh.cxx
+++ b/sw/source/filter/xml/xmlbrsh.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlbrsh.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:14:59 $
+ * last change: $Author: mib $ $Date: 2000-12-02 10:57:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -80,9 +80,13 @@
#ifndef _SVX_BRSHITEM_HXX
#include <svx/brshitem.hxx>
#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
#include "xmlbrshi.hxx"
#include "xmlbrshe.hxx"
+#include "xmlexp.hxx"
using namespace ::rtl;
using namespace ::com::sun::star;
@@ -133,7 +137,8 @@ void SwXMLBrushItemImportContext::ProcessAttrs(
switch( aTokenMap.Get( nPrefix, aLocalName ) )
{
case XML_TOK_BGIMG_HREF:
- pItem->importXML( rValue, MID_GRAPHIC_LINK, rUnitConv );
+ pItem->importXML( GetImport().ResolveGraphicObjectURL( rValue,sal_False),
+ MID_GRAPHIC_LINK, rUnitConv );
break;
case XML_TOK_BGIMG_TYPE:
case XML_TOK_BGIMG_ACTUATE:
@@ -189,100 +194,57 @@ SwXMLBrushItemImportContext::~SwXMLBrushItemImportContext()
delete pItem;
}
-OUString SwXMLBrushItemExport::GetQNameByKey(
- sal_uInt16 nKey,
- const OUString& rLocalName ) const
-{
- if( pNamespaceMap )
- return pNamespaceMap->GetQNameByKey( nKey, rLocalName );
- else
- return rLocalName;
-}
-
-void SwXMLBrushItemExport::ClearAttrList()
-{
- pAttrList->Clear();
-}
-
-#ifndef PRODUCT
-void SwXMLBrushItemExport::CheckAttrList()
-{
- DBG_ASSERT( !pAttrList->getLength(),
- "SvxXMLBrsuhItemExport::CheckAttrList: list is not empty" );
-}
-#endif
-
-void SwXMLBrushItemExport::AddAttribute( sal_uInt16 nPrefixKey,
- const sal_Char *pName,
- const OUString& rValue )
+SwXMLBrushItemExport::SwXMLBrushItemExport( SwXMLExport& rExp ) :
+ rExport( rExp )
{
- OUString sName( OUString::createFromAscii( pName ) );
-
- pAttrList->AddAttribute( GetQNameByKey( nPrefixKey, sName ),
- sCDATA, rValue );
-}
-
-SwXMLBrushItemExport::SwXMLBrushItemExport(
- const Reference< xml::sax::XDocumentHandler >& rHandler,
- const SvXMLUnitConverter& rUnitConverter ) :
- sCDATA( OUString::createFromAscii( sXML_CDATA ) ),
- pNamespaceMap( 0 ),
- rUnitConv( rUnitConverter ),
- pAttrList( new SvXMLAttributeList )
-{
- xHandler = rHandler;
- xAttrList = pAttrList;
}
SwXMLBrushItemExport::~SwXMLBrushItemExport()
{
}
-void SwXMLBrushItemExport::exportXML( const SvxBrushItem& rItem,
- const SvXMLNamespaceMap& rNamespaceMap )
+void SwXMLBrushItemExport::exportXML( const SvxBrushItem& rItem )
{
- pNamespaceMap = &rNamespaceMap;
-
- CheckAttrList();
+ GetExport().CheckAttrList();
OUString sValue;
+ const SvXMLUnitConverter& rUnitConv = GetExport().GetTwipUnitConverter();
if( rItem.exportXML( sValue, MID_GRAPHIC_LINK, rUnitConv ) )
{
- AddAttribute( XML_NAMESPACE_XLINK, sXML_href, sValue );
- AddAttribute( XML_NAMESPACE_XLINK, sXML_type,
+ GetExport().AddAttribute( XML_NAMESPACE_XLINK, sXML_href,
+ GetExport().AddEmbeddedGraphicObject( sValue ) );
+ GetExport().AddAttribute( XML_NAMESPACE_XLINK, sXML_type,
OUString::createFromAscii(sXML_simple) );
// AddAttribute( XML_NAMESPACE_XLINK, sXML_show, ACP2WS(sXML_embed) );
- AddAttribute( XML_NAMESPACE_XLINK, sXML_actuate,
+ GetExport().AddAttribute( XML_NAMESPACE_XLINK, sXML_actuate,
OUString::createFromAscii(sXML_onLoad) );
if( rItem.exportXML( sValue, MID_GRAPHIC_POSITION, rUnitConv ) )
- AddAttribute( XML_NAMESPACE_STYLE, sXML_position, sValue );
+ GetExport().AddAttribute( XML_NAMESPACE_STYLE, sXML_position, sValue );
if( rItem.exportXML( sValue, MID_GRAPHIC_REPEAT, rUnitConv ) )
- AddAttribute( XML_NAMESPACE_STYLE, sXML_repeat, sValue );
+ GetExport().AddAttribute( XML_NAMESPACE_STYLE, sXML_repeat, sValue );
if( rItem.exportXML( sValue, MID_GRAPHIC_FILTER, rUnitConv ) )
- AddAttribute( XML_NAMESPACE_STYLE, sXML_filter_name, sValue );
+ GetExport().AddAttribute( XML_NAMESPACE_STYLE, sXML_filter_name, sValue );
}
- OUString sElem( GetQNameByKey( XML_NAMESPACE_STYLE,
- OUString::createFromAscii(sXML_background_image) ) );
- xHandler->startElement( sElem, xAttrList );
- ClearAttrList();
- xHandler->endElement( sElem );
-
- pNamespaceMap = 0;
+ SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, sXML_background_image,
+ sal_True, sal_True );
}
/*************************************************************************
Source Code Control ::com::sun::star::chaos::System - Header
- $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/xml/xmlbrsh.cxx,v 1.1.1.1 2000-09-18 17:14:59 hr Exp $
+ $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/xml/xmlbrsh.cxx,v 1.2 2000-12-02 10:57:15 mib Exp $
Source Code Control ::com::sun::star::chaos::System - Update
$Log: not supported by cvs2svn $
+ Revision 1.1.1.1 2000/09/18 17:14:59 hr
+ initial import
+
Revision 1.2 2000/09/18 16:05:05 willem.vandorp
OpenOffice header added.
diff --git a/sw/source/filter/xml/xmlbrshe.hxx b/sw/source/filter/xml/xmlbrshe.hxx
index 813991daf3c0..bcd15571c375 100644
--- a/sw/source/filter/xml/xmlbrshe.hxx
+++ b/sw/source/filter/xml/xmlbrshe.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlbrshe.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:14:59 $
+ * last change: $Author: mib $ $Date: 2000-12-02 10:57:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -71,50 +71,23 @@
#endif
-class SvXMLNamespaceMap;
-class SvXMLUnitConverter;
class SvxBrushItem;
+class SwXMLExport;
class SwXMLBrushItemExport
{
- const ::rtl::OUString sCDATA;
-
- // the handler
- ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XDocumentHandler > xHandler;
-
- // a common attribute list and an interface of it
- SvXMLAttributeList *pAttrList;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList > xAttrList;
-
- const SvXMLNamespaceMap *pNamespaceMap; // the namepspace map
- const SvXMLUnitConverter& rUnitConv;
+ SwXMLExport& rExport;
protected:
- // Check if common attribute list is empty.
-#ifdef PRODUCT
- void CheckAttrList() {}
-#else
- void CheckAttrList();
-#endif
- void ClearAttrList();
- void AddAttribute( sal_uInt16 nPrefixKey, const sal_Char *pName,
- const ::rtl::OUString& rValue );
- ::rtl::OUString GetQNameByKey( sal_uInt16 nKey,
- const ::rtl::OUString& rLocalName ) const;
+ SwXMLExport& GetExport() { return rExport; }
public:
- SwXMLBrushItemExport(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
- const SvXMLUnitConverter& rUnitConverter );
+ SwXMLBrushItemExport( SwXMLExport& rExport );
~SwXMLBrushItemExport();
// core API
- void exportXML( const SvxBrushItem& rItem,
- const SvXMLNamespaceMap& rNamespMap );
+ void exportXML( const SvxBrushItem& rItem );
};
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 120330b48bb0..8258ea237761 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.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: mib $ $Date: 2000-11-27 13:44:40 $
+ * last change: $Author: mib $ $Date: 2000-12-02 10:57:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -137,6 +137,7 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::container;
#ifdef XML_CORE_API
void SwXMLExport::SetCurPaM( SwPaM& rPaM, sal_Bool bWhole, sal_Bool bTabOnly )
@@ -178,9 +179,10 @@ void SwXMLExport::SetCurPaM( SwPaM& rPaM, sal_Bool bWhole, sal_Bool bTabOnly )
SwXMLExport::SwXMLExport( const Reference< XModel >& rModel, SwPaM& rPaM,
const OUString& rFileName,
const Reference< xml::sax::XDocumentHandler > & rHandler,
+ const Reference< XIndexContainer > & rEmbeddedGrfObjs,
sal_Bool bExpWholeDoc, sal_Bool bExpFirstTableOnly,
- sal_Bool bShowProg ) :
- SvXMLExport( rFileName, rHandler, rModel,
+ sal_Bool bShowProg, SvStorage *pPkg ) :
+ SvXMLExport( rFileName, rHandler, rModel, rEmbeddedGrfObjs,
SW_MOD()->GetMetric( rPaM.GetDoc()->IsHTMLMode() ) ),
pDoc( rPaM.GetDoc() ),
#ifdef XML_CORE_API
@@ -194,7 +196,8 @@ SwXMLExport::SwXMLExport( const Reference< XModel >& rModel, SwPaM& rPaM,
bExportFirstTableOnly( bExpFirstTableOnly ),
bShowProgress( bShowProg ),
sNumberFormat(RTL_CONSTASCII_USTRINGPARAM("NumberFormat")),
- sCell(RTL_CONSTASCII_USTRINGPARAM("Cell"))
+ sCell(RTL_CONSTASCII_USTRINGPARAM("Cell")),
+ xPackage( pPkg )
{
const SfxPoolItem* pItem;
const SfxItemPool& rPool = pDoc->GetAttrPool();
@@ -406,6 +409,7 @@ const SwNoTxtNode *SwXMLTextParagraphExport::GetNoTxtNode(
return pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetNoTxtNode();
}
+#if 0
OUString SwXMLTextParagraphExport::exportTextEmbeddedGraphic(
const Reference < XPropertySet >& rPropSet )
{
@@ -427,6 +431,7 @@ OUString SwXMLTextParagraphExport::exportTextEmbeddedGraphic(
}
return aName;
}
+#endif
OUString SwXMLTextParagraphExport::exportTextEmbeddedObject(
const Reference < XPropertySet >& rPropSet )
diff --git a/sw/source/filter/xml/xmlexp.hxx b/sw/source/filter/xml/xmlexp.hxx
index c4d64a45d4ac..40061d2a3c75 100644
--- a/sw/source/filter/xml/xmlexp.hxx
+++ b/sw/source/filter/xml/xmlexp.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlexp.hxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: mib $ $Date: 2000-11-27 13:44:40 $
+ * last change: $Author: mib $ $Date: 2000-12-02 10:57:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -186,8 +186,10 @@ public:
SwPaM& rPaM, const ::rtl::OUString& rFileName,
const ::com::sun::star::uno::Reference<
::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XIndexContainer > &,
sal_Bool bExpWholeDoc, sal_Bool bExpFirstTableOnly,
- sal_Bool bShowProgr );
+ sal_Bool bShowProgr, SvStorage *pPkg );
virtual ~SwXMLExport();
inline const SvXMLUnitConverter& GetTwipUnitConverter() const;
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index 6f426c1b93d5..329ac9fbcd67 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlfmte.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: mib $ $Date: 2000-11-23 14:42:37 $
+ * last change: $Author: mib $ $Date: 2000-12-02 10:57:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -453,12 +453,19 @@ void SwXMLExport::_ExportAutoStyles()
pProgress->SetValue( nContentProgressStart );
GetTextParagraphExport()->SetProgress( nContentProgressStart );
}
+
+ // The order in which styles are collected *MUST* be the same as
+ // the order in which they are exported. Otherwise, caching will
+ // fail.
+ // exported in _ExportMasterStyles
+ GetPageExport()->collectAutoStyles( sal_False );
+
+ // exported in _ExportContent
Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
Reference < XText > xText = xTextDoc->getText();
GetTextParagraphExport()->collectFrameBoundToPageAutoStyles( bShowProgress );
GetTextParagraphExport()->collectTextAutoStyles( xText, bShowProgress );
- GetPageExport()->collectAutoStyles( sal_False );
GetTextParagraphExport()->exportTextAutoStyles();
GetPageExport()->exportAutoStyles();
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 8955c9124320..bc6f16f2c42e 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.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: ab $ $Date: 2000-11-28 11:48:49 $
+ * last change: $Author: mib $ $Date: 2000-12-02 10:57:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -269,8 +269,10 @@ SwXMLImport::SwXMLImport(
SwDoc& rDoc, const SwPaM& rPaM,
sal_Bool bLDoc, sal_Bool bInsertMode, sal_uInt16 nStyleFamMask,
const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & rModel ) :
- SvXMLImport( rModel ),
+ ::com::sun::star::frame::XModel > & rModel,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XIndexContainer > & rEGO ) :
+ SvXMLImport( rModel, rEGO ),
bLoadDoc( bLDoc ),
bInsert( bInsertMode ),
nStyleFamilyMask( nStyleFamMask ),
diff --git a/sw/source/filter/xml/xmlimp.hxx b/sw/source/filter/xml/xmlimp.hxx
index b41c3684c2be..108e35fede68 100644
--- a/sw/source/filter/xml/xmlimp.hxx
+++ b/sw/source/filter/xml/xmlimp.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlimp.hxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: ab $ $Date: 2000-11-28 11:48:00 $
+ * last change: $Author: mib $ $Date: 2000-12-02 10:57:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -136,7 +136,9 @@ public:
SwXMLImport( SwDoc& rDoc, const SwPaM& rPaM, sal_Bool bLoadDoc,
sal_Bool bInsertMode, sal_uInt16 nStyleFamMask,
const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & rModel );
+ ::com::sun::star::frame::XModel > & rModel,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XIndexContainer > & );
~SwXMLImport();
diff --git a/sw/source/filter/xml/xmliteme.cxx b/sw/source/filter/xml/xmliteme.cxx
index 12147f4fdcef..5f9e4f2cd53e 100644
--- a/sw/source/filter/xml/xmliteme.cxx
+++ b/sw/source/filter/xml/xmliteme.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmliteme.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: mib $ $Date: 2000-11-07 14:05:53 $
+ * last change: $Author: mib $ $Date: 2000-12-02 10:57:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -149,10 +149,9 @@ extern SvXMLItemMapEntry aXMLTableCellItemMap[];
class SwXMLTableItemMapper_Impl: public SvXMLExportItemMapper
{
const OUString sCDATA;
+ SwXMLBrushItemExport aBrushItemExport;
protected:
- SvXMLUnitConverter& mrUnitConverter;
- const Reference< xml::sax::XDocumentHandler > & mrHandler;
sal_uInt32 nAbsWidth;
@@ -165,8 +164,7 @@ public:
SwXMLTableItemMapper_Impl(
SvXMLItemMapEntriesRef rMapEntries,
- SvXMLUnitConverter& rUnitConverter,
- const Reference< xml::sax::XDocumentHandler > & rHandler );
+ SwXMLExport& rExp );
virtual ~SwXMLTableItemMapper_Impl();
@@ -191,12 +189,10 @@ public:
SwXMLTableItemMapper_Impl::SwXMLTableItemMapper_Impl(
SvXMLItemMapEntriesRef rMapEntries,
- SvXMLUnitConverter& rUnitConverter,
- const Reference< xml::sax::XDocumentHandler > & rHandler ) :
+ SwXMLExport& rExp ) :
SvXMLExportItemMapper( rMapEntries ),
sCDATA( OUString::createFromAscii( sXML_CDATA ) ),
- mrUnitConverter(rUnitConverter),
- mrHandler( rHandler ),
+ aBrushItemExport( rExp ),
nAbsWidth( USHRT_MAX )
{
}
@@ -304,9 +300,8 @@ void SwXMLTableItemMapper_Impl::handleElementItem(
{
case RES_BACKGROUND:
{
- SwXMLBrushItemExport aBrushItemExport( rHandler, rUnitConverter );
- aBrushItemExport.exportXML( (const SvxBrushItem&)rItem,
- rNamespaceMap );
+ ((SwXMLTableItemMapper_Impl *)this)->aBrushItemExport.exportXML(
+ (const SvxBrushItem&)rItem );
}
break;
}
@@ -328,9 +323,7 @@ void SwXMLExport::_InitItemExport()
xTableRowItemMap = new SvXMLItemMapEntries( aXMLTableRowItemMap );
xTableCellItemMap = new SvXMLItemMapEntries( aXMLTableCellItemMap );
- pTableItemMapper = new SwXMLTableItemMapper_Impl( xTableItemMap,
- *pTwipUnitConv,
- GetDocHandler() );
+ pTableItemMapper = new SwXMLTableItemMapper_Impl( xTableItemMap, *this );
}
void SwXMLExport::_FinitItemExport()
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index be40ba6d5eda..d0f216aa7eba 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmltble.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: dvo $ $Date: 2000-12-01 18:48:57 $
+ * last change: $Author: mib $ $Date: 2000-12-02 10:57:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1056,8 +1056,8 @@ void SwXMLTextParagraphExport::exportTable(
const Reference < XTextContent > & rTextContent,
sal_Bool bAutoStyles, sal_Bool bProgress )
{
- ASSERT( ((SwXMLExport&)GetExport()).IsShowProgress() == bProgress,
- "inconsistent progress flags" );
+// ASSERT( ((SwXMLExport&)GetExport()).IsShowProgress() == bProgress,
+// "inconsistent progress flags" );
// Reference < XPropertySet > xPropSet( rTextContent, UNO_QUERY );
// Any aAny = xPropSet->getPropertyValue( sTextTable );
diff --git a/sw/source/filter/xml/xmltexte.hxx b/sw/source/filter/xml/xmltexte.hxx
index 570b8cad53c3..582ab1785f58 100644
--- a/sw/source/filter/xml/xmltexte.hxx
+++ b/sw/source/filter/xml/xmltexte.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmltexte.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: mib $ $Date: 2000-11-27 13:44:40 $
+ * last change: $Author: mib $ $Date: 2000-12-02 10:57:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -98,9 +98,9 @@ public:
SvXMLAutoStylePoolP& rAutoStylePool );
~SwXMLTextParagraphExport();
- virtual ::rtl::OUString exportTextEmbeddedGraphic(
- const ::com::sun::star::uno::Reference <
- ::com::sun::star::beans::XPropertySet >& rPropSet );
+// virtual ::rtl::OUString exportTextEmbeddedGraphic(
+// const ::com::sun::star::uno::Reference <
+// ::com::sun::star::beans::XPropertySet >& rPropSet );
virtual ::rtl::OUString exportTextEmbeddedObject(
const ::com::sun::star::uno::Reference <
::com::sun::star::beans::XPropertySet >& rPropSet );