diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2012-02-09 01:50:21 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2012-02-09 02:01:45 +0900 |
commit | 9b979c8bf13593175391efcab461a146d6f1331e (patch) | |
tree | 84f91da7d847d5e95e502432611ced55e3cb3a29 | |
parent | 62e8dfa072d78c18464db9a43ffc3f7b287032b2 (diff) |
Replaced String by rtl::OUString in SvxMacro
-rw-r--r-- | cui/source/tabpages/macroass.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/config/evntconf.cxx | 2 | ||||
-rw-r--r-- | svl/inc/svl/macitem.hxx | 22 | ||||
-rw-r--r-- | svl/source/items/macitem.cxx | 17 | ||||
-rw-r--r-- | svtools/source/svhtml/htmlout.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dochdl/gloshdl.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/misc/glossary.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/misc/glshell.cxx | 6 |
8 files changed, 30 insertions, 33 deletions
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx index abd712328aa7..3128df1ec49c 100644 --- a/cui/source/tabpages/macroass.cxx +++ b/cui/source/tabpages/macroass.cxx @@ -131,7 +131,7 @@ String ConvertToUIName_Impl( SvxMacro *pMacro ) { String aName( pMacro->GetMacName() ); String aEntry; - if ( ! pMacro->GetLanguage().EqualsAscii("JavaScript") ) + if ( ! pMacro->GetLanguage().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("JavaScript")) ) { sal_uInt16 nCount = comphelper::string::getTokenCount(aName, '.'); aEntry = aName.GetToken( nCount-1, '.' ); diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx index 5ae485b46b20..4f693a1bb269 100644 --- a/sfx2/source/config/evntconf.cxx +++ b/sfx2/source/config/evntconf.cxx @@ -274,7 +274,7 @@ void PropagateEvent_Impl( SfxObjectShell *pDoc, rtl::OUString aEventName, const void SfxEventConfiguration::ConfigureEvent( rtl::OUString aName, const SvxMacro& rMacro, SfxObjectShell *pDoc ) { boost::scoped_ptr<SvxMacro> pMacro; - if ( rMacro.GetMacName().Len() ) + if ( rMacro.HasMacro() ) pMacro.reset( new SvxMacro( rMacro.GetMacName(), rMacro.GetLibName(), rMacro.GetScriptType() ) ); PropagateEvent_Impl( pDoc ? pDoc : 0, aName, pMacro.get() ); } diff --git a/svl/inc/svl/macitem.hxx b/svl/inc/svl/macitem.hxx index 2bc93a177539..7261316ee7dc 100644 --- a/svl/inc/svl/macitem.hxx +++ b/svl/inc/svl/macitem.hxx @@ -70,29 +70,29 @@ class SjJSbxObject; class SVL_DLLPUBLIC SvxMacro { - String aMacName; - String aLibName; + ::rtl::OUString aMacName; + ::rtl::OUString aLibName; // Fuer JavaScript muss ein Function-Objekt gehalten werden SjJSbxObjectBase* pFunctionObject; ScriptType eType; public: - SvxMacro( const String &rMacName, const String &rLanguage); + SvxMacro( const ::rtl::OUString &rMacName, const ::rtl::OUString &rLanguage); - SvxMacro( const String &rMacName, const String &rLibName, + SvxMacro( const ::rtl::OUString &rMacName, const ::rtl::OUString &rLibName, ScriptType eType); // = STARBASIC entfernt - SvxMacro( SjJSbxObjectBase* _pFunctionObject, const String &rSource ); + SvxMacro( SjJSbxObjectBase* _pFunctionObject, const ::rtl::OUString &rSource ); ~SvxMacro(); // noetig fuer pFunctionObject - const String &GetLibName() const { return aLibName; } - const String &GetMacName() const { return aMacName; } - String GetLanguage()const; + const ::rtl::OUString &GetLibName() const { return aLibName; } + const ::rtl::OUString &GetMacName() const { return aMacName; } + ::rtl::OUString GetLanguage()const; ScriptType GetScriptType() const { return eType; } - sal_Bool HasMacro() const { return aMacName.Len() ? sal_True : sal_False; } + bool HasMacro() const { return !aMacName.isEmpty(); } #ifdef SOLAR_JAVA // JavaScript-Function-Objekt holen @@ -103,12 +103,12 @@ public: SvxMacro& operator=( const SvxMacro& rBase ); }; -inline SvxMacro::SvxMacro( const String &rMacName, const String &rLibName, +inline SvxMacro::SvxMacro( const ::rtl::OUString &rMacName, const ::rtl::OUString &rLibName, ScriptType eTyp ) : aMacName( rMacName ), aLibName( rLibName ), pFunctionObject(NULL), eType( eTyp ) {} -inline SvxMacro::SvxMacro( SjJSbxObjectBase* _pFunctionObject, const String &rSource ) +inline SvxMacro::SvxMacro( SjJSbxObjectBase* _pFunctionObject, const ::rtl::OUString &rSource ) : aMacName( rSource ), pFunctionObject( _pFunctionObject ), eType( JAVASCRIPT ) {} diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx index 8406ca4926b8..44abf8589217 100644 --- a/svl/source/items/macitem.cxx +++ b/svl/source/items/macitem.cxx @@ -50,13 +50,13 @@ SjJSbxObjectBase* SjJSbxObjectBase::Clone( void ) return NULL; } -SvxMacro::SvxMacro( const String &rMacName, const String &rLanguage) +SvxMacro::SvxMacro( const ::rtl::OUString &rMacName, const ::rtl::OUString &rLanguage) : aMacName( rMacName ), aLibName( rLanguage), pFunctionObject(NULL), eType( EXTENDED_STYPE) { - if (rLanguage.EqualsAscii(SVX_MACRO_LANGUAGE_STARBASIC)) + if (rLanguage.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SVX_MACRO_LANGUAGE_STARBASIC))) eType=STARBASIC; - else if (rLanguage.EqualsAscii(SVX_MACRO_LANGUAGE_JAVASCRIPT)) + else if (rLanguage.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SVX_MACRO_LANGUAGE_JAVASCRIPT))) eType=JAVASCRIPT; } @@ -66,22 +66,19 @@ SvxMacro::~SvxMacro() delete pFunctionObject; } -String SvxMacro::GetLanguage()const +::rtl::OUString SvxMacro::GetLanguage()const { if(eType==STARBASIC) { - return UniString::CreateFromAscii( - RTL_CONSTASCII_STRINGPARAM(SVX_MACRO_LANGUAGE_STARBASIC)); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SVX_MACRO_LANGUAGE_STARBASIC)); } else if(eType==JAVASCRIPT) { - return UniString::CreateFromAscii( - RTL_CONSTASCII_STRINGPARAM(SVX_MACRO_LANGUAGE_JAVASCRIPT)); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SVX_MACRO_LANGUAGE_JAVASCRIPT)); } else if(eType==EXTENDED_STYPE) { - return UniString::CreateFromAscii( - RTL_CONSTASCII_STRINGPARAM(SVX_MACRO_LANGUAGE_SF)); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SVX_MACRO_LANGUAGE_SF)); } return aLibName; diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index 3ba059030387..3544a0dd5c5a 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -917,7 +917,7 @@ SvStream& HTMLOutFuncs::Out_Events( SvStream& rStrm, const SvxMacro *pMacro = rMacroTable.Get( pEventTable[i].nEvent ); - if( pMacro && pMacro->GetMacName().Len() && + if( pMacro && pMacro->HasMacro() && ( JAVASCRIPT == pMacro->GetScriptType() || bOutStarBasic )) { const sal_Char *pStr = STARBASIC == pMacro->GetScriptType() diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx index 401ae6b8c2ea..13d2d2ea2964 100644 --- a/sw/source/ui/dochdl/gloshdl.cxx +++ b/sw/source/ui/dochdl/gloshdl.cxx @@ -544,7 +544,7 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName, // API-programs would hang. // Moreover the event macro must also not be called in an action pWrtShell->StartUndo(UNDO_INSGLOSSARY); - if( aStartMacro.GetMacName().Len() ) + if( aStartMacro.HasMacro() ) pWrtShell->ExecMacro( aStartMacro ); if(pWrtShell->HasSelection()) pWrtShell->DelLeft(); @@ -555,7 +555,7 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName, pWrtShell->InsertGlossary(*pGlossary, aShortName); pWrtShell->EndAllAction(); - if( aEndMacro.GetMacName().Len() ) + if( aEndMacro.HasMacro() ) { pWrtShell->ExecMacro( aEndMacro ); } @@ -590,7 +590,7 @@ sal_Bool SwGlossaryHdl::InsertGlossary(const String &rName) // otherwise the possible Shell change gets delayed and // API-programs would hang. // Moreover the event macro must also not be called in an action - if( aStartMacro.GetMacName().Len() ) + if( aStartMacro.HasMacro() ) pWrtShell->ExecMacro( aStartMacro ); if( pWrtShell->HasSelection() ) pWrtShell->DelRight(); @@ -601,7 +601,7 @@ sal_Bool SwGlossaryHdl::InsertGlossary(const String &rName) pWrtShell->InsertGlossary(*pGlos, rName); pWrtShell->EndAllAction(); - if( aEndMacro.GetMacName().Len() ) + if( aEndMacro.HasMacro() ) { pWrtShell->ExecMacro( aEndMacro ); } diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 3ed816f8defd..e292e5ec73f1 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -585,9 +585,9 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn ) pGlossaryHdl->GetMacros(aShortNameEdit.GetText(), aStart, aEnd ); SvxMacroItem aItem(RES_FRMMACRO); - if( aStart.GetMacName().Len() ) + if( aStart.HasMacro() ) aItem.SetMacro( SW_EVENT_START_INS_GLOSSARY, aStart ); - if( aEnd.GetMacName().Len() ) + if( aEnd.HasMacro() ) aItem.SetMacro( SW_EVENT_END_INS_GLOSSARY, aEnd ); aSet.Put( aItem ); diff --git a/sw/source/ui/misc/glshell.cxx b/sw/source/ui/misc/glshell.cxx index 30fe58dd4e76..29644eecefaf 100644 --- a/sw/source/ui/misc/glshell.cxx +++ b/sw/source/ui/misc/glshell.cxx @@ -121,10 +121,10 @@ sal_Bool lcl_Save( SwWrtShell& rSh, const String& rGroupName, rCfg.IsSaveRelFile(), pBlock->IsOnlyTextBlock( rShortNm ) ); - if(aStart.GetMacName().Len() || aEnd.GetMacName().Len() ) + if(aStart.HasMacro() || aEnd.HasMacro() ) { - SvxMacro* pStart = aStart.GetMacName().Len() ? &aStart : 0; - SvxMacro* pEnd = aEnd.GetMacName().Len() ? &aEnd : 0; + SvxMacro* pStart = aStart.HasMacro() ? &aStart : 0; + SvxMacro* pEnd = aEnd.HasMacro() ? &aEnd : 0; pGlosHdl->SetMacros( rShortNm, pStart, pEnd, pBlock ); } |