diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-10-12 14:48:34 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-10-12 16:33:42 +0100 |
commit | 53acdd29e32707eb4ad6e922b47e1c1216f9d7d6 (patch) | |
tree | 53b62faaa7b0f7a3781c781dda023a77e6843aca /starmath | |
parent | Always disable anti-aliasing for drawing cell borders. (diff) | |
download | core-53acdd29e32707eb4ad6e922b47e1c1216f9d7d6.tar.gz core-53acdd29e32707eb4ad6e922b47e1c1216f9d7d6.zip |
XubString->OUString
Change-Id: Ib5f39e099d238b739e0d6b3d92d3f04ee50022fb
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/dialog.hxx | 28 | ||||
-rw-r--r-- | starmath/inc/symbol.hxx | 56 | ||||
-rw-r--r-- | starmath/source/cfgitem.cxx | 2 | ||||
-rw-r--r-- | starmath/source/dialog.cxx | 90 | ||||
-rw-r--r-- | starmath/source/node.cxx | 2 | ||||
-rw-r--r-- | starmath/source/symbol.cxx | 40 |
6 files changed, 99 insertions, 119 deletions
diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index 571c4c074db5..6636ad0330e4 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -44,7 +44,7 @@ class SubsetMap; /**************************************************************************/ -void SetFontStyle(const XubString &rStyleName, Font &rFont); +void SetFontStyle(const OUString &rStyleName, Font &rFont); /**************************************************************************/ @@ -382,7 +382,7 @@ public: SmSymbolManager &rSymbolMgr, SmViewShell &rViewShell, bool bFreeRes = true); virtual ~SmSymbolDialog(); - bool SelectSymbolSet(const XubString &rSymbolSetName); + bool SelectSymbolSet(const OUString &rSymbolSetName); void SelectSymbol(sal_uInt16 nSymbolPos); sal_uInt16 GetSelectedSymbol() const { return aSymbolSetDisplay.GetSelectSymbol(); } }; @@ -462,16 +462,16 @@ class SmSymDefineDialog : public ModalDialog void FillStyles(bool bDeleteText = true); void SetSymbolSetManager(const SmSymbolManager &rMgr); - void SetFont(const XubString &rFontName, const XubString &rStyleName); - void SetOrigSymbol(const SmSym *pSymbol, const XubString &rSymbolSetName); + void SetFont(const OUString &rFontName, const OUString &rStyleName); + void SetOrigSymbol(const SmSym *pSymbol, const OUString &rSymbolSetName); void UpdateButtons(); - bool SelectSymbolSet(ComboBox &rComboBox, const XubString &rSymbolSetName, + bool SelectSymbolSet(ComboBox &rComboBox, const OUString &rSymbolSetName, bool bDeleteText); - bool SelectSymbol(ComboBox &rComboBox, const XubString &rSymbolName, + bool SelectSymbol(ComboBox &rComboBox, const OUString &rSymbolName, bool bDeleteText); - bool SelectFont(const XubString &rFontName, bool bApplyFont); - bool SelectStyle(const XubString &rStyleName, bool bApplyFont); + bool SelectFont(const OUString &rFontName, bool bApplyFont); + bool SelectStyle(const OUString &rStyleName, bool bApplyFont); SmSym * GetSymbol(const ComboBox &rComboBox); const SmSym * GetSymbol(const ComboBox &rComboBox) const @@ -492,28 +492,28 @@ public: // Dialog virtual short Execute(); - bool SelectOldSymbolSet(const XubString &rSymbolSetName) + bool SelectOldSymbolSet(const OUString &rSymbolSetName) { return SelectSymbolSet(aOldSymbolSets, rSymbolSetName, false); } - bool SelectOldSymbol(const XubString &rSymbolName) + bool SelectOldSymbol(const OUString &rSymbolName) { return SelectSymbol(aOldSymbols, rSymbolName, false); } - bool SelectSymbolSet(const XubString &rSymbolSetName) + bool SelectSymbolSet(const OUString &rSymbolSetName) { return SelectSymbolSet(aSymbolSets, rSymbolSetName, false); } - bool SelectSymbol(const XubString &rSymbolName) + bool SelectSymbol(const OUString &rSymbolName) { return SelectSymbol(aSymbols, rSymbolName, false); } - bool SelectFont(const XubString &rFontName) { return SelectFont(rFontName, true); } - bool SelectStyle(const XubString &rStyleName) { return SelectStyle(rStyleName, true); }; + bool SelectFont(const OUString &rFontName) { return SelectFont(rFontName, true); } + bool SelectStyle(const OUString &rStyleName) { return SelectStyle(rStyleName, true); }; void SelectChar(xub_Unicode cChar); }; diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx index b6d0224cb2b7..615f75266a62 100644 --- a/starmath/inc/symbol.hxx +++ b/starmath/inc/symbol.hxx @@ -40,24 +40,24 @@ //////////////////////////////////////////////////////////////////////////////// -inline const String GetExportSymbolName( const String &rUiSymbolName ) +inline const OUString GetExportSymbolName( const OUString &rUiSymbolName ) { return SM_MOD()->GetLocSymbolData().GetExportSymbolName( rUiSymbolName ); } -inline const String GetUiSymbolName( const String &rExportSymbolName ) +inline const OUString GetUiSymbolName( const OUString &rExportSymbolName ) { return SM_MOD()->GetLocSymbolData().GetUiSymbolName( rExportSymbolName ); } -inline const String GetExportSymbolSetName( const String &rUiSymbolSetName ) +inline const OUString GetExportSymbolSetName( const OUString &rUiSymbolSetName ) { return SM_MOD()->GetLocSymbolData().GetExportSymbolSetName( rUiSymbolSetName ); } -inline const String GetUiSymbolSetName( const String &rExportSymbolSetName ) +inline const OUString GetUiSymbolSetName( const OUString &rExportSymbolSetName ) { return SM_MOD()->GetLocSymbolData().GetUiSymbolSetName( rExportSymbolSetName ); } @@ -68,37 +68,33 @@ class SmSym { private: SmFace m_aFace; - String m_aName; - String m_aExportName; - String m_aSetName; + OUString m_aName; + OUString m_aExportName; + OUString m_aSetName; sal_UCS4 m_cChar; bool m_bPredefined; bool m_bDocSymbol; public: SmSym(); - SmSym(const String& rName, const Font& rFont, sal_UCS4 cChar, - const String& rSet, bool bIsPredefined = false); + SmSym(const OUString& rName, const Font& rFont, sal_UCS4 cChar, + const OUString& rSet, bool bIsPredefined = false); SmSym(const SmSym& rSymbol); SmSym& operator = (const SmSym& rSymbol); const Font& GetFace() const { return m_aFace; } sal_UCS4 GetCharacter() const { return m_cChar; } - const String& GetName() const { return m_aName; } + const OUString& GetName() const { return m_aName; } void SetFace( const Font& rFont ) { m_aFace = rFont; } void SetCharacter( sal_UCS4 cChar ) { m_cChar = cChar; } -//! since the symbol name is also used as key in the map it should not be possible to change the name -//! because ten the key would not be the same as its supposed copy here -// void SetName( const String &rTxt ) { m_aName = rTxt; } - bool IsPredefined() const { return m_bPredefined; } - const String & GetSymbolSetName() const { return m_aSetName; } - void SetSymbolSetName( const String &rName ) { m_aSetName = rName; } - const String & GetExportName() const { return m_aExportName; } - void SetExportName( const String &rName ) { m_aExportName = rName; } + const OUString& GetSymbolSetName() const { return m_aSetName; } + void SetSymbolSetName( const OUString &rName ) { m_aSetName = rName; } + const OUString& GetExportName() const { return m_aExportName; } + void SetExportName( const OUString &rName ) { m_aExportName = rName; } bool IsDocSymbol() const { return m_bDocSymbol; } void SetDocSymbol( bool bVal ) { m_bDocSymbol = bVal; } @@ -107,20 +103,8 @@ public: bool IsEqualInUI( const SmSym& rSymbol ) const; }; -/**************************************************************************/ - -struct lt_String -{ - bool operator()( const String &r1, const String &r2 ) const - { - // r1 < r2 ? - return r1.CompareTo( r2 ) == COMPARE_LESS; - } -}; - - // type of the actual container to hold the symbols -typedef std::map< String, SmSym, lt_String > SymbolMap_t; +typedef std::map< OUString, SmSym > SymbolMap_t; // vector of pointers to the actual symbols in the above container typedef std::vector< const SmSym * > SymbolPtrVec_t; @@ -151,16 +135,16 @@ public: SmSymbolManager & operator = (const SmSymbolManager& rSymbolSetManager); // symbol sets are for UI purpose only, thus we assemble them here - std::set< String > GetSymbolSetNames() const; - const SymbolPtrVec_t GetSymbolSet( const String& rSymbolSetName ); + std::set< OUString > GetSymbolSetNames() const; + const SymbolPtrVec_t GetSymbolSet( const OUString& rSymbolSetName ); sal_uInt16 GetSymbolCount() const { return static_cast< sal_uInt16 >(m_aSymbols.size()); } const SymbolPtrVec_t GetSymbols() const; bool AddOrReplaceSymbol( const SmSym & rSymbol, bool bForceChange = false ); - void RemoveSymbol( const String & rSymbolName ); + void RemoveSymbol( const OUString & rSymbolName ); - SmSym * GetSymbolByName(const String& rSymbolName); - const SmSym * GetSymbolByName(const String& rSymbolName) const + SmSym * GetSymbolByName(const OUString& rSymbolName); + const SmSym * GetSymbolByName(const OUString& rSymbolName) const { return ((SmSymbolManager *) this)->GetSymbolByName(rSymbolName); } diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index 1d363163cbc1..939dd2c93e75 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -809,7 +809,7 @@ void SmMathConfig::StripFontFormatList( const std::vector< SmSym > &rSymbols ) SmFontFormatList aUsedList; for (i = 0; i < rSymbols.size(); ++i) { - OSL_ENSURE( rSymbols[i].GetName().Len() > 0, "non named symbol" ); + OSL_ENSURE( rSymbols[i].GetName().getLength() > 0, "non named symbol" ); aUsedList.GetFontFormatId( SmFontFormat( rSymbols[i].GetFace() ) , true ); } const SmFormat & rStdFmt = GetStandardFormat(); diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index a94a4b9d2b01..82a0e7228068 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -59,18 +59,18 @@ using ::rtl::OUString; class SmFontStyles { - String aNormal; - String aBold; - String aItalic; - String aBoldItalic; - String aEmpty; + OUString aNormal; + OUString aBold; + OUString aItalic; + OUString aBoldItalic; + OUString aEmpty; public: SmFontStyles(); sal_uInt16 GetCount() const { return 4; } - const String & GetStyleName( const Font &rFont ) const; - const String & GetStyleName( sal_uInt16 nIdx ) const; + const OUString& GetStyleName( const Font &rFont ) const; + const OUString& GetStyleName( sal_uInt16 nIdx ) const; }; @@ -81,12 +81,12 @@ SmFontStyles::SmFontStyles() : { aBoldItalic = aBold; - aBoldItalic.AppendAscii( ", " ); + aBoldItalic += ", "; aBoldItalic += aItalic; } -const String & SmFontStyles::GetStyleName( const Font &rFont ) const +const OUString& SmFontStyles::GetStyleName( const Font &rFont ) const { //! compare also SmSpecialNode::Prepare bool bBold = IsBold( rFont ), @@ -98,12 +98,11 @@ const String & SmFontStyles::GetStyleName( const Font &rFont ) const return aItalic; else if (bBold) return aBold; - else - return aNormal; + return aNormal; } -const String & SmFontStyles::GetStyleName( sal_uInt16 nIdx ) const +const OUString& SmFontStyles::GetStyleName( sal_uInt16 nIdx ) const { // 0 = "normal", 1 = "italic", // 2 = "bold", 3 = "bold italic" @@ -130,17 +129,17 @@ const SmFontStyles & GetFontStyles() ///////////////////////////////////////////////////////////////// -void SetFontStyle(const XubString &rStyleName, Font &rFont) +void SetFontStyle(const OUString &rStyleName, Font &rFont) { // Find index related to StyleName. For an empty StyleName it's assumed to be // 0 (neither bold nor italic). sal_uInt16 nIndex = 0; - if (rStyleName.Len()) + if (!rStyleName.isEmpty()) { sal_uInt16 i; const SmFontStyles &rStyles = GetFontStyles(); - for (i = 0; i < rStyles.GetCount(); i++) - if (rStyleName.CompareTo( rStyles.GetStyleName(i) ) == COMPARE_EQUAL) + for (i = 0; i < rStyles.GetCount(); ++i) + if (rStyleName == rStyles.GetStyleName(i)) break; #if OSL_DEBUG_LEVEL > 1 OSL_ENSURE(i < rStyles.GetCount(), "style-name unknown"); @@ -242,7 +241,7 @@ void SmShowFont::Paint(const Rectangle& rRect ) { Control::Paint( rRect ); - XubString Text (GetFont().GetName()); + OUString Text (GetFont().GetName()); Size TextSize(GetTextWidth(Text), GetTextHeight()); DrawText(Point((GetOutputSize().Width() - TextSize.Width()) / 2, @@ -801,10 +800,7 @@ void SmDistanceDialog::SetHelpId(MetricField &rField, const rtl::OString& sHelpI // HelpIDs which are explicitly set in this way have to be defined in the // util directory in the file "hidother.src" with the help of "hidspecial"! - const XubString aEmptyText; -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE(aEmptyText.Len() == 0, "Sm: Ooops..."); -#endif + const OUString aEmptyText; rField.SetHelpId(sHelpId); rField.SetHelpText(aEmptyText); @@ -1360,7 +1356,7 @@ void SmShowSymbol::Paint(const Rectangle &rRect) { Control::Paint( rRect ); - const XubString &rText = GetText(); + const OUString &rText = GetText(); Size aTextSize(GetTextWidth(rText), GetTextHeight()); DrawText(Point((GetOutputSize().Width() - aTextSize.Width()) / 2, @@ -1407,8 +1403,8 @@ void SmSymbolDialog::FillSymbolSets(bool bDeleteText) if (bDeleteText) aSymbolSets.SetNoSelection(); - std::set< String > aSybolSetNames( rSymbolMgr.GetSymbolSetNames() ); - std::set< String >::const_iterator aIt( aSybolSetNames.begin() ); + std::set< OUString > aSybolSetNames( rSymbolMgr.GetSymbolSetNames() ); + std::set< OUString >::const_iterator aIt( aSybolSetNames.begin() ); for ( ; aIt != aSybolSetNames.end(); ++aIt) aSymbolSets.InsertEntry( *aIt ); } @@ -1447,7 +1443,7 @@ IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, EMPTYARG pButton ) SmSymDefineDialog *pDialog = new SmSymDefineDialog(this, pFontListDev, rSymbolMgr); // set current symbol and SymbolSet for the new dialog - const XubString aSymSetName (aSymbolSets.GetSelectEntry()), + const OUString aSymSetName (aSymbolSets.GetSelectEntry()), aSymName (aSymbolName.GetText()); pDialog->SelectOldSymbolSet(aSymSetName); pDialog->SelectOldSymbol(aSymName); @@ -1455,7 +1451,7 @@ IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, EMPTYARG pButton ) pDialog->SelectSymbol(aSymName); // remember old SymbolSet - XubString aOldSymbolSet (aSymbolSets.GetSelectEntry()); + OUString aOldSymbolSet (aSymbolSets.GetSelectEntry()); sal_uInt16 nSymPos = GetSelectedSymbol(); @@ -1625,7 +1621,7 @@ void SmSymbolDialog::DataChanged( const DataChangedEvent& rDCEvt ) } -bool SmSymbolDialog::SelectSymbolSet(const XubString &rSymbolSetName) +bool SmSymbolDialog::SelectSymbolSet(const OUString &rSymbolSetName) { bool bRet = false; sal_uInt16 nPos = aSymbolSets.GetEntryPos(rSymbolSetName); @@ -1663,7 +1659,7 @@ void SmSymbolDialog::SelectSymbol(sal_uInt16 nSymbolNo) aSymbolSetDisplay.SelectSymbol(nSymbolNo); aSymbolDisplay.SetSymbol(pSym); - aSymbolName.SetText(pSym ? pSym->GetName() : XubString()); + aSymbolName.SetText(pSym ? pSym->GetName() : OUString()); } @@ -1751,8 +1747,8 @@ void SmSymDefineDialog::FillSymbolSets(ComboBox &rComboBox, bool bDeleteText) if (bDeleteText) rComboBox.SetText(rtl::OUString()); - const std::set< String > aSymbolSetNames( aSymbolMgrCopy.GetSymbolSetNames() ); - std::set< String >::const_iterator aIt( aSymbolSetNames.begin() ); + const std::set< OUString > aSymbolSetNames( aSymbolMgrCopy.GetSymbolSetNames() ); + std::set< OUString >::const_iterator aIt( aSymbolSetNames.begin() ); for ( ; aIt != aSymbolSetNames.end(); ++aIt) rComboBox.InsertEntry( *aIt ); } @@ -1782,8 +1778,8 @@ void SmSymDefineDialog::FillStyles(bool bDeleteText) if (bDeleteText) aStyles.SetText(rtl::OUString()); - XubString aText (aFonts.GetSelectEntry()); - if (aText.Len() != 0) + OUString aText (aFonts.GetSelectEntry()); + if (!aText.isEmpty()) { // use own StyleNames const SmFontStyles &rStyles = GetFontStyles(); @@ -2040,16 +2036,16 @@ void SmSymDefineDialog::UpdateButtons() bool bAdd = false, bChange = false, bDelete = false; - XubString aTmpSymbolName (aSymbols.GetText()), + OUString aTmpSymbolName (aSymbols.GetText()), aTmpSymbolSetName (aSymbolSets.GetText()); - if (aTmpSymbolName.Len() > 0 && aTmpSymbolSetName.Len() > 0) + if (aTmpSymbolName.getLength() > 0 && aTmpSymbolSetName.getLength() > 0) { // are all settings equal? //! (Font-, Style- und SymbolSet name comparison is not case sensitive) bool bEqual = pOrigSymbol - && aTmpSymbolSetName.EqualsIgnoreCaseAscii(aOldSymbolSetName.GetText()) - && aTmpSymbolName.Equals(pOrigSymbol->GetName()) + && aTmpSymbolSetName.equalsIgnoreAsciiCase(aOldSymbolSetName.GetText()) + && aTmpSymbolName.equals(pOrigSymbol->GetName()) && aFonts.GetSelectEntry().EqualsIgnoreCaseAscii( pOrigSymbol->GetFace().GetName()) && aStyles.GetText().EqualsIgnoreCaseAscii( @@ -2245,7 +2241,7 @@ void SmSymDefineDialog::SetSymbolSetManager(const SmSymbolManager &rMgr) bool SmSymDefineDialog::SelectSymbolSet(ComboBox &rComboBox, - const XubString &rSymbolSetName, bool bDeleteText) + const OUString &rSymbolSetName, bool bDeleteText) { #if OSL_DEBUG_LEVEL > 1 OSL_ENSURE(&rComboBox == &aOldSymbolSets || &rComboBox == &aSymbolSets, @@ -2253,7 +2249,7 @@ bool SmSymDefineDialog::SelectSymbolSet(ComboBox &rComboBox, #endif // trim SymbolName (no leading and trailing blanks) - XubString aNormName (rSymbolSetName); + OUString aNormName (rSymbolSetName); aNormName = comphelper::string::stripStart(aNormName, ' '); aNormName = comphelper::string::stripEnd(aNormName, ' '); // and remove possible deviations within the input @@ -2283,7 +2279,7 @@ bool SmSymDefineDialog::SelectSymbolSet(ComboBox &rComboBox, // display a valid respectively no symbol when changing the SymbolSets if (bIsOld) { - XubString aTmpOldSymbolName; + OUString aTmpOldSymbolName; if (aOldSymbols.GetEntryCount() > 0) aTmpOldSymbolName = aOldSymbols.GetEntry(0); SelectSymbol(aOldSymbols, aTmpOldSymbolName, true); @@ -2296,13 +2292,13 @@ bool SmSymDefineDialog::SelectSymbolSet(ComboBox &rComboBox, void SmSymDefineDialog::SetOrigSymbol(const SmSym *pSymbol, - const XubString &rSymbolSetName) + const OUString &rSymbolSetName) { // clear old symbol delete pOrigSymbol; pOrigSymbol = 0; - XubString aSymName, + OUString aSymName, aSymSetName; if (pSymbol) { @@ -2324,7 +2320,7 @@ void SmSymDefineDialog::SetOrigSymbol(const SmSym *pSymbol, bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, - const XubString &rSymbolName, bool bDeleteText) + const OUString &rSymbolName, bool bDeleteText) { #if OSL_DEBUG_LEVEL > 1 OSL_ENSURE(&rComboBox == &aOldSymbols || &rComboBox == &aSymbols, @@ -2332,7 +2328,7 @@ bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, #endif // trim SymbolName (no blanks) - XubString aNormName(comphelper::string::remove(rSymbolName, ' ')); + OUString aNormName(comphelper::string::remove(rSymbolName, ' ')); // and remove possible deviations within the input rComboBox.SetText(aNormName); @@ -2379,7 +2375,7 @@ bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, { // if there's a change of the old symbol, show only the available ones, otherwise show none const SmSym *pOldSymbol = NULL; - XubString aTmpOldSymbolSetName; + OUString aTmpOldSymbolSetName; if (nPos != COMBOBOX_ENTRY_NOTFOUND) { pOldSymbol = aSymbolMgrCopy.GetSymbolByName(aNormName); @@ -2396,7 +2392,7 @@ bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, } -void SmSymDefineDialog::SetFont(const XubString &rFontName, const XubString &rStyleName) +void SmSymDefineDialog::SetFont(const OUString &rFontName, const OUString &rStyleName) { // get Font (FontInfo) matching name and style FontInfo aFI; @@ -2432,7 +2428,7 @@ void SmSymDefineDialog::SetFont(const XubString &rFontName, const XubString &rSt } -bool SmSymDefineDialog::SelectFont(const XubString &rFontName, bool bApplyFont) +bool SmSymDefineDialog::SelectFont(const OUString &rFontName, bool bApplyFont) { bool bRet = false; sal_uInt16 nPos = aFonts.GetEntryPos(rFontName); @@ -2460,7 +2456,7 @@ bool SmSymDefineDialog::SelectFont(const XubString &rFontName, bool bApplyFont) } -bool SmSymDefineDialog::SelectStyle(const XubString &rStyleName, bool bApplyFont) +bool SmSymDefineDialog::SelectStyle(const OUString &rStyleName, bool bApplyFont) { bool bRet = false; sal_uInt16 nPos = aStyles.GetEntryPos(rStyleName); diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index d7bd76fdb315..972f725827a0 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -2869,7 +2869,7 @@ static bool lcl_IsFromGreekSymbolSet( const String &rTokenText ) { String aName( rTokenText.Copy(1) ); SmSym *pSymbol = SM_MOD()->GetSymbolManager().GetSymbolByName( aName ); - if (pSymbol && GetExportSymbolSetName( pSymbol->GetSymbolSetName() ).EqualsAscii( "Greek" ) ) + if (pSymbol && GetExportSymbolSetName(pSymbol->GetSymbolSetName()) == "Greek") bRes = true; } diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx index 0cb52c93509b..7ab9f024d4db 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -47,8 +47,8 @@ using namespace ::rtl; /**************************************************************************/ SmSym::SmSym() : - m_aName(rtl::OUString("unknown")), - m_aSetName(rtl::OUString("unknown")), + m_aName(OUString("unknown")), + m_aSetName(OUString("unknown")), m_cChar('\0'), m_bPredefined(false), m_bDocSymbol(false) @@ -65,8 +65,8 @@ SmSym::SmSym(const SmSym& rSymbol) } -SmSym::SmSym(const String& rName, const Font& rFont, sal_UCS4 cChar, - const String& rSet, bool bIsPredefined) +SmSym::SmSym(const OUString& rName, const Font& rFont, sal_UCS4 cChar, + const OUString& rSet, bool bIsPredefined) { m_aName = m_aExportName = rName; @@ -141,7 +141,7 @@ SmSymbolManager& SmSymbolManager::operator = (const SmSymbolManager& rSymbolSetM } -SmSym *SmSymbolManager::GetSymbolByName(const String& rSymbolName) +SmSym *SmSymbolManager::GetSymbolByName(const OUString& rSymbolName) { SmSym *pRes = NULL; SymbolMap_t::iterator aIt( m_aSymbols.find( rSymbolName ) ); @@ -166,8 +166,8 @@ bool SmSymbolManager::AddOrReplaceSymbol( const SmSym &rSymbol, bool bForceChang { bool bAdded = false; - const String aSymbolName( rSymbol.GetName() ); - if (aSymbolName.Len() > 0 && rSymbol.GetSymbolSetName().Len() > 0) + const OUString aSymbolName( rSymbol.GetName() ); + if (aSymbolName.getLength() > 0 && rSymbol.GetSymbolSetName().getLength() > 0) { const SmSym *pFound = GetSymbolByName( aSymbolName ); const bool bSymbolConflict = pFound && !pFound->IsEqualInUI( rSymbol ); @@ -198,9 +198,9 @@ bool SmSymbolManager::AddOrReplaceSymbol( const SmSym &rSymbol, bool bForceChang } -void SmSymbolManager::RemoveSymbol( const String & rSymbolName ) +void SmSymbolManager::RemoveSymbol( const OUString & rSymbolName ) { - if (rSymbolName.Len() > 0) + if (rSymbolName.getLength() > 0) { size_t nOldSize = m_aSymbols.size(); m_aSymbols.erase( rSymbolName ); @@ -209,9 +209,9 @@ void SmSymbolManager::RemoveSymbol( const String & rSymbolName ) } -std::set< String > SmSymbolManager::GetSymbolSetNames() const +std::set< OUString > SmSymbolManager::GetSymbolSetNames() const { - std::set< String > aRes; + std::set< OUString > aRes; SymbolMap_t::const_iterator aIt( m_aSymbols.begin() ); for ( ; aIt != m_aSymbols.end(); ++aIt ) aRes.insert( aIt->second.GetSymbolSetName() ); @@ -219,10 +219,10 @@ std::set< String > SmSymbolManager::GetSymbolSetNames() const } -const SymbolPtrVec_t SmSymbolManager::GetSymbolSet( const String& rSymbolSetName ) +const SymbolPtrVec_t SmSymbolManager::GetSymbolSet( const OUString& rSymbolSetName ) { SymbolPtrVec_t aRes; - if (rSymbolSetName.Len() > 0) + if (rSymbolSetName.getLength() > 0) { SymbolMap_t::const_iterator aIt( m_aSymbols.begin() ); for ( ; aIt != m_aSymbols.end(); ++aIt ) @@ -246,8 +246,8 @@ void SmSymbolManager::Load() for (size_t i = 0; i < nSymbolCount; ++i) { const SmSym &rSym = aSymbols[i]; - OSL_ENSURE( rSym.GetName().Len() > 0, "symbol without name!" ); - if (rSym.GetName().Len() > 0) + OSL_ENSURE( rSym.GetName().getLength() > 0, "symbol without name!" ); + if (rSym.GetName().getLength() > 0) AddOrReplaceSymbol( rSym ); } m_bModified = true; @@ -260,9 +260,9 @@ void SmSymbolManager::Load() // now add a %i... symbol to the 'iGreek' set for every symbol found in the 'Greek' set. SmLocalizedSymbolData aLocalizedData; - const String aGreekSymbolSetName( aLocalizedData.GetUiSymbolSetName( OUString::createFromAscii( "Greek" ) )); + const OUString aGreekSymbolSetName(aLocalizedData.GetUiSymbolSetName(OUString("Greek"))); const SymbolPtrVec_t aGreekSymbols( GetSymbolSet( aGreekSymbolSetName ) ); - String aSymbolSetName = rtl::OUString('i'); + String aSymbolSetName = OUString('i'); aSymbolSetName += aGreekSymbolSetName; size_t nSymbols = aGreekSymbols.size(); for (size_t i = 0; i < nSymbols; ++i) @@ -272,7 +272,7 @@ void SmSymbolManager::Load() Font aFont( rSym.GetFace() ); OSL_ENSURE( aFont.GetItalic() == ITALIC_NONE, "expected Font with ITALIC_NONE, failed." ); aFont.SetItalic( ITALIC_NORMAL ); - String aSymbolName = rtl::OUString('i'); + String aSymbolName = OUString('i'); aSymbolName += rSym.GetName(); SmSym aSymbol( aSymbolName, aFont, rSym.GetCharacter(), aSymbolSetName, true /*bIsPredefined*/ ); @@ -289,8 +289,8 @@ void SmSymbolManager::Save() // prepare to skip symbols from iGreek on saving SmLocalizedSymbolData aLocalizedData; - String aSymbolSetName = rtl::OUString('i'); - aSymbolSetName += aLocalizedData.GetUiSymbolSetName( OUString::createFromAscii( "Greek" )); + OUString aSymbolSetName('i'); + aSymbolSetName += aLocalizedData.GetUiSymbolSetName(OUString("Greek")); SymbolPtrVec_t aTmp( GetSymbols() ); std::vector< SmSym > aSymbols; |