[Libreoffice-commits] .: 2 commits - binfilter/bf_starmath binfilter/inc

Joseph Powers jpowers at kemper.freedesktop.org
Tue Jan 18 21:22:41 PST 2011


 binfilter/bf_starmath/source/starmath_cfgitem.cxx |  229 +++++++++-------------
 binfilter/bf_starmath/source/starmath_symbol.cxx  |   82 +++----
 binfilter/inc/bf_starmath/symbol.hxx              |   22 +-
 3 files changed, 141 insertions(+), 192 deletions(-)

New commits:
commit 02e0aa11e8b02e0921a071393a5aa7c1bd17b7bf
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Tue Jan 18 21:22:35 2011 -0800

    Delete commented code & quite some warnings

diff --git a/binfilter/bf_starmath/source/starmath_cfgitem.cxx b/binfilter/bf_starmath/source/starmath_cfgitem.cxx
index 3960d81..382f766 100644
--- a/binfilter/bf_starmath/source/starmath_cfgitem.cxx
+++ b/binfilter/bf_starmath/source/starmath_cfgitem.cxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -68,16 +68,15 @@ static const char* aRootName = "Office.Math";
 /*N*/         "Italic",
 /*N*/ 		0
 /*N*/ 	};
-/*N*/ 
+/*N*/
 /*N*/ 	const char** ppPropName = aPropNames;
-/*N*/ 
+/*N*/
 /*N*/     Sequence< OUString > aNames( 6 );
 /*N*/ 	OUString *pNames = aNames.getArray();
 /*N*/ 	for( INT32 i = 0; *ppPropName;  ++i, ++ppPropName )
 /*N*/ 	{
 /*N*/ 		pNames[i] = A2OU( *ppPropName );
 /*N*/ 	}
-/*N*/ 	//aNames.realloc( i );
 /*N*/ 	return aNames;
 /*N*/ }
 
@@ -94,16 +93,15 @@ static const char* aRootName = "Office.Math";
 /*N*/         "FontFormatId",
 /*N*/ 		0
 /*N*/ 	};
-/*N*/ 
+/*N*/
 /*N*/ 	const char** ppPropName = aPropNames;
-/*N*/ 
+/*N*/
 /*N*/     Sequence< OUString > aNames( 4 );
 /*N*/ 	OUString *pNames = aNames.getArray();
 /*N*/ 	for( INT32 i = 0; *ppPropName;  ++i, ++ppPropName )
 /*N*/ 	{
 /*N*/ 		pNames[i] = A2OU( *ppPropName );
 /*N*/ 	}
-/*N*/ 	//aNames.realloc( i );
 /*N*/ 	return aNames;
 /*N*/ }
 
@@ -116,7 +114,6 @@ static const char* aRootName = "Office.Math";
 /*N*/     "Print/Frame",
 /*N*/     "Print/Size",
 /*N*/     "Print/ZoomFactor",
-/*N*/     //"Misc/NoSymbolsWarning",
 /*N*/     "Misc/IgnoreSpacesRight",
 /*N*/     "View/ToolboxVisible",
 /*N*/     "View/AutoRedraw",
@@ -171,24 +168,23 @@ static const char* aRootName = "Office.Math";
 /*N*/ };
 
 
-/*N*/ static Sequence< OUString > lcl_GetPropertyNames( 
+/*N*/ static Sequence< OUString > lcl_GetPropertyNames(
 /*N*/         const char * aPropNames[], USHORT nCount )
 /*N*/ {
-/*N*/ 
+/*N*/
 /*N*/ 	const char** ppPropName = aPropNames;
-/*N*/ 
+/*N*/
 /*N*/     Sequence< OUString > aNames( nCount );
 /*N*/ 	OUString *pNames = aNames.getArray();
 /*N*/     for (INT32 i = 0;  i < nCount;  ++i, ++ppPropName)
 /*N*/ 	{
 /*N*/ 		pNames[i] = A2OU( *ppPropName );
 /*N*/ 	}
-/*N*/ 	//aNames.realloc( i );
 /*N*/ 	return aNames;
 /*N*/ }
 
 /////////////////////////////////////////////////////////////////
-    
+
 /*N*/ Sequence< OUString > SmMathConfigItem::GetFormatPropertyNames()
 /*N*/ {
 /*N*/     USHORT nCnt = SAL_N_ELEMENTS(aFormatPropNames);
@@ -215,8 +211,7 @@ static const char* aRootName = "Office.Math";
 /*N*/     BOOL            bToolboxVisible;
 /*N*/     BOOL            bAutoRedraw;
 /*N*/     BOOL            bFormulaCursor;
-/*N*/     //BOOL            bNoSymbolsWarning;
-/*N*/ 
+/*N*/
 /*N*/     SmCfgOther();
 /*N*/ };
 
@@ -228,7 +223,7 @@ static const char* aRootName = "Office.Math";
 /*N*/     bPrintTitle         = bPrintFormulaText   =
 /*N*/     bPrintFrame         = bIgnoreSpacesRight  =
 /*N*/     bToolboxVisible     = bAutoRedraw         =
-/*N*/     bFormulaCursor      = /*bNoSymbolsWarning   =*/ TRUE;
+/*N*/     bFormulaCursor      = TRUE;
 /*N*/ }
 
 /////////////////////////////////////////////////////////////////
@@ -243,11 +238,6 @@ static const char* aRootName = "Office.Math";
 /*N*/     nWeight     = WEIGHT_DONTKNOW;
 /*N*/     nItalic     = ITALIC_NONE;
 /*N*/ }
