Kaydet (Commit) faeeb183 authored tarafından Caolán McNamara's avatar Caolán McNamara

StarOffice XML (Math) .sxm package file format

üst c412b1a3
......@@ -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"))
......
......@@ -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);
}
......
......@@ -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
};
......
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