diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-11 10:43:50 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-11 10:49:26 +0100 |
commit | b566448869e9553e0d433b234c2d5ce106126871 (patch) | |
tree | 4896b2bda6c42f467c1f05665cef17457151999a | |
parent | e52779d2f8722c713f72aedbf475267440d729f0 (diff) |
DOC export: allow saving as a template
Change-Id: I26894edd3962c2b2856d2bfa4a4aa4e6f4e65c9e
-rw-r--r-- | filter/source/config/fragments/filters/MS_Word_97_Vorlage.xcu | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.hxx | 2 |
5 files changed, 11 insertions, 7 deletions
diff --git a/filter/source/config/fragments/filters/MS_Word_97_Vorlage.xcu b/filter/source/config/fragments/filters/MS_Word_97_Vorlage.xcu index e222257ba9a6..fda112549cbc 100644 --- a/filter/source/config/fragments/filters/MS_Word_97_Vorlage.xcu +++ b/filter/source/config/fragments/filters/MS_Word_97_Vorlage.xcu @@ -16,7 +16,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> <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="FilterService"/> <prop oor:name="UserData"><value>CWW8</value></prop> diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 06b1b188eaba..e6f7ea197c4f 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3071,7 +3071,7 @@ void WW8Export::ExportDocument_Impl() { PrepareStorage(); - pFib = new WW8Fib( bWrtWW8 ? 8 : 6 ); + pFib = new WW8Fib( bWrtWW8 ? 8 : 6, m_bDot ); SvStorageStreamRef xWwStrm( GetWriter().GetStorage().OpenSotStream( aMainStg ) ); SvStorageStreamRef xTableStrm( xWwStrm ), xDataStrm( xWwStrm ); @@ -3377,7 +3377,8 @@ sal_uLong SwWW8Writer::WriteStorage() // 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; aExport.ExportDocument( bWriteAll ); m_pExport = NULL; @@ -3425,11 +3426,12 @@ MSWordExportBase::~MSWordExportBase() WW8Export::WW8Export( SwWW8Writer *pWriter, SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam, - bool bIsWW8 ) + bool bIsWW8, bool bDot ) : MSWordExportBase( pDocument, pCurrentPam, pOriginalPam ), pO( NULL ), pSepx( NULL ), bWrtWW8( bIsWW8 ), + m_bDot(bDot), m_pWriter( pWriter ), m_pAttrOutput( new WW8AttributeOutput( *this ) ) { diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 91728d8b8df6..3e2dbff096c2 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -921,6 +921,7 @@ public: WW8_WrPlcSepx* pSepx; ///< Sections/headers/footers sal_uInt8 bWrtWW8 : 1; ///< Write WW95 (false) or WW97 (true) file format + bool m_bDot; ///< Template or document. protected: SwWW8Writer *m_pWriter; ///< Pointer to the writer @@ -1095,7 +1096,7 @@ public: /// Setup the exporter. WW8Export( SwWW8Writer *pWriter, SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam, - bool bIsWW8 ); + bool bIsWW8, bool bDot ); virtual ~WW8Export(); virtual void DoComboBox(const OUString &rName, diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 5a6d79c546f5..372e7b1db396 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -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)); nVersion = nVer; @@ -5520,6 +5520,7 @@ WW8Fib::WW8Fib(sal_uInt8 nVer) nFib = 0x0101; nFibBack = 0xbf; nProduct = 0x204D; + fDot = bDot; csw = 0x0e; // muss das sein ??? cfclcb = 0x88; // -""- diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index a6fbd4a1c6db..e20af3ee703a 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -1410,7 +1410,7 @@ public: WW8Fib( SvStream& rStrm, sal_uInt8 nWantedVersion,sal_uInt32 nOffset=0 ); /* 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 Write(SvStream& rStrm); static rtl_TextEncoding GetFIBCharset(sal_uInt16 chs); |