[Libreoffice-commits] core.git: sw/inc sw/source

Matteo Casalin matteo.casalin at yahoo.com
Sun Aug 25 04:49:48 PDT 2013


 sw/inc/doc.hxx                  |    2 +-
 sw/source/core/doc/docbasic.cxx |    2 +-
 sw/source/ui/docvw/edtwin.cxx   |    9 +++++----
 sw/source/ui/inc/wrtsh.hxx      |    2 +-
 sw/source/ui/wrtsh/wrtsh2.cxx   |    4 ++--
 sw/source/ui/wrtsh/wrtsh3.cxx   |    2 +-
 6 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit 4a386c42f03bdb1896cbdd9391e2c4e1841dd5b6
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Aug 24 19:00:32 2013 +0200

    String to OUString
    
    Change-Id: I7aa1eda2689081aea624f1de64380322ed2fd0fa
    Reviewed-on: https://gerrit.libreoffice.org/5620
    Reviewed-by: Matteo Casalin <matteo.casalin at yahoo.com>
    Tested-by: Matteo Casalin <matteo.casalin at yahoo.com>

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 58bd8aa..16c7b2c 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -1812,7 +1812,7 @@ public:
     const SwFmtINetFmt* FindINetAttr( const OUString& rName ) const;
 
     /// Call into intransparent Basic; expect possible Return String.
-    bool ExecMacro( const SvxMacro& rMacro, String* pRet = 0, SbxArray* pArgs = 0 );
+    bool ExecMacro( const SvxMacro& rMacro, OUString* pRet = 0, SbxArray* pArgs = 0 );
 
     /// Call into intransparent Basic / JavaScript.
     sal_uInt16 CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent,
diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx
index e14604c..15fcf5f 100644
--- a/sw/source/core/doc/docbasic.cxx
+++ b/sw/source/core/doc/docbasic.cxx
@@ -71,7 +71,7 @@ static Sequence<Any> *lcl_docbasic_convertArgs( SbxArray& rArgs )
     return pRet;
 }
 
-bool SwDoc::ExecMacro( const SvxMacro& rMacro, String* pRet, SbxArray* pArgs )
+bool SwDoc::ExecMacro( const SvxMacro& rMacro, OUString* pRet, SbxArray* pArgs )
 {
     ErrCode eErr = 0;
     switch( rMacro.GetScriptType() )
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index ddeafd4..eae062e 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -1475,7 +1475,6 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
         const SvxMacro* pMacro = pFlyFmt->GetMacro().GetMacroTable().Get( nEvent );
         if( pMacro )
         {
-            String sRet;
             SbxArrayRef xArgs = new SbxArray;
             SbxVariableRef xVar = new SbxVariable;
             xVar->PutString( pFlyFmt->GetName() );
@@ -1488,8 +1487,9 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
                 xVar->PutUShort( rKeyCode.GetModifier() | rKeyCode.GetCode() );
             xArgs->Put( &xVar, 2 );
 
+            OUString sRet;
             rSh.ExecMacro( *pMacro, &sRet, &xArgs );
-            if( sRet.Len() && 0 != sRet.ToInt32() )
+            if( !sRet.isEmpty() && sRet.toInt32()!=0 )
                 return ;
         }
     }
@@ -3882,7 +3882,6 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
                         {
                             m_aRszMvHdlPt = aDocPt;
                             sal_uInt16 nPos = 0;
-                            String sRet;
                             SbxArrayRef xArgs = new SbxArray;
                             SbxVariableRef xVar = new SbxVariable;
                             xVar->PutString( pFlyFmt->GetName() );
@@ -3902,13 +3901,15 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
                             xVar->PutLong( aDocPt.Y() - aSttPt.Y() );
                             xArgs->Put( &xVar, ++nPos );
 
+                            OUString sRet;
+
                             ReleaseMouse();
 
                             rSh.ExecMacro( *pMacro, &sRet, &xArgs );
 
                             CaptureMouse();
 
-                            if( sRet.Len() && 0 != sRet.ToInt32() )
+                            if( !sRet.isEmpty() && sRet.toInt32()!=0 )
                                 return ;
                         }
                     }
diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx
index 1030328..2b38eac 100644
--- a/sw/source/ui/inc/wrtsh.hxx
+++ b/sw/source/ui/inc/wrtsh.hxx
@@ -414,7 +414,7 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
     SwView&             GetView() { return rView; }
 
     // Because nobody else is doing it, here is a ExecMacro()
-    void ExecMacro( const SvxMacro& rMacro, String* pRet = 0, SbxArray* pArgs = 0 );
+    void ExecMacro( const SvxMacro& rMacro, OUString* pRet = 0, SbxArray* pArgs = 0 );
     // call into the dark Basic/JavaScript
     sal_uInt16 CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent,
                         bool bCheckPtr = false, SbxArray* pArgs = 0,
diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx
index 3d392df..2e91b13 100644
--- a/sw/source/ui/wrtsh/wrtsh2.cxx
+++ b/sw/source/ui/wrtsh/wrtsh2.cxx
@@ -264,8 +264,8 @@ void SwWrtShell::ClickToField( const SwField& rFld )
     case RES_MACROFLD:
         {
             const SwMacroField *pFld = (const SwMacroField*)&rFld;
-            String sText( rFld.GetPar2() );
-            String sRet( sText );
+            const OUString sText( rFld.GetPar2() );
+            OUString sRet( sText );
             ExecMacro( pFld->GetSvxMacro(), &sRet );
 
             // return value changed?
diff --git a/sw/source/ui/wrtsh/wrtsh3.cxx b/sw/source/ui/wrtsh/wrtsh3.cxx
index fd4c894..d8b8bbf 100644
--- a/sw/source/ui/wrtsh/wrtsh3.cxx
+++ b/sw/source/ui/wrtsh/wrtsh3.cxx
@@ -149,7 +149,7 @@ sal_Bool SwWrtShell::GoPrevBookmark()
     return MoveBookMark( BOOKMARK_PREV );
 }
 
-void SwWrtShell::ExecMacro( const SvxMacro& rMacro, String* pRet, SbxArray* pArgs )
+void SwWrtShell::ExecMacro( const SvxMacro& rMacro, OUString* pRet, SbxArray* pArgs )
 {
     // OD 11.02.2003 #100556# - execute macro, if it is allowed.
     if ( IsMacroExecAllowed() )


More information about the Libreoffice-commits mailing list