-    
-
-// /*N*/ SmFontFormat::SmFontFormat( const Font &rFont )
-// /*N*/ {DBG_BF_ASSERT(0, "STRIP"); //STRIP001 
-// /*N*/ }
 
 
 /*N*/ const Font SmFontFormat::GetFont() const
@@ -262,7 +252,7 @@ static const char* aRootName = "Office.Math";
 /*N*/     return aRes;
 /*N*/ }
 
-    
+
 
 
 /////////////////////////////////////////////////////////////////
@@ -280,9 +270,7 @@ static const char* aRootName = "Office.Math";
 /*N*/ }
 
 
-
-
-/*N*/ void SmFontFormatList::AddFontFormat( const String &rFntFmtId, 
+/*N*/ void SmFontFormatList::AddFontFormat( const String &rFntFmtId,
 /*N*/         const SmFontFormat &rFntFmt )
 /*N*/ {
 /*N*/     const SmFontFormat *pFntFmt = GetFontFormat( rFntFmtId );
@@ -294,14 +282,12 @@ static const char* aRootName = "Office.Math";
 /*N*/         SetModified( TRUE );
 /*N*/     }
 /*N*/ }
-    
-    
 
-    
+
 /*N*/ const SmFontFormat * SmFontFormatList::GetFontFormat( const String &rFntFmtId ) const
 /*N*/ {
 /*N*/     SmFontFormat *pRes = 0;
-/*N*/ 
+/*N*/
 /*N*/     USHORT nCnt = aEntries.Count();
 /*N*/     USHORT i;
 /*N*/     for (i = 0;  i < nCnt  &&  !pRes;  ++i)
@@ -309,28 +295,11 @@ static const char* aRootName = "Office.Math";
 /*N*/         if (aEntries[i].aId == rFntFmtId)
 /*N*/             pRes = &aEntries[i].aFntFmt;
 /*N*/     }
-/*N*/     
+/*N*/
 /*N*/     return pRes;
 /*N*/ }
 
 
-
-// /*N*/ const SmFontFormat * SmFontFormatList::GetFontFormat( USHORT nPos ) const
-// /*N*/ {
-// /*N*/     SmFontFormat *pRes = 0;
-// /*N*/     if (nPos < aEntries.Count())
-// /*N*/         pRes = &aEntries[ nPos ].aFntFmt;
-// /*N*/     return pRes;
-// /*N*/ }
-
-
-
-
-
-
-
-
-
 /////////////////////////////////////////////////////////////////
 
 /*N*/ SmMathConfig::SmMathConfig()
@@ -340,13 +309,13 @@ static const char* aRootName = "Office.Math";
 /*N*/     pFontFormatList = 0;
 /*N*/ 	pSymbols		= 0;
 /*N*/ 	nSymbolCount	= 0;
-/*N*/ 
+/*N*/
 /*N*/     bIsOtherModified = bIsFormatModified = FALSE;
-/*N*/ 	
+/*N*/
 /*N*/     aSaveTimer.SetTimeout( 3000 );
 /*N*/ 	aSaveTimer.SetTimeoutHdl( LINK( this, SmMathConfig, TimeOut ) );
 /*N*/ }
-    
+
 
 /*N*/ SmMathConfig::~SmMathConfig()
 /*N*/ {
@@ -357,7 +326,7 @@ static const char* aRootName = "Office.Math";
 /*N*/     delete [] pSymbols;
 /*N*/ }
 
-          
+
 /*N*/ void SmMathConfig::SetOtherModified( BOOL bVal )
 /*N*/ {
 /*N*/     if ((bIsOtherModified = bVal))
@@ -373,14 +342,14 @@ static const char* aRootName = "Office.Math";
 
 
 /*N*/ SmSym SmMathConfig::ReadSymbol( SmMathConfigItem &rCfg,
-/*N*/ 						const ::rtl::OUString &rSymbolName, 
+/*N*/ 						const ::rtl::OUString &rSymbolName,
 /*N*/ 						const ::rtl::OUString &rBaseNode ) const
 /*N*/ {
 /*N*/ 	SmSym aRes;
-/*N*/ 
+/*N*/
 /*N*/ 	Sequence< OUString > aNames = lcl_GetSymbolPropertyNames();
 /*N*/ 	INT32 nProps = aNames.getLength();
-/*N*/ 
+/*N*/
 /*N*/ 	OUString aDelim( OUString::valueOf( (sal_Unicode) '/' ) );
 /*N*/ 	OUString *pName = aNames.getArray();
 /*N*/ 	for (INT32 i = 0;  i < nProps;  ++i)
@@ -393,9 +362,9 @@ static const char* aRootName = "Office.Math";
 /*N*/ 		rName += aDelim;
 /*N*/ 		rName += aTmp;
 /*N*/ 	}
-/*N*/ 
+/*N*/
 /*N*/ 	const Sequence< Any > aValues = rCfg.GetProperties( aNames );
-/*N*/ 
+/*N*/
 /*N*/ 	if (nProps  &&  aValues.getLength() == nProps)
 /*N*/ 	{
 /*N*/ 		const Any * pValue = aValues.getConstArray();
@@ -403,11 +372,11 @@ static const char* aRootName = "Office.Math";
 /*N*/         sal_Unicode cChar(0);
 /*N*/         String      aSet;
 /*N*/         BOOL        bPredefined(FALSE);
-/*N*/ 
+/*N*/
 /*N*/         OUString    aTmpStr;
 /*N*/         INT32       nTmp32 = 0;
 /*N*/         BOOL        bTmp = FALSE;
-/*N*/ 
+/*N*/
 /*N*/         BOOL bOK = TRUE;
 /*N*/         if (pValue->hasValue()  &&  (*pValue >>= nTmp32))
 /*N*/             cChar = (sal_Unicode) nTmp32;
@@ -434,7 +403,7 @@ static const char* aRootName = "Office.Math";
 /*N*/         else
 /*N*/             bOK = FALSE;
 /*N*/         ++pValue;
-/*N*/ 
+/*N*/
 /*N*/         if (bOK)
 /*N*/         {
 /*N*/             String aUiName( rSymbolName );
@@ -451,7 +420,7 @@ static const char* aRootName = "Office.Math";
 /*N*/                 if (aTmp.Len())
 /*N*/                     aUiSetName = aTmp;
 /*N*/             }
-/*N*/ 
+/*N*/
 /*N*/             aRes = SmSym( aUiName, aFont, cChar, aUiSetName, bPredefined );
 /*N*/             if (aUiName != String(rSymbolName))
 /*?*/                 aRes.SetExportName( rSymbolName );
@@ -461,7 +430,7 @@ static const char* aRootName = "Office.Math";
 /*N*/             DBG_ERROR( "symbol read error" );
 /*N*/         }
 /*N*/ 	}
