summaryrefslogtreecommitdiff
path: root/sw/source/ui/shells/textfld.cxx
diff options
context:
space:
mode:
authorHans-Joachim Lankenau <hjs@openoffice.org>2003-09-25 09:51:18 +0000
committerHans-Joachim Lankenau <hjs@openoffice.org>2003-09-25 09:51:18 +0000
commitefcee2baa32446a36bb8ae4191591bf575771b5b (patch)
treefd11c52422f637a16e9e3a223e418b5892a52e21 /sw/source/ui/shells/textfld.cxx
parent6f697ed0a591c35f5e5703d40fefb7f922cd1597 (diff)
INTEGRATION: CWS os20 (1.20.2); FILE MERGED
2003/09/15 08:56:19 os 1.20.2.1: #i13094# replace existing URL with button instead of simply adding the button
Diffstat (limited to 'sw/source/ui/shells/textfld.cxx')
-rw-r--r--sw/source/ui/shells/textfld.cxx34
1 files changed, 18 insertions, 16 deletions
diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx
index 6b76ac6b74d1..81dc44d327b5 100644
--- a/sw/source/ui/shells/textfld.cxx
+++ b/sw/source/ui/shells/textfld.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: textfld.cxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: obo $ $Date: 2003-09-04 11:49:32 $
+ * last change: $Author: hjs $ $Date: 2003-09-25 10:51:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -821,24 +821,23 @@ void SwTextShell::InsertHyperlink(const SvxHyperlinkItem& rHlnkItem)
if( rSh.GetSelectionType() & SwWrtShell::SEL_TXT )
{
+ rSh.StartAction();
+ SfxItemSet aSet(GetPool(), RES_TXTATR_INETFMT, RES_TXTATR_INETFMT);
+ rSh.GetAttr( aSet );
+
+ const SfxPoolItem* pItem;
+ if(SFX_ITEM_SET == aSet.GetItemState(RES_TXTATR_INETFMT, FALSE, &pItem))
+ {
+ const SwFmtINetFmt* pINetFmt = (const SwFmtINetFmt*)pItem;
+
+ // Links selektieren
+ rSh.SwCrsrShell::SelectTxtAttr(RES_TXTATR_INETFMT);
+ }
switch (nType)
{
case HLINK_DEFAULT:
case HLINK_FIELD:
{
- rSh.StartAction();
- BOOL bSel = rSh.HasSelection();
- SfxItemSet aSet(GetPool(), RES_TXTATR_INETFMT, RES_TXTATR_INETFMT);
- rSh.GetAttr( aSet );
-
- const SfxPoolItem* pItem;
- if(SFX_ITEM_SET == aSet.GetItemState(RES_TXTATR_INETFMT, FALSE, &pItem))
- {
- const SwFmtINetFmt* pINetFmt = (const SwFmtINetFmt*)pItem;
-
- // Links selektieren
- rSh.SwCrsrShell::SelectTxtAttr(RES_TXTATR_INETFMT);
- }
SwFmtINetFmt aINetFmt( rURL, rTarget );
aINetFmt.SetName(rHlnkItem.GetIntName());
if(pMacroTbl)
@@ -856,15 +855,18 @@ void SwTextShell::InsertHyperlink(const SvxHyperlinkItem& rHlnkItem)
rSh.SttSelect();
rSh.InsertURL( aINetFmt, rName, TRUE );
rSh.EndSelect();
- rSh.EndAction();
}
break;
case HLINK_BUTTON:
+ BOOL bSel = rSh.HasSelection();
+ if(bSel)
+ rSh.DelRight();
InsertURLButton( rURL, rTarget, rName );
rSh.EnterStdMode();
break;
}
+ rSh.EndAction();
}
}