summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-04-06 08:26:35 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-04-06 22:40:48 +0100
commit121e715d9a6161842a69423f75be03a7bf39aa8d (patch)
treebb10bf8c7cb4b4f9be422a739ffe20cc2fb1e88b /sw/source
parentf5407c72f94117c9a172d1ac1466f5dea88a3a59 (diff)
optional argument is always provided
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/access/acchyperlink.cxx4
-rw-r--r--sw/source/ui/docvw/SidebarTxtControl.cxx2
-rw-r--r--sw/source/ui/docvw/edtwin.cxx2
-rw-r--r--sw/source/ui/docvw/romenu.cxx2
-rw-r--r--sw/source/ui/wrtsh/wrtsh2.cxx36
5 files changed, 21 insertions, 25 deletions
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,