summaryrefslogtreecommitdiff
path: root/starmath/source/symbol.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'starmath/source/symbol.cxx')
-rw-r--r--starmath/source/symbol.cxx37
1 files changed, 21 insertions, 16 deletions
diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index 52d0520ae61b..7347dbcd705f 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -63,11 +63,11 @@ SmSym::SmSym() :
m_aName(C2S("unknown")),
m_aSetName(C2S("unknown")),
m_cChar('\0'),
- m_bPredefined(FALSE),
- m_bDocSymbol(FALSE)
+ m_bPredefined(sal_False),
+ m_bDocSymbol(sal_False)
{
m_aExportName = m_aName;
- m_aFace.SetTransparent(TRUE);
+ m_aFace.SetTransparent(sal_True);
m_aFace.SetAlign(ALIGN_BASELINE);
}
@@ -79,12 +79,12 @@ SmSym::SmSym(const SmSym& rSymbol)
SmSym::SmSym(const String& rName, const Font& rFont, sal_UCS4 cChar,
- const String& rSet, BOOL bIsPredefined)
+ const String& rSet, sal_Bool bIsPredefined)
{
m_aName = m_aExportName = rName;
m_aFace = rFont;
- m_aFace.SetTransparent(TRUE);
+ m_aFace.SetTransparent(sal_True);
m_aFace.SetAlign(ALIGN_BASELINE);
m_cChar = cChar;
@@ -101,7 +101,7 @@ SmSym::SmSym(const String& rName, const Font& rFont, sal_UCS4 cChar,
// Character |= 0xF000;
m_aSetName = rSet;
m_bPredefined = bIsPredefined;
- m_bDocSymbol = FALSE;
+ m_bDocSymbol = sal_False;
}
@@ -218,14 +218,19 @@ bool SmSymbolManager::AddOrReplaceSymbol( const SmSym &rSymbol, bool bForceChang
}
else if (pFound && !bForceChange && bSymbolConflict)
{
- // TODO: but what ...
- DBG_ASSERT( 0, "symbol conflict, different symbol with same name found!" );
+ // TODO: to solve this a document owned symbol manager would be required ...
+ // But for now we have a global one to easily support availability of all
+ // symbols in all formulas. A copy of the global one would be needed here
+ // and then the new symbol has to be forcefully applied. This would keep
+ // the current formula intact but will leave the set of symbols in the
+ // global symbol manager somewhat to chance.
+ DBG_ASSERT( 0, "symbol conflict, different symbol with same name found!" );
}
- }
- DBG_ASSERT( bAdded, "failed to add symbol" );
- if (bAdded)
- m_bModified = true;
+ if (bAdded)
+ m_bModified = true;
+ DBG_ASSERT( bAdded || (pFound && !bSymbolConflict), "AddOrReplaceSymbol: unresolved symbol conflict" );
+ }
return bAdded;
}
@@ -308,7 +313,7 @@ void SmSymbolManager::Load()
String aSymbolName( (sal_Unicode)'i' );
aSymbolName += rSym.GetName();
SmSym aSymbol( aSymbolName, aFont, rSym.GetCharacter(),
- aSymbolSetName, TRUE /*bIsPredefined*/ );
+ aSymbolSetName, sal_True /*bIsPredefined*/ );
AddOrReplaceSymbol( aSymbol );
}
@@ -321,11 +326,11 @@ void SmSymbolManager::Save()
SmMathConfig &rCfg = *SM_MOD()->GetConfig();
#if 0
- USHORT nSymbolCount = GetSymbolCount();
- USHORT nSaveSymbolCnt = 0;
+ sal_uInt16 nSymbolCount = GetSymbolCount();
+ sal_uInt16 nSaveSymbolCnt = 0;
const SmSym **pSymbols = new const SmSym* [ nSymbolCount ];
const SmSym **pSym = pSymbols;
- for (USHORT j = 0; j < nSymbolCount; ++j)
+ for (sal_uInt16 j = 0; j < nSymbolCount; ++j)
{
const SmSym &rSym = *pSymSet->GetSymbol( j );
if (!rSym.IsDocSymbol())