[ooo-build] [PATCH 1/2] sw: show 'Remove Hyperlink' even with selection

Octavio Alvarez alvarezp at alvarezp.ods.org
Wed Mar 3 09:41:07 PST 2010


Currently, the 'Remove Hyperlink' context menu is only shown
when directly clicking a hyperlink. However, it should be
shown also when selecting any text that contains one or more
hyperlinks.

* patches/dev300/apply:
* patches/dev300/sw-show-Remove-Hyperlink-even-with-selection.diff:
   in func: SwTextShell::GetState(...)
      it separates case FN_REMOVE_HYPERLINK.

Signed-off-by: Octavio Alvarez <alvarezp at alvarezp.ods.org>
---
 patches/dev300/apply                               |    3 ++
 ...-show-Remove-Hyperlink-even-with-selection.diff |   33 ++++++++++++++++++++
 2 files changed, 36 insertions(+), 0 deletions(-)
 create mode 100644 patches/dev300/sw-show-Remove-Hyperlink-even-with-selection.diff

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 78bcdfa..ae38b83 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -643,6 +643,9 @@ sw-ww8-field-fix.diff, i#61075, i#89667, cbosdo
 sw-uno-fix.diff, i#108426, cbosdo
 
 [ WriterFixes ]
+# Added by Octavio Alvarez <alvarezp at alvarezp.ods.org>
+sw-show-Remove-Hyperlink-even-with-selection.diff, alvarezp2000
+
 # Refresh the cell formatting after pasting in it
 sw-paste-table.diff, n#564789, cbosdo
 
diff --git a/patches/dev300/sw-show-Remove-Hyperlink-even-with-selection.diff b/patches/dev300/sw-show-Remove-Hyperlink-even-with-selection.diff
new file mode 100644
index 0000000..c3d92f8
--- /dev/null
+++ b/patches/dev300/sw-show-Remove-Hyperlink-even-with-selection.diff
@@ -0,0 +1,33 @@
+diff --git sw/source/ui/shells/textsh1.cxx sw/source/ui/shells/textsh1.cxx
+index e9f7dcd..570d561 100644
+--- sw/source/ui/shells/textsh1.cxx
++++ sw/source/ui/shells/textsh1.cxx
+@@ -1544,7 +1544,6 @@ void SwTextShell::GetState( SfxItemSet &rSet )
+                                 GetViewFrame()->GetChildWindow( nWhich ) ));
+                 break;
+             case FN_EDIT_HYPERLINK:
+-            case FN_REMOVE_HYPERLINK:
+             case FN_COPY_HYPERLINK_LOCATION:
+             {
+                 SfxItemSet aSet(GetPool(),
+@@ -1557,6 +1556,20 @@ void SwTextShell::GetState( SfxItemSet &rSet )
+                 }
+             }
+             break;
++            case FN_REMOVE_HYPERLINK:
++            {
++                SfxItemSet aSet(GetPool(),
++                                RES_TXTATR_INETFMT,
++                                RES_TXTATR_INETFMT);
++                rSh.GetCurAttr(aSet);
++
++		// If a hyperlink is selected, either alone or along with other text...
++                if( ((SFX_ITEM_DONTCARE & aSet.GetItemState( RES_TXTATR_INETFMT, TRUE )) == 0) || rSh.HasReadonlySel())
++                {
++                    rSet.DisableItem(nWhich);
++                }
++            }
++            break;
+             case SID_TRANSLITERATE_HALFWIDTH:
+             case SID_TRANSLITERATE_FULLWIDTH:
+             case SID_TRANSLITERATE_HIRAGANA:
-- 
1.7.0



More information about the ooo-build mailing list