summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorPeter Foley <pefoley2@verizon.net>2011-12-24 09:44:24 -0500
committerPeter Foley <pefoley2@verizon.net>2011-12-24 09:44:24 -0500
commitfd6649175956c9d322fe02fd413fe6970aa6819e (patch)
treece2691616f82ef55d3b8f3e45812777477e8668f /starmath
parent79b252a56db8f1c2159d3269de415ffe2f2d9bb1 (diff)
parenta8feb5b1df99c12a5cb644097f935e9ccf512ed5 (diff)
Merge remote-tracking branch 'origin/master' into feature/gbuild_extensions
Conflicts: Module_tail_build.mk Repository.mk extensions/util/makefile.pmk postprocess/prj/build.lst svx/AllLangResTarget_svx.mk
Diffstat (limited to 'starmath')
-rw-r--r--starmath/Library_sm.mk1
-rw-r--r--starmath/source/accessibility.cxx23
-rw-r--r--starmath/source/cfgitem.cxx2
-rw-r--r--starmath/source/ooxmlexport.cxx32
-rw-r--r--starmath/source/ooxmlexport.hxx2
-rw-r--r--starmath/source/ooxmlimport.cxx32
-rw-r--r--starmath/source/ooxmlimport.hxx2
-rw-r--r--starmath/source/smres.src2
8 files changed, 54 insertions, 42 deletions
diff --git a/starmath/Library_sm.mk b/starmath/Library_sm.mk
index c63aa5acc3d5..3ccf55210adb 100644
--- a/starmath/Library_sm.mk
+++ b/starmath/Library_sm.mk
@@ -59,6 +59,7 @@ $(eval $(call gb_Library_add_linked_libs,sm,\
utl \
vcl \
xo \
+ $(gb_STDLIBS) \
))
$(eval $(call gb_Library_add_exception_objects,sm,\
diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx
index 1f9f14993efc..e70301dbcaa2 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -1142,7 +1142,7 @@ void SmTextForwarder::FieldClicked(const SvxFieldItem&, sal_uInt16, sal_uInt16)
sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, sal_uInt16 nWhich )
{
- EECharAttribArray aAttribs;
+ std::vector<EECharAttrib> aAttribs;
const SfxPoolItem* pLastItem = NULL;
@@ -1172,40 +1172,39 @@ sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection&
const SfxPoolItem* pParaItem = NULL;
- for( sal_uInt16 nAttrib = 0; nAttrib < aAttribs.Count(); nAttrib++ )
+ for(std::vector<EECharAttrib>::const_iterator i = aAttribs.begin(); i < aAttribs.end(); ++i)
{
- struct EECharAttrib aAttrib = aAttribs.GetObject( nAttrib );
- OSL_ENSURE( aAttrib.pAttr, "GetCharAttribs gives corrupt data" );
+ OSL_ENSURE( i->pAttr, "GetCharAttribs gives corrupt data" );
- const sal_Bool bEmptyPortion = aAttrib.nStart == aAttrib.nEnd;
- if( (!bEmptyPortion && (aAttrib.nStart >= nEndPos)) || (bEmptyPortion && (aAttrib.nStart > nEndPos)) )
+ const sal_Bool bEmptyPortion = (i->nStart == i->nEnd);
+ if( (!bEmptyPortion && (i->nStart >= nEndPos)) || (bEmptyPortion && (i->nStart > nEndPos)) )
break; // break if we are already behind our selektion
- if( (!bEmptyPortion && (aAttrib.nEnd <= nPos)) || (bEmptyPortion && (aAttrib.nEnd < nPos)) )
+ if( (!bEmptyPortion && (i->nEnd <= nPos)) || (bEmptyPortion && (i->nEnd < nPos)) )
continue; // or if the attribute ends before our selektion
- if( aAttrib.pAttr->Which() != nWhich )
+ if( i->pAttr->Which() != nWhich )
continue; // skip if is not the searched item
// if we already found an item
if( pParaItem )
{
// ... and its different to this one than the state is dont care
- if( *pParaItem != *aAttrib.pAttr )
+ if( *pParaItem != *(i->pAttr) )
return SFX_ITEM_DONTCARE;
}
else
{
- pParaItem = aAttrib.pAttr;
+ pParaItem = i->pAttr;
}
if( bEmpty )
bEmpty = false;
- if( !bGaps && aAttrib.nStart > nLastEnd )
+ if( !bGaps && i->nStart > nLastEnd )
bGaps = true;
- nLastEnd = aAttrib.nEnd;
+ nLastEnd = i->nEnd;
}
if( !bEmpty && !bGaps && nLastEnd < ( nEndPos - 1 ) )
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index 39e7afe38a17..33c83c1c4717 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -781,7 +781,7 @@ void SmMathConfig::SaveFontFormatList()
aNodeNameDelim += aFntFmtId;
aNodeNameDelim += aDelim;
- const OUString *pName = aNames.getConstArray();;
+ const OUString *pName = aNames.getConstArray();
// Name
pVal->Name = aNodeNameDelim;
diff --git a/starmath/source/ooxmlexport.cxx b/starmath/source/ooxmlexport.cxx
index 360489424f36..a7740dac48ce 100644
--- a/starmath/source/ooxmlexport.cxx
+++ b/starmath/source/ooxmlexport.cxx
@@ -152,7 +152,7 @@ void SmOoxmlExport::HandleTable( const SmNode* pNode, int nLevel )
//OOXML output stack which would grow
//without bound in a multi step conversion
if( nLevel || pNode->GetNumSubNodes() > 1 )
- HandleVerticalStack( pNode, nLevel, 0 );
+ HandleVerticalStack( pNode, nLevel );
else
HandleAllSubNodes( pNode, nLevel );
}
@@ -174,29 +174,19 @@ void SmOoxmlExport::HandleAllSubNodes( const SmNode* pNode, int nLevel )
}
}
-// output vertical stack, firstItem says which child to use as first (if there
-// are more than two children, OOXML can have only a vertical stack of two items,
-// so create a bigger vertical stack recursively)
-void SmOoxmlExport::HandleVerticalStack( const SmNode* pNode, int nLevel, int firstItem )
+void SmOoxmlExport::HandleVerticalStack( const SmNode* pNode, int nLevel )
{
- if( firstItem == pNode->GetNumSubNodes() - 1 ) // only one item, just output the item
+ m_pSerializer->startElementNS( XML_m, XML_eqArr, FSEND );
+ int size = pNode->GetNumSubNodes();
+ for( int i = 0;
+ i < size;
+ ++i )
{
- HandleNode( pNode->GetSubNode( firstItem ), nLevel + 1 );
- return;
+ m_pSerializer->startElementNS( XML_m, XML_e, FSEND );
+ HandleNode( pNode->GetSubNode( i ), nLevel + 1 );
+ m_pSerializer->endElementNS( XML_m, XML_e );
}
- m_pSerializer->startElementNS( XML_m, XML_f, FSEND );
- m_pSerializer->startElementNS( XML_m, XML_fPr, FSEND );
- m_pSerializer->singleElementNS( XML_m, XML_type, FSNS( XML_m, XML_val ), "noBar", FSEND );
- m_pSerializer->endElementNS( XML_m, XML_fPr );
- m_pSerializer->startElementNS( XML_m, XML_num, FSEND );
- HandleNode( pNode->GetSubNode( firstItem ), nLevel + 1 );
- m_pSerializer->endElementNS( XML_m, XML_num );
- // TODO this nesting means MSOffice will use smaller fonts for nested items,
- // not sure if there's another way to represent a bigger stack than 2 items
- m_pSerializer->startElementNS( XML_m, XML_den, FSEND );
- HandleVerticalStack( pNode, nLevel, firstItem + 1 );
- m_pSerializer->endElementNS( XML_m, XML_den );
- m_pSerializer->endElementNS( XML_m, XML_f );
+ m_pSerializer->endElementNS( XML_m, XML_eqArr );
}
void SmOoxmlExport::HandleText( const SmNode* pNode, int /*nLevel*/)
diff --git a/starmath/source/ooxmlexport.hxx b/starmath/source/ooxmlexport.hxx
index b1703c3f5b97..34b13ed07912 100644
--- a/starmath/source/ooxmlexport.hxx
+++ b/starmath/source/ooxmlexport.hxx
@@ -46,7 +46,7 @@ private:
void HandleNode( const SmNode* pNode, int nLevel );
void HandleAllSubNodes( const SmNode* pNode, int nLevel );
void HandleTable( const SmNode* pNode, int nLevel );
- void HandleVerticalStack( const SmNode* pNode, int nLevel, int firstItem );
+ void HandleVerticalStack( const SmNode* pNode, int nLevel );
void HandleText( const SmNode* pNode, int nLevel );
void HandleMath( const SmNode* pNode, int nLevel );
void HandleFractions( const SmNode* pNode, int nLevel, const char* type = NULL );
diff --git a/starmath/source/ooxmlimport.cxx b/starmath/source/ooxmlimport.cxx
index 73f0ea50b7dd..2fa59e1f3b57 100644
--- a/starmath/source/ooxmlimport.cxx
+++ b/starmath/source/ooxmlimport.cxx
@@ -116,6 +116,9 @@ OUString SmOoxmlImport::readOMathArg()
case OPENING( M_TOKEN( d )):
ret += handleD();
break;
+ case OPENING( M_TOKEN( eqArr )):
+ ret += handleEqArr();
+ break;
case OPENING( M_TOKEN( f )):
ret += handleF();
break;
@@ -343,10 +346,14 @@ OUString SmOoxmlImport::handleD()
closing = STR( " right " ) + closing;
if( separator == STR( "|" )) // plain "|" would be actually "V" (logical or)
separator = STR( " mline " );
+ if( opening.isEmpty())
+ opening = STR( "left none " );
+ if( closing.isEmpty())
+ closing = STR( " right none" );
OUStringBuffer ret;
ret.append( opening );
bool first = true;
- while( stream.currentToken() == OPENING( M_TOKEN( e )))
+ while( stream.findTag( OPENING( M_TOKEN( e ))))
{
if( !first )
ret.append( separator );
@@ -358,6 +365,22 @@ OUString SmOoxmlImport::handleD()
return ret.makeStringAndClear();
}
+OUString SmOoxmlImport::handleEqArr()
+{
+ stream.ensureOpeningTag( M_TOKEN( eqArr ));
+ OUString ret;
+ do
+ { // there must be at least one m:e
+ if( !ret.isEmpty())
+ ret += STR( "#" );
+ ret += STR( " " );
+ ret += readOMathArgInElement( M_TOKEN( e ));
+ ret += STR( " " );
+ } while( !stream.atEnd() && stream.findTag( OPENING( M_TOKEN( e ))));
+ stream.ensureClosingTag( M_TOKEN( eqArr ));
+ return STR( "stack {" ) + ret + STR( "}" );
+}
+
OUString SmOoxmlImport::handleF()
{
stream.ensureOpeningTag( M_TOKEN( f ));
@@ -385,8 +408,7 @@ OUString SmOoxmlImport::handleF()
else if( operation == lin )
return STR( "{" ) + num + STR( "} / {" ) + den + STR( "}" );
else // noBar
- { // TODO we write out stack of 3 items as recursive m:f, so merge here back
- // to 'stack { x # y # z }'
+ {
return STR( "binom {" ) + num + STR( "} {" ) + den + STR( "}" );
}
}
@@ -464,12 +486,12 @@ OUString SmOoxmlImport::handleM()
if( !row.isEmpty())
row += STR( " # " );
row += readOMathArgInElement( M_TOKEN( e ));
- } while( !stream.atEnd() && stream.currentToken() == OPENING( M_TOKEN( e )));
+ } while( !stream.atEnd() && stream.findTag( OPENING( M_TOKEN( e ))));
if( !allrows.isEmpty())
allrows += STR( " ## " );
allrows += row;
stream.ensureClosingTag( M_TOKEN( mr ));
- } while( !stream.atEnd() && stream.currentToken() == OPENING( M_TOKEN( mr )));
+ } while( !stream.atEnd() && stream.findTag( OPENING( M_TOKEN( mr ))));
stream.ensureClosingTag( M_TOKEN( m ));
return STR( "matrix {" ) + allrows + STR( "}" );
}
diff --git a/starmath/source/ooxmlimport.hxx b/starmath/source/ooxmlimport.hxx
index 5bea9758e2b7..dc6816f5402e 100644
--- a/starmath/source/ooxmlimport.hxx
+++ b/starmath/source/ooxmlimport.hxx
@@ -49,7 +49,7 @@ private:
rtl::OUString handleBox();
rtl::OUString handleBorderBox();
rtl::OUString handleD();
- rtl::OUString handleE();
+ rtl::OUString handleEqArr();
rtl::OUString handleF();
rtl::OUString handleFunc();
enum LimLowUpp_t { LimLow, LimUpp };
diff --git a/starmath/source/smres.src b/starmath/source/smres.src
index dd616848f277..e565bfae42c5 100644
--- a/starmath/source/smres.src
+++ b/starmath/source/smres.src
@@ -1554,7 +1554,7 @@ String RID_SYMBOLFILESSTR
String RID_ALLFILESSTR
{
- Text [ en-US ] = "All Files (*.*)" ;
+ Text [ en-US ] = "All files" ;
};
String RID_ERR_IDENT