-/*N*/ 
+/*N*/
 /*N*/ 	return aRes;
 /*N*/ }
 
@@ -469,16 +438,16 @@ static const char* aRootName = "Office.Math";
 /*N*/ void SmMathConfig::LoadSymbols()
 /*N*/ {
 /*N*/ 	SmMathConfigItem aCfg( String::CreateFromAscii( aRootName ));
-/*N*/ 
+/*N*/
 /*N*/ 	Sequence< OUString > aNodes( aCfg.GetNodeNames( A2OU( SYMBOL_LIST ) ) );
 /*N*/ 	const OUString *pNode = aNodes.getConstArray();
 /*N*/ 	INT32 nNodes = aNodes.getLength();
-/*N*/ 
+/*N*/
 /*N*/ 	if (pSymbols)
 /*?*/         delete [] pSymbols;
 /*N*/ 	pSymbols = nNodes ? new SmSym[ nNodes ] : 0;
 /*N*/     nSymbolCount = (USHORT) nNodes;
-/*N*/ 
+/*N*/
 /*N*/ 	for (INT32 i = 0;  i < nNodes;  ++i)
 /*N*/ 	{
 /*N*/ 		pSymbols[i] = ReadSymbol( aCfg, pNode[i], A2OU( SYMBOL_LIST ) );
@@ -531,35 +500,35 @@ static const char* aRootName = "Office.Math";
 /*N*/         pFontFormatList = new SmFontFormatList;
 /*N*/     else
 /*?*/     {DBG_BF_ASSERT(0, "STRIP");} //STRIP001     pFontFormatList->Clear();
-/*N*/ 
+/*N*/
 /*N*/     SmMathConfigItem aCfg( String::CreateFromAscii( aRootName ) );
-/*N*/ 
+/*N*/
 /*N*/     Sequence< OUString > aNodes( aCfg.GetNodeNames( A2OU( FONT_FORMAT_LIST ) ) );
 /*N*/ 	const OUString *pNode = aNodes.getConstArray();
 /*N*/ 	INT32 nNodes = aNodes.getLength();
-/*N*/ 
+/*N*/
 /*N*/ 	for (INT32 i = 0;  i < nNodes;  ++i)
 /*N*/ 	{
 /*N*/         SmFontFormat aFntFmt( ReadFontFormat( aCfg, pNode[i], A2OU( FONT_FORMAT_LIST ) ) );
 /*N*/         if (!pFontFormatList->GetFontFormat( pNode[i] ))
 /*N*/         {
-/*N*/             DBG_ASSERT( 0 == pFontFormatList->GetFontFormat( pNode[i] ), 
+/*N*/             DBG_ASSERT( 0 == pFontFormatList->GetFontFormat( pNode[i] ),
 /*N*/                     "FontFormat ID already exists" );
 /*N*/             pFontFormatList->AddFontFormat( pNode[i], aFntFmt );
 /*N*/         }
 /*N*/ 	}
 /*N*/     pFontFormatList->SetModified( FALSE );
 /*N*/ }
-    
+
 
 /*N*/ SmFontFormat SmMathConfig::ReadFontFormat( SmMathConfigItem &rCfg,
 /*N*/         const OUString &rSymbolName, const OUString &rBaseNode ) const
 /*N*/ {
 /*N*/     SmFontFormat aRes;
-/*N*/ 
+/*N*/
 /*N*/     Sequence< OUString > aNames = lcl_GetFontPropertyNames();
 /*N*/ 	INT32 nProps = aNames.getLength();
-/*N*/ 
+/*N*/
 /*N*/ 	OUString aDelim( OUString::valueOf( (sal_Unicode) '/' ) );
 /*N*/ 	OUString *pName = aNames.getArray();
 /*N*/ 	for (INT32 i = 0;  i < nProps;  ++i)
@@ -572,16 +541,16 @@ static const char* aRootName = "Office.Math";
 /*N*/ 		rName += aDelim;
 /*N*/ 		rName += aTmp;
 /*N*/ 	}
-/*N*/ 
+/*N*/
 /*N*/ 	const Sequence< Any > aValues = rCfg.GetProperties( aNames );
-/*N*/ 
+/*N*/
 /*N*/ 	if (nProps  &&  aValues.getLength() == nProps)
 /*N*/ 	{
 /*N*/ 		const Any * pValue = aValues.getConstArray();
-/*N*/ 
+/*N*/
 /*N*/         OUString    aTmpStr;
 /*N*/         INT16       nTmp16 = 0;
-/*N*/ 
+/*N*/
 /*N*/         BOOL bOK = TRUE;
 /*N*/         if (pValue->hasValue()  &&  (*pValue >>= aTmpStr))
 /*N*/             aRes.aName = aTmpStr;
@@ -613,10 +582,10 @@ static const char* aRootName = "Office.Math";
 /*N*/         else
 /*N*/             bOK = FALSE;
 /*N*/ 		++pValue;
-/*N*/ 
+/*N*/
 /*N*/         DBG_ASSERT( bOK, "read FontFormat failed" );
 /*N*/ 	}
-/*N*/     
+/*N*/
 /*N*/     return aRes;
 /*N*/ }
 
@@ -624,20 +593,20 @@ static const char* aRootName = "Office.Math";
 /*N*/ void SmMathConfig::SaveFontFormatList()
 /*N*/ {
 /*N*/     SmFontFormatList &rFntFmtList = GetFontFormatList();
-/*N*/     
+/*N*/
 /*N*/     if (!rFntFmtList.IsModified())
 /*N*/         return;
-/*N*/ 
+/*N*/
 /*?*/     SmMathConfigItem aCfg( String::CreateFromAscii( aRootName ) );
-/*?*/     
+/*?*/
 /*?*/     Sequence< OUString > aNames = lcl_GetFontPropertyNames();
 /*?*/     INT32 nSymbolProps = aNames.getLength();
-/*?*/     
+/*?*/
 /*?*/     USHORT nCount = rFntFmtList.GetCount();
-/*?*/ 
+/*?*/
 /*?*/     Sequence< PropertyValue > aValues( nCount * nSymbolProps );
 /*?*/     PropertyValue *pValues = aValues.getArray();
-/*?*/ 
+/*?*/
 /*?*/     PropertyValue *pVal = pValues;
 /*?*/     OUString aDelim( OUString::valueOf( (sal_Unicode) '/' ) );
 /*?*/     for (USHORT i = 0;  i < nCount;  ++i)
@@ -647,32 +616,32 @@ static const char* aRootName = "Office.Math";
 /*?*/     DBG_ASSERT( pVal - pValues == nCount * nSymbolProps, "properties missing" );
 /*?*/     (void)pVal;
 /*?*/     aCfg.ReplaceSetProperties( A2OU( FONT_FORMAT_LIST ) , aValues );
-/*?*/     
+/*?*/
 /*?*/     rFntFmtList.SetModified( FALSE );
 /*N*/ }
 
 
 
-       
+
 /*N*/ void SmMathConfig::LoadOther()
 /*N*/ {
 /*N*/     if (!pOther)
 /*N*/         pOther = new SmCfgOther;
-/*N*/ 
+/*N*/
 /*N*/ 	SmMathConfigItem aCfg( String::CreateFromAscii( aRootName ));
-/*N*/     
+/*N*/
 /*N*/     Sequence< OUString > aNames( aCfg.GetOtherPropertyNames() );
 /*N*/     INT32 nProps = aNames.getLength();
-/*N*/ 
+/*N*/
 /*N*/     Sequence< Any > aValues( aCfg.GetProperties( aNames ) );
 /*N*/     if (nProps  &&  aValues.getLength() == nProps)
 /*N*/     {
 /*N*/         const Any *pValues = aValues.getConstArray();
 /*N*/         const Any *pVal = pValues;
-/*N*/ 
-/*N*/         INT16   nTmp16;
-/*N*/         BOOL    bTmp;
-/*N*/ 
+/*N*/
+/*N*/         INT16   nTmp16( 0 );
+/*N*/         BOOL    bTmp( 0 );
+/*N*/
 /*N*/         // Print/Title
 /*N*/         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
 /*N*/             pOther->bPrintTitle = bTmp;
@@ -692,11 +661,6 @@ static const char* aRootName = "Office.Math";
 /*N*/         // Print/ZoomFactor
 /*N*/         if (pVal->hasValue()  &&  (*pVal >>= nTmp16))
 /*N*/             pOther->nPrintZoomFactor = nTmp16;
-/*        ++pVal;
-        // Misc/NoSymbolsWarning
-        if (pVal->hasValue()  &&  (*pVal >>= bTmp))
-            pOther->bNoSymbolsWarning = bTmp;
-*/
 /*N*/         ++pVal;
 /*N*/         // Misc/IgnoreSpacesRight
 /*N*/         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
@@ -714,7 +678,7 @@ static const char* aRootName = "Office.Math";
 /*N*/         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
 /*N*/             pOther->bFormulaCursor = bTmp;
 /*N*/         ++pVal;
-/*N*/ 
+/*N*/
 /*N*/         DBG_ASSERT( pVal - pValues == nProps, "property mismatch" );
 /*N*/         SetOtherModified( FALSE );
 /*N*/     }
@@ -725,16 +689,16 @@ static const char* aRootName = "Office.Math";
 /*N*/ {
 /*N*/     if (!pOther || !IsOtherModified())
 /*N*/         return;
-/*N*/ 
+/*N*/
 /*?*/ 	SmMathConfigItem aCfg( String::CreateFromAscii( aRootName ));
-/*?*/     
+/*?*/
 /*?*/     const Sequence< OUString > aNames( aCfg.GetOtherPropertyNames() );
 /*?*/     INT32 nProps = aNames.getLength();
-/*?*/ 
+/*?*/
 /*?*/     Sequence< Any > aValues( nProps );
 /*?*/     Any *pValues = aValues.getArray();
 /*?*/     Any *pValue  = pValues;
-/*?*/ 
+/*?*/
 /*?*/     // Print/Title
 /*?*/     *pValue++ <<= (BOOL) pOther->bPrintTitle;
 /*?*/     // Print/FormulaText
@@ -745,9 +709,6 @@ static const char* aRootName = "Office.Math";
 /*?*/     *pValue++ <<= (INT16) pOther->ePrintSize;
 /*?*/     // Print/ZoomFactor
 /*?*/     *pValue++ <<= (INT16) pOther->nPrintZoomFactor;
-/*    // Misc/NoSymbolsWarning
-    *pValue++ <<= (BOOL) pOther->bNoSymbolsWarning;
-*/
 /*?*/     // Misc/IgnoreSpacesRight
 /*?*/     *pValue++ <<= (BOOL) pOther->bIgnoreSpacesRight;
 /*?*/     // View/ToolboxVisible
@@ -756,10 +717,10 @@ static const char* aRootName = "Office.Math";
 /*?*/     *pValue++ <<= (BOOL) pOther->bAutoRedraw;
 /*?*/     // View/FormulaCursor
 /*?*/     *pValue++ <<= (BOOL) pOther->bFormulaCursor;
-/*?*/     
+/*?*/
 /*?*/     DBG_ASSERT( pValue - pValues == nProps, "property mismatch" );
 /*?*/     aCfg.PutProperties( aNames , aValues );
-/*?*/ 
+/*?*/
 /*?*/     SetOtherModified( FALSE );
 /*N*/ }
 
@@ -767,22 +728,22 @@ static const char* aRootName = "Office.Math";
 /*N*/ {
 /*N*/     if (!pFormat)
 /*N*/         pFormat = new SmFormat;
-/*N*/ 
+/*N*/
 /*N*/ 	SmMathConfigItem aCfg( String::CreateFromAscii( aRootName ));
-/*N*/     
+/*N*/
 /*N*/     Sequence< OUString > aNames( aCfg.GetFormatPropertyNames() );
 /*N*/     INT32 nProps = aNames.getLength();
-/*N*/ 
+/*N*/
 /*N*/     Sequence< Any > aValues( aCfg.GetProperties( aNames ) );
 /*N*/     if (nProps  &&  aValues.getLength() == nProps)
 /*N*/     {
 /*N*/         const Any *pValues = aValues.getConstArray();
 /*N*/         const Any *pVal = pValues;
-/*N*/ 
+/*N*/
 /*N*/         OUString    aTmpStr;
-/*N*/         INT16       nTmp16;
-/*N*/         BOOL        bTmp;
-/*N*/ 
+/*N*/         INT16       nTmp16( 0 );
+/*N*/         BOOL        bTmp( 0 );
+/*N*/
 /*N*/         // StandardFormat/Textmode
 /*N*/         if (pVal->hasValue()  &&  (*pVal >>= bTmp))
 /*N*/             pFormat->SetTextmode( bTmp );
@@ -799,7 +760,7 @@ static const char* aRootName = "Office.Math";
 /*N*/         if (pVal->hasValue()  &&  (*pVal >>= nTmp16))
 /*N*/             pFormat->SetBaseSize( Size(0, SmPtsTo100th_mm( nTmp16 )) );
 /*N*/         ++pVal;
-/*N*/ 
+/*N*/
 /*N*/         USHORT i;
 /*N*/         for (i = SIZ_BEGIN;  i <= SIZ_END;  ++i)
 /*N*/         {
@@ -807,15 +768,15 @@ static const char* aRootName = "Office.Math";
 /*N*/                 pFormat->SetRelSize( i, nTmp16 );
 /*N*/             ++pVal;
 /*N*/         }
-/*N*/ 
+/*N*/
 /*N*/         for (i = DIS_BEGIN;  i <= DIS_END;  ++i)
 /*N*/         {
 /*N*/             if (pVal->hasValue()  &&  (*pVal >>= nTmp16))
 /*N*/                 pFormat->SetDistance( i, nTmp16 );
 /*N*/             ++pVal;
 /*N*/         }
-/*N*/ 
-/*N*/         LanguageType nLang = Application::GetSettings().GetUILanguage(); 
+/*N*/
+/*N*/         LanguageType nLang = Application::GetSettings().GetUILanguage();
 /*N*/         for (i = FNT_BEGIN;  i < FNT_END;  ++i)
 /*N*/         {
 /*N*/             Font aFnt;
@@ -837,11 +798,11 @@ static const char* aRootName = "Office.Math";
 /*N*/                 }
 /*N*/             }
 /*N*/             ++pVal;
-/*N*/ 
+/*N*/
 /*N*/             aFnt.SetSize( pFormat->GetBaseSize() );
 /*N*/             pFormat->SetFont( i, aFnt, bUseDefaultFont );
 /*N*/         }
-/*N*/ 
+/*N*/
 /*N*/         DBG_ASSERT( pVal - pValues == nProps, "property mismatch" );
 /*N*/         SetFormatModified( FALSE );
 /*N*/     }
@@ -852,16 +813,16 @@ static const char* aRootName = "Office.Math";
 /*N*/ {
 /*N*/     if (!pFormat || !IsFormatModified())
 /*N*/         return;
-/*N*/ 
+/*N*/
 /*?*/ 	SmMathConfigItem aCfg( String::CreateFromAscii( aRootName ));
-/*?*/     
+/*?*/
 /*?*/     const Sequence< OUString > aNames( aCfg.GetFormatPropertyNames() );
 /*?*/     INT32 nProps = aNames.getLength();
-/*?*/ 
+/*?*/
 /*?*/     Sequence< Any > aValues( nProps );
 /*?*/     Any *pValues = aValues.getArray();
 /*?*/     Any *pValue  = pValues;
-/*?*/ 
+/*?*/
 /*?*/     // StandardFormat/Textmode
 /*?*/     *pValue++ <<= (BOOL) pFormat->IsTextmode();
 /*?*/     // StandardFormat/ScaleNormalBracket
@@ -869,31 +830,31 @@ static const char* aRootName = "Office.Math";
 /*?*/     // StandardFormat/HorizontalAlignment
 /*?*/     *pValue++ <<= (INT16) pFormat->GetHorAlign();
 /*?*/     // StandardFormat/BaseSize
-/*?*/     *pValue++ <<= (INT16) SmRoundFraction( Sm100th_mmToPts( 
+/*?*/     *pValue++ <<= (INT16) SmRoundFraction( Sm100th_mmToPts(
 /*?*/                                     pFormat->GetBaseSize().Height() ) );
-/*?*/ 
+/*?*/
 /*?*/     USHORT i;
 /*?*/     for (i = SIZ_BEGIN;  i <= SIZ_END;  ++i)
 /*?*/         *pValue++ <<= (INT16) pFormat->GetRelSize( i );
-/*?*/ 
+/*?*/
 /*?*/     for (i = DIS_BEGIN;  i <= DIS_END;  ++i)
 /*?*/         *pValue++ <<= (INT16) pFormat->GetDistance( i );
-/*?*/ 
+/*?*/
 /*?*/     for (i = FNT_BEGIN;  i < FNT_END;  ++i)
 /*?*/     {
 /*?*/         OUString aFntFmtId;
-/*?*/ 
+/*?*/
 /*?*/         if (!pFormat->IsDefaultFont( i ))
 /*?*/         {
 /*?*/             DBG_BF_ASSERT(0, "STRIP"); //STRIP001 SmFontFormat aFntFmt( pFormat->GetFont( i ) );
 /*?*/         }
-/*?*/ 
+/*?*/
 /*?*/         *pValue++ <<= aFntFmtId;
 /*?*/     }
-/*?*/     
+/*?*/
 /*?*/     DBG_ASSERT( pValue - pValues == nProps, "property mismatch" );
 /*?*/     aCfg.PutProperties( aNames , aValues );
-/*?*/     
+/*?*/
 /*?*/     SetFormatModified( FALSE );
 /*N*/ }
 
@@ -906,7 +867,7 @@ static const char* aRootName = "Office.Math";
 /*N*/ }
 
 
-        
+
 
 /*N*/ SmPrintSize SmMathConfig::GetPrintSize() const
 /*N*/ {
@@ -926,7 +887,7 @@ static const char* aRootName = "Office.Math";
 /*N*/ }
 
 
-    
+
 
 
 
commit dcf9c0a641886beb5cb2d8516b5980ea461b0ac1
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Tue Jan 18 21:22:08 2011 -0800

    Remove DECLARE_LIST(SmListSym, SmSym *)

diff --git a/binfilter/bf_starmath/source/starmath_symbol.cxx b/binfilter/bf_starmath/source/starmath_symbol.cxx
index cfc49a9..43491e5 100644
--- a/binfilter/bf_starmath/source/starmath_symbol.cxx
+++ b/binfilter/bf_starmath/source/starmath_symbol.cxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -30,14 +30,11 @@
 #pragma hdrstop
 #endif
 
-
-
 #include <bf_sfx2/docfile.hxx>
-
 #include "config.hxx"
 #include "starmath.hrc"
-namespace binfilter {
 
+namespace binfilter {
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::ucb;
@@ -103,18 +100,18 @@ long				SF_Ident = SF_IDENT;
 /*N*/ 			 const String& rSet, BOOL bIsPredefined)
 /*N*/ {
 /*N*/ 	Name		= aExportName	= rName;
-/*N*/ 
+/*N*/
 /*N*/     Face        = rFont;
 /*N*/ 	Face.SetTransparent(TRUE);
 /*N*/     Face.SetAlign(ALIGN_BASELINE);
-/*N*/ 
+/*N*/
 /*N*/     Character   = aChar;
 /*N*/     if (RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet())
 /*?*/         Character |= 0xF000;
 /*N*/ 	aSetName	= rSet;
 /*N*/ 	bPredefined	= bIsPredefined;
 /*N*/     bDocSymbol  = FALSE;
-/*N*/ 
+/*N*/
 /*N*/ 	pHashNext	   = 0;
 /*N*/ 	pSymSetManager = 0;
 /*N*/ }
@@ -129,12 +126,12 @@ long				SF_Ident = SF_IDENT;
 /*N*/ 	bPredefined	= rSymbol.bPredefined;
 /*N*/     bDocSymbol  = rSymbol.bDocSymbol;
 /*N*/ 	aExportName	= rSymbol.aExportName;
-/*N*/ 
+/*N*/
 /*N*/ 	pHashNext = 0;
-/*N*/ 
+/*N*/
 /*N*/     if (pSymSetManager)
 /*?*/ 		pSymSetManager->SetModified(TRUE);
-/*N*/ 
+/*N*/
 /*N*/ 	return *this;
 /*N*/ }
 
@@ -148,8 +145,8 @@ long				SF_Ident = SF_IDENT;
 /*N*/ SmSymSet::SmSymSet(const String& rName)
 /*N*/ {
 /*N*/ 	Name = rName;
-/*N*/ 	SymbolList.Clear();
-/*N*/ 
+/*N*/ 	SymbolList.clear();
+/*N*/
 /*N*/ 	pSymSetManager = 0;
 /*N*/ }
 
@@ -159,17 +156,15 @@ long				SF_Ident = SF_IDENT;
 /*N*/ USHORT SmSymSet::AddSymbol(SmSym* pSymbol)
 /*N*/ {
 /*N*/ 	DBG_ASSERT(pSymbol, "Kein Symbol");
-/*N*/ 
+/*N*/
 /*N*/     if (pSymbol)
 /*N*/         pSymbol->SetSetName( GetName() );
-/*N*/ 	SymbolList.Insert(pSymbol, LIST_APPEND);
-/*N*/ 	DBG_ASSERT(SymbolList.GetPos(pSymbol) == SymbolList.Count() - 1,
-/*N*/ 		"Sm : ... ergibt falschen return Wert");
-/*N*/ 
+/*N*/ 	SymbolList.push_back( pSymbol );
+/*N*/
 /*N*/ 	if (pSymSetManager)
 /*N*/ 		pSymSetManager->SetModified(TRUE);
-/*N*/ 
-/*N*/ 	return (USHORT) SymbolList.Count() - 1;
+/*N*/
+/*N*/ 	return (USHORT) SymbolList.size() - 1;
 /*N*/ }
 
 
@@ -182,7 +177,7 @@ long				SF_Ident = SF_IDENT;
 
 /*N*/ SmSymSetManager_Impl::SmSymSetManager_Impl(
 /*N*/         SmSymSetManager &rMgr, USHORT HashTableSize ) :
-/*N*/ 
+/*N*/
 /*N*/     rSymSetMgr    (rMgr)
 /*N*/ {
 /*N*/     NoSymbolSets    = 0;
@@ -207,7 +202,7 @@ long				SF_Ident = SF_IDENT;
 /*N*/     UINT32 x = 1;
 /*N*/ 	for (xub_StrLen i = 0; i < rSymbolName.Len(); i++)
 /*N*/         x += x * rSymbolName.GetChar(i) + i;
-/*N*/ 
+/*N*/
 /*N*/ 	return x % pImpl->NoHashEntries;
 /*N*/ }
 
@@ -230,8 +225,8 @@ long				SF_Ident = SF_IDENT;
 
 /*N*/ void SmSymSetManager::EnterHashTable(SmSymSet& rSymbolSet)
 /*N*/ {
-/*N*/ 	for (int i = 0; i < rSymbolSet.GetCount(); i++)
-/*N*/         EnterHashTable( *rSymbolSet.SymbolList.GetObject(i) );
+/*N*/ 	for ( size_t i = 0; i < rSymbolSet.GetCount(); i++ )
+/*N*/         EnterHashTable( *rSymbolSet.SymbolList[ i ] );
 /*N*/ }
 
 /*N*/ void SmSymSetManager::FillHashTable()
@@ -239,41 +234,34 @@ long				SF_Ident = SF_IDENT;
 /*N*/ 	if (pImpl->HashEntries)
 /*N*/ 	{
 /*N*/ 		memset( pImpl->HashEntries, 0, pImpl->NoHashEntries * sizeof(SmSym *) );
-/*N*/ 
+/*N*/
 /*N*/ 		for (UINT32 i = 0; i < pImpl->NoSymbolSets; i++)
 /*N*/ 			EnterHashTable( *GetSymbolSet( (USHORT) i ) );
 /*N*/ 	}
 /*N*/ }
 
 
-
-
-
 /*N*/ SmSymSetManager::SmSymSetManager(USHORT HashTableSize)
 /*N*/ {
 /*N*/     pImpl = new SmSymSetManager_Impl( *this, HashTableSize );
 /*N*/ }
 
 
-
-
-
-
 /*N*/ USHORT SmSymSetManager::AddSymbolSet(SmSymSet* pSymbolSet)
 /*N*/ {
 /*N*/ 	if (pImpl->NoSymbolSets >= pImpl->SymbolSets.GetSize())
 /*?*/ 		pImpl->SymbolSets.SetSize(pImpl->NoSymbolSets + 1);
-/*N*/ 
+/*N*/
 /*N*/ 	pImpl->SymbolSets.Put(pImpl->NoSymbolSets++, pSymbolSet);
-/*N*/ 
+/*N*/
 /*N*/ 	pSymbolSet->pSymSetManager = this;
-/*N*/ 
-/*N*/ 	for (int i = 0; i < pSymbolSet->GetCount(); i++)
-/*?*/ 		pSymbolSet->SymbolList.GetObject(i)->pSymSetManager = this;
-/*N*/ 
+/*N*/
+/*N*/ 	for ( size_t i = 0; i < pSymbolSet->GetCount(); i++ )
+/*?*/ 		pSymbolSet->SymbolList[ i ]->pSymSetManager = this;
+/*N*/
 /*N*/ 	FillHashTable();
 /*N*/ 	pImpl->Modified = TRUE;
-/*N*/ 
+/*N*/
 /*N*/ 	return (USHORT) (pImpl->NoSymbolSets - 1);
 /*N*/ }
 
@@ -293,7 +281,7 @@ long				SF_Ident = SF_IDENT;
 /*N*/ 	for (USHORT i = 0; i < pImpl->NoSymbolSets; i++)
 /*N*/ 		if (pImpl->SymbolSets.Get(i)->GetName() == rSymbolSetName)
 /*N*/ 			return (i);
-/*N*/ 
+/*N*/
 /*N*/ 	return SYMBOLSET_NONE;
 /*N*/ }
 
