diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-04-06 08:26:35 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-04-06 22:40:48 +0100 |
commit | 121e715d9a6161842a69423f75be03a7bf39aa8d (patch) | |
tree | bb10bf8c7cb4b4f9be422a739ffe20cc2fb1e88b /sw | |
parent | f5407c72f94117c9a172d1ac1466f5dea88a3a59 (diff) |
optional argument is always provided
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/swurl.hxx | 12 | ||||
-rw-r--r-- | sw/source/core/access/acchyperlink.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/docvw/SidebarTxtControl.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtwin.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/docvw/romenu.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/wrtsh/wrtsh2.cxx | 36 |
6 files changed, 24 insertions, 34 deletions
diff --git a/sw/inc/swurl.hxx b/sw/inc/swurl.hxx index 550e0850ba4e..beb9f256d5ad 100644 --- a/sw/inc/swurl.hxx +++ b/sw/inc/swurl.hxx @@ -28,21 +28,15 @@ #ifndef _SWURL_HXX #define _SWURL_HXX -#include <tools/solar.h> +#include <rtl/ustring.hxx> - -class UniString; class ViewShell; #define URLLOAD_NOFILTER 0x0000 #define URLLOAD_NEWVIEW 0x8000 - -void LoadURL( const UniString& rName, ViewShell* pSh, - sal_uInt16 nFilter = URLLOAD_NOFILTER, - const UniString *pTargetFrameName = 0 ); - - +void LoadURL( ViewShell& rSh, const rtl::OUString& rName, + sal_uInt16 nFilter, const rtl::OUString& rTargetFrameName ); #endif diff --git a/sw/source/core/access/acchyperlink.cxx b/sw/source/core/access/acchyperlink.cxx index 1fe57fa2b545..27f34947021c 100644 --- a/sw/source/core/access/acchyperlink.cxx +++ b/sw/source/core/access/acchyperlink.cxx @@ -90,8 +90,8 @@ sal_Bool SAL_CALL SwAccessibleHyperlink::doAccessibleAction( sal_Int32 nIndex ) ViewShell *pVSh = xPara->GetShell(); if( pVSh ) { - LoadURL( rINetFmt.GetValue(), pVSh, URLLOAD_NOFILTER, - &rINetFmt.GetTargetFrame() ); + LoadURL(*pVSh, rINetFmt.GetValue(), URLLOAD_NOFILTER, + rINetFmt.GetTargetFrame()); OSL_ENSURE( pTxtAttr == rINetFmt.GetTxtINetFmt(), "lost my txt attr" ); const SwTxtINetFmt* pTxtAttr2 = rINetFmt.GetTxtINetFmt(); diff --git a/sw/source/ui/docvw/SidebarTxtControl.cxx b/sw/source/ui/docvw/SidebarTxtControl.cxx index 5938a248b40b..95cc889c9cee 100644 --- a/sw/source/ui/docvw/SidebarTxtControl.cxx +++ b/sw/source/ui/docvw/SidebarTxtControl.cxx @@ -287,7 +287,7 @@ void SidebarTxtControl::MouseButtonDown( const MouseEvent& rMEvt ) SwWrtShell &rSh = mrDocView.GetWrtShell(); String sURL( pURL->GetURL() ); String sTarget( pURL->GetTargetFrame() ); - ::LoadURL( sURL, &rSh, URLLOAD_NOFILTER, &sTarget); + ::LoadURL(rSh, sURL, URLLOAD_NOFILTER, sTarget); return; } } diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index d56f9075f9f2..e6ae67870736 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -4263,7 +4263,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) { String sURL(pField->GetURL()); String sTarget(pField->GetTargetFrame()); - ::LoadURL( sURL, &rSh, nFilter, &sTarget); + ::LoadURL(rSh, sURL, nFilter, sTarget); } bCallShadowCrsr = sal_False; } diff --git a/sw/source/ui/docvw/romenu.cxx b/sw/source/ui/docvw/romenu.cxx index c6ac398e8feb..4db8c60b8d20 100644 --- a/sw/source/ui/docvw/romenu.cxx +++ b/sw/source/ui/docvw/romenu.cxx @@ -373,7 +373,7 @@ void SwReadOnlyPopup::Execute( Window* pWin, sal_uInt16 nId ) if( USHRT_MAX != nExecId ) rDis.GetBindings()->Execute( nExecId ); if( USHRT_MAX != nFilter ) - ::LoadURL( sURL, &rSh, nFilter, &sTargetFrameName); + ::LoadURL(rSh, sURL, nFilter, sTargetFrameName); if( pClipCntnr ) { diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx index 3d7264bfaf50..16196cc6b6e1 100644 --- a/sw/source/ui/wrtsh/wrtsh2.cxx +++ b/sw/source/ui/wrtsh/wrtsh2.cxx @@ -331,7 +331,7 @@ void SwWrtShell::ClickToINetAttr( const SwFmtINetFmt& rItem, sal_uInt16 nFilter } // damit die Vorlagenumsetzung sofort angezeigt wird - ::LoadURL( rItem.GetValue(), this, nFilter, &rItem.GetTargetFrame() ); + ::LoadURL( *this, rItem.GetValue(), nFilter, rItem.GetTargetFrame() ); const SwTxtINetFmt* pTxtAttr = rItem.GetTxtINetFmt(); if( pTxtAttr ) { @@ -362,35 +362,31 @@ sal_Bool SwWrtShell::ClickToINetGrf( const Point& rDocPt, sal_uInt16 nFilter ) GetDoc()->CallEvent( SFX_EVENT_MOUSECLICK_OBJECT, aCallEvent, sal_False ); } - ::LoadURL( sURL, this, nFilter, &sTargetFrameName); + ::LoadURL(*this, sURL, nFilter, sTargetFrameName); } return bRet; } -void LoadURL( const String& rURL, ViewShell* pVSh, sal_uInt16 nFilter, - const String *pTargetFrameName ) +void LoadURL( ViewShell& rVSh, const rtl::OUString& rURL, sal_uInt16 nFilter, + const rtl::OUString& rTargetFrameName ) { - OSL_ENSURE( rURL.Len() && pVSh, "what should be loaded here?" ); - if( !rURL.Len() || !pVSh ) + OSL_ENSURE( !rURL.isEmpty(), "what should be loaded here?" ); + if( rURL.isEmpty() ) return ; // die Shell kann auch 0 sein !!!!! - SwWrtShell *pSh = 0; - if ( pVSh && pVSh->ISA(SwCrsrShell) ) - { - //Eine CrsrShell ist auch immer eine WrtShell - pSh = (SwWrtShell*)pVSh; - } - else + if ( !rVSh.ISA(SwCrsrShell) ) return; - SwDocShell* pDShell = pSh->GetView().GetDocShell(); + //Eine CrsrShell ist auch immer eine WrtShell + SwWrtShell &rSh = (SwWrtShell&)rVSh; + + SwDocShell* pDShell = rSh.GetView().GetDocShell(); OSL_ENSURE( pDShell, "No DocShell?!"); - String sTargetFrame; - if( pTargetFrameName && pTargetFrameName->Len() ) - sTargetFrame = *pTargetFrameName; - else if( pDShell ) { + rtl::OUString sTargetFrame(rTargetFrameName); + if (sTargetFrame.isEmpty() && pDShell) + { using namespace ::com::sun::star; uno::Reference<document::XDocumentPropertiesSupplier> xDPS( pDShell->GetModel(), uno::UNO_QUERY_THROW); @@ -402,7 +398,7 @@ void LoadURL( const String& rURL, ViewShell* pVSh, sal_uInt16 nFilter, String sReferer; if( pDShell && pDShell->GetMedium() ) sReferer = pDShell->GetMedium()->GetName(); - SfxViewFrame* pViewFrm = pSh->GetView().GetViewFrame(); + SfxViewFrame* pViewFrm = rSh.GetView().GetViewFrame(); SfxFrameItem aView( SID_DOCFRAME, pViewFrm ); SfxStringItem aName( SID_FILE_NAME, rURL ); SfxStringItem aTargetFrameName( SID_TARGETNAME, sTargetFrame ); @@ -413,7 +409,7 @@ void LoadURL( const String& rURL, ViewShell* pVSh, sal_uInt16 nFilter, SfxBoolItem aBrowse( SID_BROWSE, sal_True ); if( nFilter & URLLOAD_NEWVIEW ) - aTargetFrameName.SetValue( String::CreateFromAscii("_blank") ); + aTargetFrameName.SetValue( rtl::OUString("_blank") ); const SfxPoolItem* aArr[] = { &aName, |