diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2013-08-24 19:00:32 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2013-08-25 11:49:22 +0000 |
commit | 4a386c42f03bdb1896cbdd9391e2c4e1841dd5b6 (patch) | |
tree | 3a1b6b1b0cb459085f1d1ad3f7574566d59560e5 | |
parent | bb2478664bb88d3430f02d2cbcb6d18d60eab412 (diff) |
String to OUString
Change-Id: I7aa1eda2689081aea624f1de64380322ed2fd0fa
Reviewed-on: https://gerrit.libreoffice.org/5620
Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
Tested-by: Matteo Casalin <matteo.casalin@yahoo.com>
-rw-r--r-- | sw/inc/doc.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docbasic.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtwin.cxx | 9 | ||||
-rw-r--r-- | sw/source/ui/inc/wrtsh.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/wrtsh/wrtsh2.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/wrtsh/wrtsh3.cxx | 2 |
6 files changed, 11 insertions, 10 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 58bd8aa6ab67..16c7b2c0d1ba 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 e14604c133ad..15fcf5ff3950 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 ddeafd405839..eae062e33265 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 10303281a7aa..2b38eac3465e 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 3d392df2dd8b..2e91b1368cd1 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 fd4c89493b02..d8b8bbfea5d7 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() ) |