@@ -306,13 +294,13 @@ long				SF_Ident = SF_IDENT;
 /*N*/             break;
 /*N*/         pSym = pSym->pHashNext;
 /*N*/     }
-/*N*/ 
+/*N*/
 /*N*/ 	return pSym;
 /*N*/ }
 
 
 /*N*/ USHORT SmSymSetManager::GetSymbolCount() const
-/*N*/ { 
+/*N*/ {
 /*N*/     USHORT nRes = 0;
 /*N*/     USHORT nSets = GetSymbolSetCount();
 /*N*/     for (USHORT i = 0;  i < nSets;  ++i)
@@ -324,7 +312,7 @@ long				SF_Ident = SF_IDENT;
 /*N*/ const SmSym * SmSymSetManager::GetSymbolByPos( USHORT nPos ) const
 /*N*/ {
 /*N*/     const SmSym *pRes = 0;
-/*N*/ 
+/*N*/
 /*N*/     INT16 nIdx = 0;
 /*N*/     USHORT nSets = GetSymbolSetCount();
 /*N*/     USHORT i = 0;
@@ -337,7 +325,7 @@ long				SF_Ident = SF_IDENT;
 /*N*/             nIdx += nEntries;
 /*N*/         ++i;
 /*N*/     }
-/*N*/ 
+/*N*/
 /*N*/     return pRes;
 /*N*/ }
 
@@ -345,7 +333,7 @@ long				SF_Ident = SF_IDENT;
 /*N*/ void SmSymSetManager::Load()
 /*N*/ {
 /*N*/     SmMathConfig &rCfg = *SM_MOD1()->GetConfig();
-/*N*/ 
+/*N*/
 /*N*/     USHORT nCount = rCfg.GetSymbolCount();
 /*N*/     USHORT i;
 /*N*/     for (i = 0;  i < nCount;  ++i)
@@ -363,7 +351,7 @@ long				SF_Ident = SF_IDENT;
 /*N*/                 pSymSet = new SmSymSet( rSetName );
 /*N*/                 AddSymbolSet( pSymSet );
 /*N*/             }
-/*N*/ 
+/*N*/
 /*N*/             pSymSet->AddSymbol( new SmSym( *pSym ) );
 /*N*/         }
 /*N*/     }
