Kaydet (Commit) b5664488 authored tarafından Miklos Vajna's avatar Miklos Vajna

DOC export: allow saving as a template

Change-Id: I26894edd3962c2b2856d2bfa4a4aa4e6f4e65c9e
üst e52779d2
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
--> -->
<node oor:name="MS Word 97 Vorlage" oor:op="replace"> <node oor:name="MS Word 97 Vorlage" oor:op="replace">
<prop oor:name="Flags"><value>IMPORT TEMPLATE TEMPLATEPATH ALIEN ENCRYPTION PASSWORDTOMODIFY</value></prop> <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH ALIEN ENCRYPTION PASSWORDTOMODIFY</value></prop>
<prop oor:name="UIComponent"/> <prop oor:name="UIComponent"/>
<prop oor:name="FilterService"/> <prop oor:name="FilterService"/>
<prop oor:name="UserData"><value>CWW8</value></prop> <prop oor:name="UserData"><value>CWW8</value></prop>
......
...@@ -3071,7 +3071,7 @@ void WW8Export::ExportDocument_Impl() ...@@ -3071,7 +3071,7 @@ void WW8Export::ExportDocument_Impl()
{ {
PrepareStorage(); PrepareStorage();
pFib = new WW8Fib( bWrtWW8 ? 8 : 6 ); pFib = new WW8Fib( bWrtWW8 ? 8 : 6, m_bDot );
SvStorageStreamRef xWwStrm( GetWriter().GetStorage().OpenSotStream( aMainStg ) ); SvStorageStreamRef xWwStrm( GetWriter().GetStorage().OpenSotStream( aMainStg ) );
SvStorageStreamRef xTableStrm( xWwStrm ), xDataStrm( xWwStrm ); SvStorageStreamRef xTableStrm( xWwStrm ), xDataStrm( xWwStrm );
...@@ -3377,7 +3377,8 @@ sal_uLong SwWW8Writer::WriteStorage() ...@@ -3377,7 +3377,8 @@ sal_uLong SwWW8Writer::WriteStorage()
// Do the actual export // Do the actual export
{ {
WW8Export aExport( this, pDoc, pCurPam, pOrigPam, m_bWrtWW8 ); bool bDot = mpMedium->GetFilter()->GetName().endsWith("Vorlage");
WW8Export aExport( this, pDoc, pCurPam, pOrigPam, m_bWrtWW8, bDot );
m_pExport = &aExport; m_pExport = &aExport;
aExport.ExportDocument( bWriteAll ); aExport.ExportDocument( bWriteAll );
m_pExport = NULL; m_pExport = NULL;
...@@ -3425,11 +3426,12 @@ MSWordExportBase::~MSWordExportBase() ...@@ -3425,11 +3426,12 @@ MSWordExportBase::~MSWordExportBase()
WW8Export::WW8Export( SwWW8Writer *pWriter, WW8Export::WW8Export( SwWW8Writer *pWriter,
SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam, SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam,
bool bIsWW8 ) bool bIsWW8, bool bDot )
: MSWordExportBase( pDocument, pCurrentPam, pOriginalPam ), : MSWordExportBase( pDocument, pCurrentPam, pOriginalPam ),
pO( NULL ), pO( NULL ),
pSepx( NULL ), pSepx( NULL ),
bWrtWW8( bIsWW8 ), bWrtWW8( bIsWW8 ),
m_bDot(bDot),
m_pWriter( pWriter ), m_pWriter( pWriter ),
m_pAttrOutput( new WW8AttributeOutput( *this ) ) m_pAttrOutput( new WW8AttributeOutput( *this ) )
{ {
......
...@@ -921,6 +921,7 @@ public: ...@@ -921,6 +921,7 @@ public:
WW8_WrPlcSepx* pSepx; ///< Sections/headers/footers WW8_WrPlcSepx* pSepx; ///< Sections/headers/footers
sal_uInt8 bWrtWW8 : 1; ///< Write WW95 (false) or WW97 (true) file format sal_uInt8 bWrtWW8 : 1; ///< Write WW95 (false) or WW97 (true) file format
bool m_bDot; ///< Template or document.
protected: protected:
SwWW8Writer *m_pWriter; ///< Pointer to the writer SwWW8Writer *m_pWriter; ///< Pointer to the writer
...@@ -1095,7 +1096,7 @@ public: ...@@ -1095,7 +1096,7 @@ public:
/// Setup the exporter. /// Setup the exporter.
WW8Export( SwWW8Writer *pWriter, WW8Export( SwWW8Writer *pWriter,
SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam, SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam,
bool bIsWW8 ); bool bIsWW8, bool bDot );
virtual ~WW8Export(); virtual ~WW8Export();
virtual void DoComboBox(const OUString &rName, virtual void DoComboBox(const OUString &rName,
......
...@@ -5509,7 +5509,7 @@ WW8Fib::WW8Fib(SvStream& rSt, sal_uInt8 nWantedVersion, sal_uInt32 nOffset) ...@@ -5509,7 +5509,7 @@ WW8Fib::WW8Fib(SvStream& rSt, sal_uInt8 nWantedVersion, sal_uInt32 nOffset)
} }
WW8Fib::WW8Fib(sal_uInt8 nVer) WW8Fib::WW8Fib(sal_uInt8 nVer, bool bDot)
{ {
memset(this, 0, sizeof(*this)); memset(this, 0, sizeof(*this));
nVersion = nVer; nVersion = nVer;
...@@ -5520,6 +5520,7 @@ WW8Fib::WW8Fib(sal_uInt8 nVer) ...@@ -5520,6 +5520,7 @@ WW8Fib::WW8Fib(sal_uInt8 nVer)
nFib = 0x0101; nFib = 0x0101;
nFibBack = 0xbf; nFibBack = 0xbf;
nProduct = 0x204D; nProduct = 0x204D;
fDot = bDot;
csw = 0x0e; // muss das sein ??? csw = 0x0e; // muss das sein ???
cfclcb = 0x88; // -""- cfclcb = 0x88; // -""-
......
...@@ -1410,7 +1410,7 @@ public: ...@@ -1410,7 +1410,7 @@ public:
WW8Fib( SvStream& rStrm, sal_uInt8 nWantedVersion,sal_uInt32 nOffset=0 ); WW8Fib( SvStream& rStrm, sal_uInt8 nWantedVersion,sal_uInt32 nOffset=0 );
/* leider falsch, man braucht auch noch einen fuer den Export */ /* leider falsch, man braucht auch noch einen fuer den Export */
WW8Fib( sal_uInt8 nVersion = 6 ); WW8Fib( sal_uInt8 nVersion = 6, bool bDot = false );
bool WriteHeader(SvStream& rStrm); bool WriteHeader(SvStream& rStrm);
bool Write(SvStream& rStrm); bool Write(SvStream& rStrm);
static rtl_TextEncoding GetFIBCharset(sal_uInt16 chs); static rtl_TextEncoding GetFIBCharset(sal_uInt16 chs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment