diff options
author | Caolán McNamara <cmc@openoffice.org> | 2001-02-02 11:50:57 +0000 |
---|---|---|
committer | Caolán McNamara <cmc@openoffice.org> | 2001-02-02 11:50:57 +0000 |
commit | faeeb183ba3bbe0bb781f1e440b0fb7ebd222aef (patch) | |
tree | dfa246c9ec5deabb8795e900f29b3a746b42845e /starmath | |
parent | c412b1a3721c8005c6d6c34dab2ba16bf34467ef (diff) |
StarOffice XML (Math) .sxm package file format
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/document.cxx | 17 | ||||
-rw-r--r-- | starmath/source/mathml.cxx | 9 | ||||
-rw-r--r-- | starmath/source/mathml.hxx | 9 |
3 files changed, 25 insertions, 10 deletions
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 961c6003169d..409bdfb4b51b 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -2,9 +2,9 @@ * * $RCSfile: document.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: cmc $ $Date: 2001-02-02 10:20:47 $ + * last change: $Author: cmc $ $Date: 2001-02-02 12:50:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -629,7 +629,10 @@ void SmDocShell::Convert40To50Txt() BOOL SmDocShell::ConvertFrom(SfxMedium &rMedium) { BOOL bSuccess = FALSE; - if (rMedium.GetFilter()->GetFilterName().EqualsAscii("MathML XML (Math)")) + if ((rMedium.GetFilter()->GetFilterName(). + EqualsAscii("MathML XML (Math)")) || + (rMedium.GetFilter()->GetFilterName(). + EqualsAscii("StarOffice XML (Math)"))) { if (pTree) { @@ -820,9 +823,17 @@ BOOL SmDocShell::ConvertTo( SfxMedium &rMedium ) if( pFlt ) { if(pFlt->GetFilterName().EqualsAscii( + "StarOffice XML (Math)" )) + { + SmXMLWrapper aEquation(GetModel()); + aEquation.SetFlat(sal_False); + bRet = aEquation.Export(rMedium); + } + else if(pFlt->GetFilterName().EqualsAscii( "MathML XML (Math)" )) { SmXMLWrapper aEquation(GetModel()); + aEquation.SetFlat(sal_True); bRet = aEquation.Export(rMedium); } else if( pFlt->GetFilterName().EqualsAscii("MathType 3.x")) diff --git a/starmath/source/mathml.cxx b/starmath/source/mathml.cxx index 54d97a876e1a..3d1e3174aa6c 100644 --- a/starmath/source/mathml.cxx +++ b/starmath/source/mathml.cxx @@ -2,9 +2,9 @@ * * $RCSfile: mathml.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: cmc $ $Date: 2001-02-02 10:20:47 $ + * last change: $Author: cmc $ $Date: 2001-02-02 12:50:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -390,9 +390,10 @@ sal_Bool SmXMLWrapper::Export(SfxMedium &rMedium) uno::Reference<io::XOutputStream> xOut; SvStorageStreamRef xDocStream; - if (rMedium.IsStorage()) + if (!bFlat) //Storage (Package) of Stream { - xDocStream = rMedium.GetStorage()->OpenStream + SvStorage *pStg = rMedium.GetOutputStorage(sal_True); + xDocStream = pStg->OpenStream (C2S("Content.xml"),STREAM_WRITE|STREAM_SHARE_DENYWRITE); xOut = new utl::OOutputStreamWrapper(*xDocStream); } diff --git a/starmath/source/mathml.hxx b/starmath/source/mathml.hxx index a135f93df431..3c66b7349688 100644 --- a/starmath/source/mathml.hxx +++ b/starmath/source/mathml.hxx @@ -2,9 +2,9 @@ * * $RCSfile: mathml.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: cmc $ $Date: 2001-02-02 10:20:47 $ + * last change: $Author: cmc $ $Date: 2001-02-02 12:50:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,11 +77,14 @@ class SfxMedium; class SmXMLWrapper { public: - SmXMLWrapper(com::sun::star::uno::Reference<com::sun::star::frame::XModel> &rRef) : rModel(rRef) {}; + SmXMLWrapper(com::sun::star::uno::Reference<com::sun::star::frame::XModel> &rRef) : rModel(rRef), bFlat(sal_True) {}; sal_Bool Import(SfxMedium &rMedium); sal_Bool Export(SfxMedium &rMedium); + void SetFlat(sal_Bool bIn) {bFlat = bIn;} private: com::sun::star::uno::Reference<com::sun::star::frame::XModel> &rModel; + sal_Bool bFlat; //set true for export to flat .mml, set false for + //export to a .sxm (or whatever) package }; |