@@ -371,7 +359,7 @@ long				SF_Ident = SF_IDENT;
 /*N*/     nCount = GetSymbolSetCount();
 /*N*/     for (i = 0;  i < nCount;  ++i)
 /*N*/         ChangeSymbolSet( GetSymbolSet( i ) );
-/*N*/ 
+/*N*/
 /*N*/     if (0 == nCount)
 /*N*/     {
 /*N*/         DBG_ERROR( "no symbol set found" );
diff --git a/binfilter/inc/bf_starmath/symbol.hxx b/binfilter/inc/bf_starmath/symbol.hxx
index 67913f7..437facf 100644
--- a/binfilter/inc/bf_starmath/symbol.hxx
+++ b/binfilter/inc/bf_starmath/symbol.hxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -38,6 +38,8 @@
 
 #include "utility.hxx"
 #include <smmod.hxx>
+#include <vector>
+
 namespace binfilter {
 
 #define SS_ATTR_ACCESS		0x80
@@ -108,7 +110,7 @@ public:
     void            SetDocSymbol( BOOL bVal )   { bDocSymbol = bVal; }
 };
 
-DECLARE_LIST(SmListSym, SmSym *)//STRIP008 DECLARE_LIST(SmListSym, SmSym *);
+typedef ::std::vector< SmSym* > SmListSym;
 SV_DECL_PTRARR( SymbolArray, SmSym *, 32, 32 )//STRIP008 ;
 
 /**************************************************************************/
@@ -117,7 +119,6 @@ class SmSymSet
 {
     friend class SmSymSetManager;
 
-
     SmListSym		  	 SymbolList;
     String				 Name;
     SmSymSetManager		*pSymSetManager;
@@ -127,13 +128,12 @@ public:
 
 
     const String&	GetName() const { return Name; }
-    USHORT			GetCount() const { return (USHORT) SymbolList.Count(); }
+    size_t          GetCount() const { return SymbolList.size(); }
 
-    const SmSym&	GetSymbol(USHORT SymbolNo) const
-    {
-        DBG_ASSERT(SymbolList.GetObject(SymbolNo), "Symbol nicht vorhanden");
-        return *SymbolList.GetObject(SymbolNo);
-    }
+   const SmSym&	GetSymbol(USHORT SymbolNo) const
+   {
+       return *SymbolList[ SymbolNo ];
+   }
 
     USHORT      AddSymbol(SmSym* pSymbol);
 };
@@ -179,8 +179,8 @@ public:
     void		ChangeSymbolSet(SmSymSet* pSymbolSet);
     USHORT		GetSymbolSetPos(const String& rSymbolSetName) const;
         USHORT      GetSymbolSetCount() const { return pImpl->NoSymbolSets; }
-    SmSymSet   *GetSymbolSet(USHORT SymbolSetNo) const 
-    { 
+    SmSymSet   *GetSymbolSet(USHORT SymbolSetNo) const
+    {
         return pImpl->SymbolSets.Get(SymbolSetNo);
     }
 


More information about the Libreoffice-commits mailing list