summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMichael Brauer <mib@openoffice.org>2001-05-29 11:55:39 +0000
committerMichael Brauer <mib@openoffice.org>2001-05-29 11:55:39 +0000
commita866ee687e58303c22a01f99a1998b0fcb7c87d2 (patch)
tree00bac162babece5c74484b878116f0da90701d50 /sw/source
parent74ecb6ad742e1219d25b2d1d7ae6cd4b3c94e433 (diff)
#87530#: Load/Save layout
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/xml/swxml.cxx19
-rw-r--r--sw/source/filter/xml/wrtxml.cxx37
2 files changed, 51 insertions, 5 deletions
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 4178e10aaf86..06d56e339062 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.33 $
+ * $Revision: 1.34 $
*
- * last change: $Author: mib $ $Date: 2001-05-21 06:00:38 $
+ * last change: $Author: mib $ $Date: 2001-05-29 12:55:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -426,10 +426,12 @@ sal_uInt32 XMLReader::Read( SwDoc &rDoc, SwPaM &rPaM, const String & rName )
*pStorage, *pPersist,
EMBEDDEDOBJECTHELPER_MODE_READ,
sal_False );
+#if SUPD > 632
else
pObjectHelper = SvXMLEmbeddedObjectHelper::Create(
*pPersist,
EMBEDDEDOBJECTHELPER_MODE_READ );
+#endif
xObjectResolver = pObjectHelper;
}
@@ -615,6 +617,19 @@ sal_uInt32 XMLReader::Read( SwDoc &rDoc, SwPaM &rPaM, const String & rName )
aFilterArgs, rName, sal_True, IsBlockMode(), xInsertTextRange,
aOpt.IsFmtsOnly(), nStyleFamilyMask, !aOpt.IsMerge(),
sal_False );
+
+ if( !(IsOrganizerMode() || IsBlockMode() || bInsertMode ||
+ aOpt.IsFmtsOnly() ) )
+ {
+ OUString sStreamName( RTL_CONSTASCII_USTRINGPARAM("layout-cache") );
+ SvStorageStreamRef xStrm = pStorage->OpenStream( sStreamName,
+ STREAM_READ | STREAM_NOCREATE );
+ if( xStrm.Is() && !xStrm->GetError() )
+ {
+ xStrm->SetBufferSize( 16*1024 );
+ rDoc.ReadLayoutCache( *xStrm );
+ }
+ }
if( !nRet )
{
if( nWarn )
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index 30b56f198a4d..bbe63b718811 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.30 $
+ * $Revision: 1.31 $
*
- * last change: $Author: mib $ $Date: 2001-05-21 06:00:38 $
+ * last change: $Author: mib $ $Date: 2001-05-29 12:55:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -102,6 +102,9 @@
#ifndef _DOC_HXX //autogen wg. SwDoc
#include <doc.hxx>
#endif
+#ifndef _DOCSTAT_HXX //autogen wg. SwDoc
+#include <docstat.hxx>
+#endif
#ifndef _DOCSH_HXX //autogen wg. SwDoc
#include <docsh.hxx>
#endif
@@ -177,10 +180,12 @@ sal_uInt32 SwXMLWriter::_Write()
*pStg, *pPersist,
EMBEDDEDOBJECTHELPER_MODE_WRITE,
sal_False );
+#if SUPD > 632
else
pObjectHelper = SvXMLEmbeddedObjectHelper::Create(
*pPersist,
EMBEDDEDOBJECTHELPER_MODE_WRITE );
+#endif
xObjectResolver = pObjectHelper;
}
@@ -362,6 +367,29 @@ sal_uInt32 SwXMLWriter::_Write()
RTL_TEXTENCODING_ASCII_US );
}
}
+
+ if( pDoc->GetRootFrm() && pDoc->GetDocStat().nPage > 1 &&
+ !(bOrganizerMode || bBlock || bErr) )
+ {
+// DBG_ASSERT( !pDoc->GetDocStat().bModified,
+// "doc stat is modified!" );
+ OUString sStreamName( RTL_CONSTASCII_USTRINGPARAM("layout-cache") );
+ SvStorageStreamRef xStrm = pStg->OpenStream( sStreamName,
+ STREAM_WRITE | STREAM_SHARE_DENYWRITE );
+ DBG_ASSERT(xStrm.Is(), "Can't create output stream in package!");
+ if( xStrm.Is() )
+ {
+ xStrm->SetSize( 0 );
+ String aPropName( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM("MediaType") ) );
+ OUString aMime( RTL_CONSTASCII_USTRINGPARAM("appication/binary") );
+ uno::Any aAny;
+ aAny <<= aMime;
+ xStrm->SetProperty( aPropName, aAny );
+ xStrm->SetBufferSize( 16*1024 );
+ pDoc->WriteLayoutCache( *xStrm );
+ xStrm->Commit();
+ }
+ }
}
else
{
@@ -574,11 +602,14 @@ void GetXMLWriter( const String& rName, 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.30 2001-05-21 06:00:38 mib Exp $
+ $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/xml/wrtxml.cxx,v 1.31 2001-05-29 12:55:39 mib Exp $
Source Code Control System - Update
$Log: not supported by cvs2svn $
+ Revision 1.30 2001/05/21 06:00:38 mib
+ #87246#: OLE support for flat files
+
Revision 1.29 2001/05/14 12:26:47 dvo
- fixed: no settings or meta data in block mode
- fixed: use OUString instead of String