summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMichael Brauer <mib@openoffice.org>2000-11-27 12:44:40 +0000
committerMichael Brauer <mib@openoffice.org>2000-11-27 12:44:40 +0000
commit96cbd76ec4c76b34eca53becfaeab3fad6140570 (patch)
treeb57917700f58df70c4350da8c9e23964a7f056cb /sw/source
parent8c1047f0b1fd3f77297b2fd1a250420b42197fce (diff)
#80795#: Use packages within XML filter
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/xml/makefile.mk7
-rw-r--r--sw/source/filter/xml/wrtxml.cxx11
-rw-r--r--sw/source/filter/xml/xmlexp.cxx62
-rw-r--r--sw/source/filter/xml/xmlexp.hxx12
-rw-r--r--sw/source/filter/xml/xmltbli.cxx61
-rw-r--r--sw/source/filter/xml/xmltexte.hxx15
6 files changed, 96 insertions, 72 deletions
diff --git a/sw/source/filter/xml/makefile.mk b/sw/source/filter/xml/makefile.mk
index 94683007033d..2e667ceea6e0 100644
--- a/sw/source/filter/xml/makefile.mk
+++ b/sw/source/filter/xml/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.3 $
+# $Revision: 1.4 $
#
-# last change: $Author: mib $ $Date: 2000-11-13 08:44:24 $
+# last change: $Author: mib $ $Date: 2000-11-27 13:44:40 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -86,6 +86,7 @@ CXXFILES = \
wrtxml.cxx \
xmlexp.cxx \
xmltext.cxx \
+ xmltexti.cxx \
xmltbli.cxx \
xmltble.cxx \
xmlfmt.cxx \
@@ -104,6 +105,7 @@ SLOFILES = \
$(SLO)$/wrtxml.obj \
$(SLO)$/xmlexp.obj \
$(SLO)$/xmltext.obj \
+ $(SLO)$/xmltexti.obj \
$(SLO)$/xmltbli.obj \
$(SLO)$/xmltble.obj \
$(SLO)$/xmlfmt.obj \
@@ -122,6 +124,7 @@ EXCEPTIONSFILES= \
$(SLO)$/wrtxml.obj \
$(SLO)$/xmlexp.obj \
$(SLO)$/xmltext.obj \
+ $(SLO)$/xmltexti.obj \
$(SLO)$/xmltbli.obj \
$(SLO)$/xmltble.obj \
$(SLO)$/xmlfmt.obj \
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index 4a5b826409d0..c25f25feca1f 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.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: mib $ $Date: 2000-11-20 11:17:53 $
+ * last change: $Author: mib $ $Date: 2000-11-27 13:44:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -143,7 +143,7 @@ sal_uInt32 SwXMLWriter::Write( SwPaM& rPaM, SfxMedium& rMed,
pDoc = rPaM.GetDoc();
PutNumFmtFontsInAttrPool();
- PutEditEngFontsInAttrPool();
+// PutEditEngFontsInAttrPool();
Reference< io::XOutputStream > xOut = rMed.GetDataSink();
Reference< io::XActiveDataSource > xSrc( xWriter, UNO_QUERY );
@@ -177,11 +177,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.5 2000-11-20 11:17:53 mib Exp $
+ $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 $
Source Code Control System - Update
$Log: not supported by cvs2svn $
+ Revision 1.5 2000/11/20 11:17:53 mib
+ Put edit engine's and numbering rules' fonts into the pool
+
Revision 1.4 2000/11/20 09:18:37 jp
must change: processfactory moved
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index b1f5c8ef9494..120330b48bb0 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.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: mib $ $Date: 2000-11-23 14:42:37 $
+ * last change: $Author: mib $ $Date: 2000-11-27 13:44:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -97,7 +97,12 @@
#ifndef _DOCSTAT_HXX
#include "docstat.hxx"
#endif
-
+#ifndef _NDOLE_HXX
+#include "ndole.hxx"
+#endif
+#ifndef _NDGRF_HXX
+#include "ndgrf.hxx"
+#endif
#ifndef _XMLOFF_NMSPMAP_HXX
#include <xmloff/nmspmap.hxx>
@@ -114,6 +119,9 @@
#ifndef _XMLOFF_PROGRESSBARHELPER_HXX
#include <xmloff/ProgressBarHelper.hxx>
#endif
+#ifndef _UNOFRAME_HXX
+#include "unoframe.hxx"
+#endif
#ifndef _XMLTEXTE_HXX
#include <xmltexte.hxx>
@@ -127,6 +135,8 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::lang;
#ifdef XML_CORE_API
void SwXMLExport::SetCurPaM( SwPaM& rPaM, sal_Bool bWhole, sal_Bool bTabOnly )
@@ -380,3 +390,49 @@ void SwXMLExport::ExportCurPaM( sal_Bool bExportWholePaM )
ExportListChange( aPrevNumInfo, aNextNumInfo );
}
#endif
+
+const SwNoTxtNode *SwXMLTextParagraphExport::GetNoTxtNode(
+ const Reference < XPropertySet >& rPropSet )
+{
+ Reference<XUnoTunnel> xCrsrTunnel( rPropSet, UNO_QUERY );
+ ASSERT( xCrsrTunnel.is(), "missing XUnoTunnel for embedded" );
+ SwXFrame *pFrame =
+ (SwXFrame *)xCrsrTunnel->getSomething(
+ SwXFrame::getUnoTunnelId() );
+ ASSERT( pFrame, "SwXFrame missing" );
+ SwFrmFmt *pFrmFmt = pFrame->GetFrmFmt();
+ const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt();
+ const SwNodeIndex *pNdIdx = rCntnt.GetCntntIdx();
+ return pNdIdx->GetNodes()[pNdIdx->GetIndex() + 1]->GetNoTxtNode();
+}
+
+OUString SwXMLTextParagraphExport::exportTextEmbeddedGraphic(
+ const Reference < XPropertySet >& rPropSet )
+{
+ OUString aName;
+ const SwGrfNode *pGrfNd = GetNoTxtNode( rPropSet )->GetGrfNode();
+ if( GRAPHIC_NONE != pGrfNd->GetGrf().GetType() )
+ {
+ // Falls die Grafik bereits im Storage ist, ist der Stream-Name
+ // gesetzt. Dann brauchen wir sie nicht mehr zu speichern.
+ // oder es ist ein SaveAs, dann auf jedenfall kopieren
+ SvStorage *pPackage = ((SwXMLExport&)GetExport()).GetPackage();
+ if( !pPackage ||
+ !((SwGrfNode *)pGrfNd)->StoreGraphics( pPackage ) )
+ {
+// Warning( WARN_SWG_POOR_LOAD );
+ }
+ else
+ aName = OUString( pGrfNd->GetStreamName() );
+ }
+ return aName;
+}
+
+OUString SwXMLTextParagraphExport::exportTextEmbeddedObject(
+ const Reference < XPropertySet >& rPropSet )
+{
+ const SwOLENode *pOLENd = GetNoTxtNode( rPropSet )->GetOLENode();
+
+ OUString aName( pOLENd->GetOLEObj().GetName() );
+ return aName;
+}
diff --git a/sw/source/filter/xml/xmlexp.hxx b/sw/source/filter/xml/xmlexp.hxx
index 16dbaf66dc96..c4d64a45d4ac 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.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: mib $ $Date: 2000-11-23 14:42:37 $
+ * last change: $Author: mib $ $Date: 2000-11-27 13:44:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,6 +62,10 @@
#ifndef _XMLEXP_HXX
#define _XMLEXP_HXX
+#ifndef _SVSTOR_HXX
+#include <so3/svstor.hxx>
+#endif
+
#ifndef _XMLOFF_XMLEXP_HXX
#include <xmloff/xmlexp.hxx>
#endif
@@ -103,6 +107,7 @@ class XMLPropertySetMapper;
//class XMLTextMasterPageExport;
class SwXMLTextParagraphExport;
+
class SwXMLExport : public SvXMLExport
{
friend class SwXMLExpContext;
@@ -123,6 +128,7 @@ class SwXMLExport : public SvXMLExport
SvXMLItemMapEntriesRef xTableCellItemMap;
UniReference < XMLPropertySetMapper > xParaPropMapper;
// UniReference < XMLTextMasterPageExport> xMasterPageExport;
+ SvStorageRef xPackage;
sal_Int32 nContentProgressStart;
sal_Bool bExportWholeDoc : 1;// export whole document?
@@ -198,6 +204,8 @@ public:
SwDoc& GetDoc() { return *pDoc; }
sal_Bool IsShowProgress() const { return bShowProgress; }
+
+ SvStorage *GetPackage() { return &xPackage; }
};
inline const SvXMLUnitConverter& SwXMLExport::GetTwipUnitConverter() const
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index a21b9234bb2e..b6f07167917d 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmltbli.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: mib $ $Date: 2000-11-23 14:42:38 $
+ * last change: $Author: mib $ $Date: 2000-11-27 13:44:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2145,60 +2145,3 @@ Reference < XTextContent > SwXMLTableContext::GetXTextContent() const
{
return xTextContent;
}
-
-class SwXMLTextImportHelper : public XMLTextImportHelper
-{
-protected:
- virtual SvXMLImportContext *CreateTableChildContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< XAttributeList > & xAttrList );
-
-public:
- SwXMLTextImportHelper(
- const Reference < XModel>& rModel,
- sal_Bool bInsertM, sal_Bool bStylesOnlyM, sal_Bool bProgress );
- ~SwXMLTextImportHelper();
-
- virtual sal_Bool IsInHeaderFooter() const;
-};
-
-SwXMLTextImportHelper::SwXMLTextImportHelper(
- const Reference < XModel>& rModel,
- sal_Bool bInsertM, sal_Bool bStylesOnlyM, sal_Bool bProgress ) :
- XMLTextImportHelper( rModel, bInsertM, bStylesOnlyM, bProgress )
-{
-}
-
-SwXMLTextImportHelper::~SwXMLTextImportHelper()
-{
-}
-
-SvXMLImportContext *SwXMLTextImportHelper::CreateTableChildContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrefix, const OUString& rLocalName,
- const Reference< XAttributeList > & xAttrList )
-{
- return new SwXMLTableContext(
- (SwXMLImport&)rImport, nPrefix, rLocalName, xAttrList );
-}
-
-sal_Bool SwXMLTextImportHelper::IsInHeaderFooter() const
-{
- Reference<XUnoTunnel> xCrsrTunnel(
- ((SwXMLTextImportHelper *)this)->GetCursor(), UNO_QUERY );
- ASSERT( xCrsrTunnel.is(), "missing XUnoTunnel for Cursor" );
- SwXTextCursor *pTxtCrsr =
- (SwXTextCursor*)xCrsrTunnel->getSomething(
- SwXTextCursor::getUnoTunnelId() );
- ASSERT( pTxtCrsr, "SwXTextCursor missing" );
- SwDoc *pDoc = pTxtCrsr->GetDoc();
-
- return pDoc->IsInHeaderFooter( pTxtCrsr->GetPaM()->GetPoint()->nNode );
-}
-
-XMLTextImportHelper* SwXMLImport::CreateTextImport()
-{
- return new SwXMLTextImportHelper( GetModel(), IsInsertMode(),
- IsStylesOnlyMode(), bShowProgress );
-}
diff --git a/sw/source/filter/xml/xmltexte.hxx b/sw/source/filter/xml/xmltexte.hxx
index cf12d0dddacc..570b8cad53c3 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.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: mib $ $Date: 2000-11-21 14:38:35 $
+ * last change: $Author: mib $ $Date: 2000-11-27 13:44:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -76,6 +76,10 @@ class SwXMLTextParagraphExport : public XMLTextParagraphExport
{
const ::rtl::OUString sTextTable;
+ const SwNoTxtNode *GetNoTxtNode(
+ const ::com::sun::star::uno::Reference <
+ ::com::sun::star::beans::XPropertySet >& rPropSet );
+
protected:
virtual void exportStyleContent(
const ::com::sun::star::uno::Reference<
@@ -93,6 +97,13 @@ public:
SwXMLExport& rExp,
SvXMLAutoStylePoolP& rAutoStylePool );
~SwXMLTextParagraphExport();
+
+ 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 );
};