[Libreoffice-commits] core.git: Branch 'aoo/trunk' - svx/source
Armin Le Grand
alg at apache.org
Fri Feb 7 10:11:29 PST 2014
svx/source/dialog/hyprdlg.hxx | 1 -
svx/source/dialog/hyprlink.cxx | 22 ++++++++++++++++++----
2 files changed, 18 insertions(+), 5 deletions(-)
New commits:
commit a500e21d96e40159dd6969a3f494e8a10b571fed
Author: Armin Le Grand <alg at apache.org>
Date: Fri Feb 7 16:52:18 2014 +0000
i124197 allow URL Toolbar to send URLs to the app more than once
diff --git a/svx/source/dialog/hyprdlg.hxx b/svx/source/dialog/hyprdlg.hxx
index 35443bc..bee1b6d 100644
--- a/svx/source/dialog/hyprdlg.hxx
+++ b/svx/source/dialog/hyprdlg.hxx
@@ -93,7 +93,6 @@ private:
PopupMenu aLinkPopup;
PopupMenu *pTargetMenu;
sal_Bool bNoDoc;
- sal_Bool bSend;
sal_Bool bHasOldName;
long nMaxWidth;
long nMinWidth;
diff --git a/svx/source/dialog/hyprlink.cxx b/svx/source/dialog/hyprlink.cxx
index c166bd8..db68cf4 100644
--- a/svx/source/dialog/hyprlink.cxx
+++ b/svx/source/dialog/hyprlink.cxx
@@ -114,7 +114,6 @@ SvxHyperlinkDlg::SvxHyperlinkDlg( SfxBindings *_pBindings, Window* pParent) :
pTargetMenu ( NULL ),
bNoDoc ( sal_True ),
- bSend ( sal_False ),
bHasOldName ( sal_False ),
bHtmlMode ( sal_False )
@@ -344,8 +343,7 @@ IMPL_LINK( SvxHyperlinkDlg, TBClickHdl, ToolBox *, pBox )
{
case BTN_LINK:
{
- if (!bSend) // Link ins Dokument einfuegen
- SendToApp(HLINK_DEFAULT);
+ SendToApp(HLINK_DEFAULT);
}
break;
@@ -650,12 +648,23 @@ void SvxHyperlinkDlg::EnableLink()
void SvxHyperlinkDlg::SendToApp(sal_uInt16 nType)
{
+ static bool bAlreadyWorking(false);
+
+ if(bAlreadyWorking)
+ {
+ OSL_ENSURE(false, "SvxHyperlinkDlg::SendToApp called to potentially run recursively, please check (!)");
+ return;
+ }
+
+ bAlreadyWorking = true;
sal_Bool bIsFile = sal_False;
- bSend = sal_True;
String sURL( aUrlCB.GetText() );
if ( !sURL.Len() )
+ {
+ bAlreadyWorking = false;
return;
+ }
String aBase = GetBindings().GetDispatcher()->GetFrame()->GetObjectShell()->GetMedium()->GetBaseURL();
INetURLObject aObj( URIHelper::SmartRel2Abs( INetURLObject(aBase), sURL, URIHelper::GetMaybeFileHdl(), true, false,
@@ -674,7 +683,10 @@ void SvxHyperlinkDlg::SendToApp(sal_uInt16 nType)
LeaveWait();
QueryBox aBox( this, SVX_RES( RID_SVXQB_DONTEXIST ) );
if ( aBox.Execute() == RET_NO )
+ {
+ bAlreadyWorking = false;
return;
+ }
}
else
LeaveWait();
@@ -700,6 +712,8 @@ void SvxHyperlinkDlg::SendToApp(sal_uInt16 nType)
if ( sURL != aUrlCB.GetText() )
aUrlCB.SetText( sURL );
+
+ bAlreadyWorking = false;
}
/*--------------------------------------------------------------------
More information about the Libreoffice-commits
mailing list