diff options
author | Michael Brauer <mib@openoffice.org> | 2001-03-06 10:17:30 +0000 |
---|---|---|
committer | Michael Brauer <mib@openoffice.org> | 2001-03-06 10:17:30 +0000 |
commit | 3358aeb95e37b3e36aba09e90ba396a79c16e4b1 (patch) | |
tree | 9cec2961e14e9f9689be8ac681bd7b2a75efcf2e | |
parent | 86b7bd8cbfda37f9c21bb05fb1c6c4f050e47ec7 (diff) |
organizer support for XML file format
-rw-r--r-- | sw/inc/shellio.hxx | 12 | ||||
-rw-r--r-- | sw/source/filter/basflt/shellio.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/writer/writer.cxx | 15 | ||||
-rw-r--r-- | sw/source/ui/app/docsh.cxx | 15 | ||||
-rw-r--r-- | sw/source/ui/app/docshini.cxx | 52 |
5 files changed, 84 insertions, 21 deletions
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx index 6783c5a95093..6ec9e5ec318a 100644 --- a/sw/inc/shellio.hxx +++ b/sw/inc/shellio.hxx @@ -2,9 +2,9 @@ * * $RCSfile: shellio.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: mib $ $Date: 2001-02-26 07:54:04 $ + * last change: $Author: mib $ $Date: 2001-03-06 11:08:07 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -267,6 +267,7 @@ protected: BOOL bTmplBrowseMode : 1; BOOL bReadUTF8: 1; // Stream als UTF-8 interpretieren BOOL bBlockMode: 1; + BOOL bOrganizerMode : 1; public: Reader(); @@ -298,6 +299,9 @@ public: BOOL IsBlockMode() const { return bBlockMode; } void SetBlockMode( BOOL bSet ) { bBlockMode = bSet; } + BOOL IsOrganizerMode() const { return bOrganizerMode; } + void SetOrganizerMode( BOOL bSet ) { bOrganizerMode = bSet; } + virtual BOOL HasGlossaries() const; virtual BOOL ReadGlossaries( SwTextBlocks&, BOOL bSaveRelFiles ) const; @@ -478,6 +482,7 @@ public: BOOL bUCS2_WithStartChar : 1; BOOL bBlock : 1; + BOOL bOrganizerMode : 1; Writer(); virtual ~Writer(); @@ -543,6 +548,9 @@ public: #else SvStream& Strm(); #endif + + BOOL IsOrganizerMode() const { return bOrganizerMode; } + void SetOrganizerMode( BOOL bSet ) { bOrganizerMode = bSet; } }; #ifndef SW_DECL_WRITER_DEFINED diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index c4a371e1e24d..c19eb43594ca 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -2,9 +2,9 @@ * * $RCSfile: shellio.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: jp $ $Date: 2001-02-08 12:48:41 $ + * last change: $Author: mib $ $Date: 2001-03-06 11:08:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -182,6 +182,7 @@ ULONG SwReader::Read( const Reader& rOptions ) { po->SetReadUTF8( FALSE ); po->SetBlockMode( FALSE ); + po->SetOrganizerMode( FALSE ); return ERR_SWG_FILE_FORMAT_ERROR; } @@ -462,6 +463,7 @@ ULONG SwReader::Read( const Reader& rOptions ) po->SetReadUTF8( FALSE ); po->SetBlockMode( FALSE ); + po->SetOrganizerMode( FALSE ); return nError; } @@ -542,7 +544,7 @@ SwReader::SwReader( SfxMedium& rMedium, const String& rFileName, SwPaM& rPam ) Reader::Reader() : pStrm(0), pStg(0), pMedium(0), pTemplate(0), bTmplBrowseMode( FALSE ), bInsertMode( FALSE ), - bReadUTF8( FALSE ), bBlockMode( FALSE ) + bReadUTF8( FALSE ), bBlockMode( FALSE ), bOrganizerMode( FALSE ) { } @@ -1084,6 +1086,9 @@ BOOL SetHTMLTemplate( SwDoc & rDoc ) /************************************************************************* $Log: not supported by cvs2svn $ + Revision 1.7 2001/02/08 12:48:41 jp + remove using statements + Revision 1.6 2001/01/22 13:42:57 mib Block mode for Readers added diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index f59c68e70fae..c9ae47052145 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: writer.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: os $ $Date: 2001-02-27 14:59:28 $ + * last change: $Author: mib $ $Date: 2001-03-06 11:13:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -219,7 +219,8 @@ Writer::Writer() { bWriteAll = bShowProgress = bUCS2_WithStartChar = TRUE; bASCII_NoLastLineEnd = bASCII_ParaAsBlanc = bASCII_ParaAsCR = - bWriteClipboardDoc = bWriteOnlyFirstTable = bBlock = FALSE; + bWriteClipboardDoc = bWriteOnlyFirstTable = bBlock = + bOrganizerMode = FALSE; } Writer::~Writer() @@ -245,7 +246,8 @@ void Writer::ResetWriter() bShowProgress = bUCS2_WithStartChar = TRUE; bASCII_NoLastLineEnd = bASCII_ParaAsBlanc = bASCII_ParaAsCR = - bWriteClipboardDoc = bWriteOnlyFirstTable = bBlock = FALSE; + bWriteClipboardDoc = bWriteOnlyFirstTable = bBlock = + bOrganizerMode = FALSE; } BOOL Writer::CopyNextPam( SwPaM ** ppPam ) @@ -658,11 +660,14 @@ ULONG StgWriter::Write( SwPaM& rPaM, SvStorage& rStg, const String* pFName ) Source Code Control System - Header - $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/writer/writer.cxx,v 1.8 2001-02-27 14:59:28 os Exp $ + $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/writer/writer.cxx,v 1.9 2001-03-06 11:13:10 mib Exp $ Source Code Control System - Update $Log: not supported by cvs2svn $ + Revision 1.8 2001/02/27 14:59:28 os + Complete use of DefaultNumbering component + Revision 1.7 2001/01/22 12:29:52 mib Block mode for Writers added diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index 77664c7ce062..8bc19c4a00e8 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docsh.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: mba $ $Date: 2001-03-05 12:48:58 $ + * last change: $Author: mib $ $Date: 2001-03-06 11:07:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -532,7 +532,16 @@ BOOL SwDocShell::Save() break; case SFX_CREATE_MODE_ORGANIZER: - if( !bXML ) + if( bXML ) + { + WriterRef xWrt; + ::GetXMLWriter( aEmptyStr, xWrt ); + xWrt->SetOrganizerMode( TRUE ); + SwWriter aWrt( *pIo->GetStorage(), *pDoc ); + nErr = aWrt.Write( xWrt ); + xWrt->SetOrganizerMode( FALSE ); + } + else nErr = pIo->SaveStyles(); break; diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx index 432eb6de96cd..409e75a80762 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docshini.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: mib $ $Date: 2001-02-26 07:56:31 $ + * last change: $Author: mib $ $Date: 2001-03-06 11:07:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -555,7 +555,17 @@ sal_Bool SwDocShell::Load(SvStorage* pStor) // break; case SFX_CREATE_MODE_ORGANIZER: - if( !bXML ) + if( bXML ) + { + if( ReadXML ) + { + ReadXML->SetOrganizerMode( TRUE ); + SwReader aRdr( *pStor, aEmptyStr, pDoc ); + nErr = aRdr.Read( *ReadXML ); + ReadXML->SetOrganizerMode( FALSE ); + } + } + else nErr = pIo->LoadStyles( pStor ); break; @@ -705,11 +715,31 @@ sal_Bool SwDocShell::LoadFrom(SvStorage* pStor) do { // middle check loop sal_uInt32 nErr = ERR_SWG_READ_ERROR; const String& rNm = pStor->GetName(); - if( pStor->IsStream( SfxStyleSheetBasePool::GetStreamName() )) + String aStreamName; + sal_Bool bXML = pStor->GetVersion() >= SOFFICE_FILEFORMAT_60; + if( bXML ) + aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM("styles.xml")); + else + aStreamName = SfxStyleSheetBasePool::GetStreamName(); + if( pStor->IsStream( aStreamName ) ) { // Das Laden SwWait aWait( *this, sal_True ); - nErr = pIo->LoadStyles( pStor ); + if( bXML ) + { + ASSERT( !pBasePool, "wer hat seinen Pool nicht zerstoert?" ); + pBasePool = new SwDocStyleSheetPool( *pDoc, + SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); + if( ReadXML ) + { + ReadXML->SetOrganizerMode( TRUE ); + SwReader aRdr( *pStor, aEmptyStr, pDoc ); + nErr = aRdr.Read( *ReadXML ); + ReadXML->SetOrganizerMode( FALSE ); + } + } + else + nErr = pIo->LoadStyles( pStor ); } else { @@ -730,9 +760,12 @@ sal_Bool SwDocShell::LoadFrom(SvStorage* pStor) } } - ASSERT( !pBasePool, "wer hat seinen Pool nicht zerstoert?" ); - pBasePool = new SwDocStyleSheetPool( *pDoc, - SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); + if( !bXML ) + { + ASSERT( !pBasePool, "wer hat seinen Pool nicht zerstoert?" ); + pBasePool = new SwDocStyleSheetPool( *pDoc, + SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); + } SetError( nErr ); bRet = !IsError( nErr ); @@ -825,6 +858,9 @@ void SwDocShell::SubInitNew() /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.12 2001/02/26 07:56:31 mib + xml filters for templates and global docs + Revision 1.11 2001/02/08 15:51:15 mtg Added InvalidateModel/ReactivateModel |