summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/swurl.hxx12
-rw-r--r--sw/source/core/access/acchyperlink.cxx2
-rw-r--r--sw/source/core/access/accnotexthyperlink.cxx4
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControl.cxx2
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx4
-rw-r--r--sw/source/uibase/docvw/romenu.cxx9
-rw-r--r--sw/source/uibase/inc/wrtsh.hxx4
-rw-r--r--sw/source/uibase/wrtsh/wrtsh2.cxx8
8 files changed, 26 insertions, 19 deletions
diff --git a/sw/inc/swurl.hxx b/sw/inc/swurl.hxx
index 875ca28706fc..87375f30c8b7 100644
--- a/sw/inc/swurl.hxx
+++ b/sw/inc/swurl.hxx
@@ -20,14 +20,20 @@
#define INCLUDED_SW_INC_SWURL_HXX
#include <rtl/ustring.hxx>
+#include <o3tl/typed_flags_set.hxx>
class SwViewShell;
-#define URLLOAD_NOFILTER 0x0000
-#define URLLOAD_NEWVIEW 0x8000
+enum class LoadUrlFlags {
+ NONE = 0x00,
+ NewView = 0x01
+};
+namespace o3tl {
+ template<> struct typed_flags<LoadUrlFlags> : is_typed_flags<LoadUrlFlags, 0x01> {};
+}
void LoadURL( SwViewShell& rSh, const OUString& rName,
- sal_uInt16 nFilter, const OUString& rTargetFrameName );
+ LoadUrlFlags nFilter, const OUString& rTargetFrameName );
#endif
diff --git a/sw/source/core/access/acchyperlink.cxx b/sw/source/core/access/acchyperlink.cxx
index 6a330c78b017..a62075282611 100644
--- a/sw/source/core/access/acchyperlink.cxx
+++ b/sw/source/core/access/acchyperlink.cxx
@@ -86,7 +86,7 @@ sal_Bool SAL_CALL SwAccessibleHyperlink::doAccessibleAction( sal_Int32 nIndex )
SwViewShell *pVSh = xPara->GetShell();
if( pVSh )
{
- LoadURL(*pVSh, rINetFormat.GetValue(), URLLOAD_NOFILTER,
+ LoadURL(*pVSh, rINetFormat.GetValue(), LoadUrlFlags::NONE,
rINetFormat.GetTargetFrame());
OSL_ENSURE( pTextAttr == rINetFormat.GetTextINetFormat(),
"lost my txt attr" );
diff --git a/sw/source/core/access/accnotexthyperlink.cxx b/sw/source/core/access/accnotexthyperlink.cxx
index 161fac1af043..d1aebb9cc33c 100644
--- a/sw/source/core/access/accnotexthyperlink.cxx
+++ b/sw/source/core/access/accnotexthyperlink.cxx
@@ -82,7 +82,7 @@ sal_Bool SAL_CALL SwAccessibleNoTextHyperlink::doAccessibleAction( sal_Int32 nIn
SwViewShell *pVSh = xFrame->GetShell();
if( pVSh )
{
- LoadURL( *pVSh, pMapObj->GetURL(), URLLOAD_NOFILTER,
+ LoadURL( *pVSh, pMapObj->GetURL(), LoadUrlFlags::NONE,
pMapObj->GetTarget() );
bRet = true;
}
@@ -93,7 +93,7 @@ sal_Bool SAL_CALL SwAccessibleNoTextHyperlink::doAccessibleAction( sal_Int32 nIn
SwViewShell *pVSh = xFrame->GetShell();
if( pVSh )
{
- LoadURL( *pVSh, aURL.GetURL(), URLLOAD_NOFILTER,
+ LoadURL( *pVSh, aURL.GetURL(), LoadUrlFlags::NONE,
aURL.GetTargetFrameName() );
bRet = true;
}
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx
index 5ec2a0580d8a..8609b540ce9f 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -341,7 +341,7 @@ void SidebarTextControl::MouseButtonDown( const MouseEvent& rMEvt )
SwWrtShell &rSh = mrDocView.GetWrtShell();
OUString sURL( pURL->GetURL() );
OUString sTarget( pURL->GetTargetFrame() );
- ::LoadURL(rSh, sURL, URLLOAD_NOFILTER, sTarget);
+ ::LoadURL(rSh, sURL, LoadUrlFlags::NONE, sTarget);
return;
}
}
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index e8665d2466a7..8899e5bbfd61 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -4613,9 +4613,9 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
// Internetfield? --> call link (load doc!!)
if( !bInSel )
{
- sal_uInt16 nFilter = URLLOAD_NOFILTER;
+ LoadUrlFlags nFilter = LoadUrlFlags::NONE;
if( KEY_MOD1 == rMEvt.GetModifier() )
- nFilter |= URLLOAD_NEWVIEW;
+ nFilter |= LoadUrlFlags::NewView;
bool bExecHyperlinks = m_rView.GetDocShell()->IsReadOnly();
if ( !bExecHyperlinks )
diff --git a/sw/source/uibase/docvw/romenu.cxx b/sw/source/uibase/docvw/romenu.cxx
index 11a4e301e8ae..482d7949a08e 100644
--- a/sw/source/uibase/docvw/romenu.cxx
+++ b/sw/source/uibase/docvw/romenu.cxx
@@ -265,12 +265,13 @@ void SwReadOnlyPopup::Execute( vcl::Window* pWin, sal_uInt16 nId )
TransferDataContainer* pClipCntnr = nullptr;
sal_uInt16 nExecId = USHRT_MAX;
- sal_uInt16 nFilter = USHRT_MAX;
+ bool bFilterSet = false;
+ LoadUrlFlags nFilter;
switch( nId )
{
case SID_WIN_FULLSCREEN : nExecId = SID_WIN_FULLSCREEN; break;
- case MN_READONLY_OPENURL: nFilter = URLLOAD_NOFILTER; break;
- case MN_READONLY_OPENURLNEW: nFilter = URLLOAD_NEWVIEW; break;
+ case MN_READONLY_OPENURL: nFilter = LoadUrlFlags::NONE; bFilterSet = true; break;
+ case MN_READONLY_OPENURLNEW: nFilter = LoadUrlFlags::NewView; bFilterSet = true; break;
case MN_READONLY_COPY: nExecId = SID_COPY; break;
case MN_READONLY_EDITDOC: nExecId = SID_EDITDOC; break;
@@ -327,7 +328,7 @@ void SwReadOnlyPopup::Execute( vcl::Window* pWin, sal_uInt16 nId )
}
if( USHRT_MAX != nExecId )
rDis.GetBindings()->Execute( nExecId );
- if( USHRT_MAX != nFilter )
+ if( bFilterSet )
::LoadURL(rSh, sURL, nFilter, sTargetFrameName);
if( pClipCntnr )
diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx
index f3aaaaceb027..c3b63ef2d03e 100644
--- a/sw/source/uibase/inc/wrtsh.hxx
+++ b/sw/source/uibase/inc/wrtsh.hxx
@@ -420,8 +420,8 @@ typedef bool (SwWrtShell:: *FNSimpleMove)();
// a click at the given field. the cursor is on it.
// execute the predefined actions.
void ClickToField( const SwField& rField );
- void ClickToINetAttr( const SwFormatINetFormat& rItem, sal_uInt16 nFilter = URLLOAD_NOFILTER );
- bool ClickToINetGrf( const Point& rDocPt, sal_uInt16 nFilter );
+ void ClickToINetAttr( const SwFormatINetFormat& rItem, LoadUrlFlags nFilter = LoadUrlFlags::NONE );
+ bool ClickToINetGrf( const Point& rDocPt, LoadUrlFlags nFilter );
inline bool IsInClickToEdit() const ;
// if a URL-Button is selected, return its URL; otherwise an empty string
diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx
index ac17db298931..a8c22d3a1981 100644
--- a/sw/source/uibase/wrtsh/wrtsh2.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh2.cxx
@@ -408,7 +408,7 @@ void SwWrtShell::ClickToField( const SwField& rField )
m_bIsInClickToEdit = false;
}
-void SwWrtShell::ClickToINetAttr( const SwFormatINetFormat& rItem, sal_uInt16 nFilter )
+void SwWrtShell::ClickToINetAttr( const SwFormatINetFormat& rItem, LoadUrlFlags nFilter )
{
if( rItem.GetValue().isEmpty() )
return ;
@@ -436,7 +436,7 @@ void SwWrtShell::ClickToINetAttr( const SwFormatINetFormat& rItem, sal_uInt16 nF
m_bIsInClickToEdit = false;
}
-bool SwWrtShell::ClickToINetGrf( const Point& rDocPt, sal_uInt16 nFilter )
+bool SwWrtShell::ClickToINetGrf( const Point& rDocPt, LoadUrlFlags nFilter )
{
bool bRet = false;
OUString sURL;
@@ -459,7 +459,7 @@ bool SwWrtShell::ClickToINetGrf( const Point& rDocPt, sal_uInt16 nFilter )
return bRet;
}
-void LoadURL( SwViewShell& rVSh, const OUString& rURL, sal_uInt16 nFilter,
+void LoadURL( SwViewShell& rVSh, const OUString& rURL, LoadUrlFlags nFilter,
const OUString& rTargetFrameName )
{
OSL_ENSURE( !rURL.isEmpty(), "what should be loaded here?" );
@@ -506,7 +506,7 @@ void LoadURL( SwViewShell& rVSh, const OUString& rURL, sal_uInt16 nFilter,
//#39076# Silent can be removed accordingly to SFX.
SfxBoolItem aBrowse( SID_BROWSE, true );
- if( nFilter & URLLOAD_NEWVIEW )
+ if( nFilter & LoadUrlFlags::NewView )
aTargetFrameName.SetValue( "_blank" );
const SfxPoolItem* aArr[] = {