[Libreoffice-commits] .: cui/source sfx2/source svl/inc svl/source svtools/source sw/source

Takeshi Abe tabe at kemper.freedesktop.org
Wed Feb 8 09:01:57 PST 2012


 cui/source/tabpages/macroass.cxx  |    2 +-
 sfx2/source/config/evntconf.cxx   |    2 +-
 svl/inc/svl/macitem.hxx           |   22 +++++++++++-----------
 svl/source/items/macitem.cxx      |   17 +++++++----------
 svtools/source/svhtml/htmlout.cxx |    2 +-
 sw/source/ui/dochdl/gloshdl.cxx   |    8 ++++----
 sw/source/ui/misc/glossary.cxx    |    4 ++--
 sw/source/ui/misc/glshell.cxx     |    6 +++---
 8 files changed, 30 insertions(+), 33 deletions(-)

New commits:
commit 9b979c8bf13593175391efcab461a146d6f1331e
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Thu Feb 9 01:50:21 2012 +0900

    Replaced String by rtl::OUString in SvxMacro

diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index abd7123..3128df1 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 5ae485b..4f693a1 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 2bc93a1..7261316 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 8406ca4..44abf85 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 3ba0590..3544a0d 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 401ae6b..13d2d2e 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 3ed816f..e292e5e 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 30fe58d..29644ee 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 );
     }
 


More information about the Libreoffice-commits mailing list