summaryrefslogtreecommitdiff
path: root/starmath/source/mathmlexport.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'starmath/source/mathmlexport.cxx')
-rwxr-xr-x[-rw-r--r--]starmath/source/mathmlexport.cxx30
1 files changed, 21 insertions, 9 deletions
diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx
index db08bfef33..1c13a58759 100644..100755
--- a/starmath/source/mathmlexport.cxx
+++ b/starmath/source/mathmlexport.cxx
@@ -80,6 +80,7 @@
#include <unomodel.hxx>
#include <document.hxx>
#include <utility.hxx>
+#include <config.hxx>
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
@@ -726,6 +727,9 @@ void SmXMLExport::GetConfigurationSettings( Sequence < PropertyValue > & rProps)
PropertyValue* pProps = rProps.getArray();
if (pProps)
{
+ SmConfig *pConfig = SM_MOD()->GetConfig();
+ const bool bUsedSymbolsOnly = pConfig ? pConfig->IsSaveOnlyUsedSymbols() : false;
+
const OUString sFormula ( RTL_CONSTASCII_USTRINGPARAM ( "Formula" ) );
const OUString sBasicLibraries ( RTL_CONSTASCII_USTRINGPARAM ( "BasicLibraries" ) );
const OUString sDialogLibraries ( RTL_CONSTASCII_USTRINGPARAM ( "DialogLibraries" ) );
@@ -739,7 +743,14 @@ void SmXMLExport::GetConfigurationSettings( Sequence < PropertyValue > & rProps)
rPropName != sRuntimeUID)
{
pProps->Name = rPropName;
- pProps->Value = xProps->getPropertyValue(rPropName);
+
+ rtl::OUString aActualName( rPropName );
+
+ // handle 'save used symbols only'
+ if (bUsedSymbolsOnly && rPropName.equalsAscii("Symbols"))
+ aActualName = OUString( RTL_CONSTASCII_USTRINGPARAM ( "UserDefinedSymbolsInUse" ) );
+
+ pProps->Value = xProps->getPropertyValue( aActualName );
}
}
}
@@ -766,12 +777,13 @@ void SmXMLExport::ExportUnaryHorizontal(const SmNode *pNode, int nLevel)
void SmXMLExport::ExportExpression(const SmNode *pNode, int nLevel)
{
SvXMLElementExport *pRow=0;
- ULONG nSize = pNode->GetNumSubNodes();
+ sal_uLong nSize = pNode->GetNumSubNodes();
- if (nSize > 1)
+ // #i115443: nodes of type expression always need to be grouped with mrow statement
+ if (nSize > 1 || (pNode && pNode->GetType() == NEXPRESSION))
pRow = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MROW, sal_True, sal_True);
- for (USHORT i = 0; i < nSize; i++)
+ for (sal_uInt16 i = 0; i < nSize; i++)
if (const SmNode *pTemp = pNode->GetSubNode(i))
ExportNodes(pTemp, nLevel+1);
@@ -790,7 +802,7 @@ void SmXMLExport::ExportTable(const SmNode *pNode, int nLevel)
{
SvXMLElementExport *pTable=0;
- USHORT nSize = pNode->GetNumSubNodes();
+ sal_uInt16 nSize = pNode->GetNumSubNodes();
//If the list ends in newline then the last entry has
//no subnodes, the newline is superfulous so we just drop
@@ -804,7 +816,7 @@ void SmXMLExport::ExportTable(const SmNode *pNode, int nLevel)
if (nLevel || (nSize >1))
pTable = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MTABLE, sal_True, sal_True);
- for (USHORT i = 0; i < nSize; i++)
+ for (sal_uInt16 i = 0; i < nSize; i++)
if (const SmNode *pTemp = pNode->GetSubNode(i))
{
SvXMLElementExport *pRow=0;
@@ -1370,11 +1382,11 @@ void SmXMLExport::ExportMatrix(const SmNode *pNode, int nLevel)
{
SvXMLElementExport aTable(*this, XML_NAMESPACE_MATH, XML_MTABLE, sal_True, sal_True);
const SmMatrixNode *pMatrix = static_cast<const SmMatrixNode *>(pNode);
- USHORT i=0;
- for (ULONG y = 0; y < pMatrix->GetNumRows(); y++)
+ sal_uInt16 i=0;
+ for (sal_uLong y = 0; y < pMatrix->GetNumRows(); y++)
{
SvXMLElementExport aRow(*this, XML_NAMESPACE_MATH, XML_MTR, sal_True, sal_True);
- for (ULONG x = 0; x < pMatrix->GetNumCols(); x++)
+ for (sal_uLong x = 0; x < pMatrix->GetNumCols(); x++)
if (const SmNode *pTemp = pNode->GetSubNode(i++))
{
SvXMLElementExport aCell(*this, XML_NAMESPACE_MATH, XML_MTD, sal_True, sal_True);