Kaydet (Commit) 16bd9c99 authored tarafından heiko tietze's avatar heiko tietze Kaydeden (comit) Heiko Tietze

Resolves tdf#121596 - Include a key combination to insert thin spaces

uno:InsertNarrowNobreakSpace/ FN_INSERT_NNBSP added and asigned to shift+alt+space

Change-Id: I20dd4159bc35ee378bee75af9734b1f25dfd8b1a
Reviewed-on: https://gerrit.libreoffice.org/66776
Tested-by: Jenkins
Reviewed-by: 's avatarHeiko Tietze <tietze.heiko@gmail.com>
üst 47819ba0
......@@ -165,7 +165,8 @@ class SfxStringItem;
#define FN_INSERT_BREAK (FN_INSERT + 3)
#define FN_INSERT_SOFT_HYPHEN (FN_INSERT + 43) /* optional hyphen */
#define FN_INSERT_HARD_SPACE (FN_INSERT + 44) /* hard space */
#define FN_INSERT_HARDHYPHEN (FN_INSERT + 85) /* hyphen without break*/
#define FN_INSERT_NNBSP (FN_INSERT + 45) /* U+202F NARROW NO-BREAK SPACE (NNBSP) */
#define FN_INSERT_HARDHYPHEN (FN_INSERT + 85) /* hyphen without break*/
//!! be aware to not overwrite something that is used in sw/inc/cmdid.h already !!
#define FN_FORMAT (SID_SW_START + 400)
......
......@@ -1867,6 +1867,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing
<value xml:lang="en-US">.uno:InsertNonBreakingSpace</value>
</prop>
</node>
<node oor:name="SPACE_SHIFT_MOD2" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:InsertNarrowNobreakSpace</value>
</prop>
</node>
<node oor:name="SUBTRACT_MOD1" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
......@@ -2644,6 +2650,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing
<value xml:lang="en-US">.uno:InsertNonBreakingSpace</value>
</prop>
</node>
<node oor:name="SPACE_SHIFT_MOD2" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:InsertNarrowNobreakSpace</value>
</prop>
</node>
<node oor:name="SUBTRACT_MOD1" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
......@@ -3215,6 +3227,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing
<value xml:lang="en-US">.uno:InsertNonBreakingSpace</value>
</prop>
</node>
<node oor:name="SPACE_SHIFT_MOD2" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:InsertNarrowNobreakSpace</value>
</prop>
</node>
<node oor:name="SUBTRACT_MOD1" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
......@@ -4072,6 +4090,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing
<value xml:lang="en-US">.uno:InsertNonBreakingSpace</value>
</prop>
</node>
<node oor:name="SPACE_SHIFT_MOD2" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:InsertNarrowNobreakSpace</value>
</prop>
</node>
<node oor:name="SUBTRACT_MOD1" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
......@@ -4876,6 +4900,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing
<value xml:lang="en-US">.uno:InsertNonBreakingSpace</value>
</prop>
</node>
<node oor:name="SPACE_SHIFT_MOD2" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:InsertNarrowNobreakSpace</value>
</prop>
</node>
<node oor:name="SUBTRACT_MOD1" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
......@@ -5632,6 +5662,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing
<value xml:lang="en-US">.uno:InsertNonBreakingSpace</value>
</prop>
</node>
<node oor:name="SPACE_SHIFT_MOD2" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:InsertNarrowNobreakSpace</value>
</prop>
</node>
<node oor:name="SUBTRACT_MOD1" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
......@@ -6439,6 +6475,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing
<value xml:lang="en-US">.uno:InsertNonBreakingSpace</value>
</prop>
</node>
<node oor:name="SPACE_SHIFT_MOD2" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:InsertNarrowNobreakSpace</value>
</prop>
</node>
<node oor:name="SUBTRACT_MOD1" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
......@@ -7239,6 +7281,12 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing
<value xml:lang="en-US">.uno:InsertNonBreakingSpace</value>
</prop>
</node>
<node oor:name="SPACE_SHIFT_MOD2" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:InsertNarrowNobreakSpace</value>
</prop>
</node>
<node oor:name="SUBTRACT_MOD1" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
......
......@@ -6613,17 +6613,22 @@
</node>
<node oor:name=".uno:InsertHardHyphen" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Non-br~eaking Hyphen</value>
<value xml:lang="en-US">Insert non-br~eaking hyphen</value>
</prop>
</node>
<node oor:name=".uno:InsertSoftHyphen" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">S~oft Hyphen</value>
<value xml:lang="en-US">Insert s~oft Hyphen</value>
</prop>
</node>
<node oor:name=".uno:InsertNonBreakingSpace" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Non-breaking Space</value>
<value xml:lang="en-US">Insert ~non-breaking space</value>
</prop>
</node>
<node oor:name=".uno:InsertNarrowNobreakSpace" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Insert n~arrow no-break space (U+202F)</value>
</prop>
</node>
<node oor:name=".uno:InsertZWSP" oor:op="replace">
......
......@@ -67,6 +67,7 @@ const sal_Unicode CHAR_LRM = 0x200E;
const sal_Unicode CHAR_RLM = 0x200F;
const sal_Unicode CHAR_NBHY = 0x2011;
const sal_Unicode CHAR_ZWNBSP = 0x2060;
const sal_Unicode CHAR_NNBSP = 0x202F; //NARROW NO-BREAK SPACE
#define MINDOUBLE 1.7e-307
#define MAXDOUBLE 1.7e307
......
......@@ -93,6 +93,7 @@ interface TableText
FN_INSERT_SOFT_HYPHEN [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
FN_INSERT_HARDHYPHEN [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
FN_INSERT_HARD_SPACE [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
FN_INSERT_NNBSP [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
SID_INSERT_RLM [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
SID_INSERT_LRM [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
SID_INSERT_ZWSP [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ]
......
......@@ -631,6 +631,9 @@ void ScEditShell::Execute( SfxRequest& rReq )
case FN_INSERT_HARD_SPACE:
lclInsertCharacter( pTableView, pTopView, CHAR_NBSP );
break;
case FN_INSERT_NNBSP:
lclInsertCharacter( pTableView, pTopView, CHAR_NNBSP );
break;
case SID_INSERT_RLM:
lclInsertCharacter( pTableView, pTopView, CHAR_RLM );
break;
......
......@@ -259,6 +259,7 @@
<menu:menuitem menu:id=".uno:InsertNonBreakingSpace"/>
<menu:menuitem menu:id=".uno:InsertHardHyphen"/>
<menu:menuitem menu:id=".uno:InsertSoftHyphen"/>
<menu:menuitem menu:id=".uno:InsertNarrowNobreakSpace"/>
<menu:menuitem menu:id=".uno:InsertZWSP"/>
<menu:menuitem menu:id=".uno:InsertZWNBSP"/>
<menu:menuitem menu:id=".uno:InsertLRM"/>
......
......@@ -112,6 +112,11 @@ interface ViewShellBaseView
ExecMethod = Execute ;
StateMethod = GetState ;
]
FN_INSERT_NNBSP // status(final|play)
[
ExecMethod = Execute ;
StateMethod = GetState ;
]
SID_INSERT_RLM
[
ExecMethod = Execute ;
......
......@@ -323,6 +323,11 @@ interface DrawView
ExecMethod = FuTemporary ;
StateMethod = GetMenuState ;
]
FN_INSERT_NNBSP // status(final|play)
[
ExecMethod = FuTemporary ;
StateMethod = GetMenuState ;
]
SID_INSERT_RLM
[
ExecMethod = FuTemporary ;
......
......@@ -161,6 +161,11 @@ interface OutlineView
ExecMethod = FuTemporaryModify ;
StateMethod = GetMenuState ;
]
FN_INSERT_NNBSP // status(final|play)
[
ExecMethod = FuTemporaryModify ;
StateMethod = GetMenuState ;
]
SID_INSERT_RLM
[
ExecMethod = FuTemporary ;
......
......@@ -52,6 +52,7 @@ const sal_Unicode CHAR_RLM = u'\x200F';
const sal_Unicode CHAR_LRM = u'\x200E';
const sal_Unicode CHAR_ZWSP = u'\x200B';
const sal_Unicode CHAR_ZWNBSP = u'\x2060';
const sal_Unicode CHAR_NNBSP = u'\x202F'; //NARROW NO-BREAK SPACE
FuBullet::FuBullet (
......@@ -83,6 +84,7 @@ void FuBullet::DoExecute( SfxRequest& rReq )
case FN_INSERT_SOFT_HYPHEN: cMark = CHAR_SOFTHYPHEN ; break;
case FN_INSERT_HARDHYPHEN: cMark = CHAR_HARDHYPHEN ; break;
case FN_INSERT_HARD_SPACE: cMark = CHAR_HARDBLANK ; break;
case FN_INSERT_NNBSP: cMark = CHAR_NNBSP ; break;
case SID_INSERT_RLM : cMark = CHAR_RLM ; break;
case SID_INSERT_LRM : cMark = CHAR_LRM ; break;
case SID_INSERT_ZWSP : cMark = CHAR_ZWSP ; break;
......@@ -281,6 +283,7 @@ void FuBullet::GetSlotState( SfxItemSet& rSet, ViewShell const * pViewShell, Sfx
SfxItemState::DEFAULT == rSet.GetItemState( FN_INSERT_SOFT_HYPHEN ) ||
SfxItemState::DEFAULT == rSet.GetItemState( FN_INSERT_HARDHYPHEN ) ||
SfxItemState::DEFAULT == rSet.GetItemState( FN_INSERT_HARD_SPACE ) ||
SfxItemState::DEFAULT == rSet.GetItemState( FN_INSERT_NNBSP ) ||
SfxItemState::DEFAULT == rSet.GetItemState( SID_INSERT_RLM ) ||
SfxItemState::DEFAULT == rSet.GetItemState( SID_INSERT_LRM ) ||
SfxItemState::DEFAULT == rSet.GetItemState( SID_INSERT_ZWNBSP ) ||
......@@ -300,6 +303,7 @@ void FuBullet::GetSlotState( SfxItemSet& rSet, ViewShell const * pViewShell, Sfx
rSet.DisableItem(FN_INSERT_SOFT_HYPHEN);
rSet.DisableItem(FN_INSERT_HARDHYPHEN);
rSet.DisableItem(FN_INSERT_HARD_SPACE);
rSet.DisableItem(FN_INSERT_NNBSP);
rSet.DisableItem(SID_INSERT_ZWNBSP);
rSet.DisableItem(SID_INSERT_ZWSP);
}
......
......@@ -1448,6 +1448,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case FN_INSERT_SOFT_HYPHEN:
case FN_INSERT_HARDHYPHEN:
case FN_INSERT_HARD_SPACE:
case FN_INSERT_NNBSP:
case SID_INSERT_RLM :
case SID_INSERT_LRM :
case SID_INSERT_ZWNBSP :
......
......@@ -384,6 +384,7 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq)
case FN_INSERT_SOFT_HYPHEN:
case FN_INSERT_HARDHYPHEN:
case FN_INSERT_HARD_SPACE:
case FN_INSERT_NNBSP:
case SID_INSERT_RLM :
case SID_INSERT_LRM :
case SID_INSERT_ZWNBSP :
......
......@@ -210,6 +210,7 @@
<menu:menuitem menu:id=".uno:InsertNonBreakingSpace"/>
<menu:menuitem menu:id=".uno:InsertHardHyphen"/>
<menu:menuitem menu:id=".uno:InsertSoftHyphen"/>
<menu:menuitem menu:id=".uno:InsertNarrowNobreakSpace"/>
<menu:menuitem menu:id=".uno:InsertZWSP"/>
<menu:menuitem menu:id=".uno:InsertZWNBSP"/>
<menu:menuitem menu:id=".uno:InsertLRM"/>
......
......@@ -240,6 +240,7 @@
<menu:menuitem menu:id=".uno:InsertNonBreakingSpace"/>
<menu:menuitem menu:id=".uno:InsertHardHyphen"/>
<menu:menuitem menu:id=".uno:InsertSoftHyphen"/>
<menu:menuitem menu:id=".uno:InsertNarrowNobreakSpace"/>
<menu:menuitem menu:id=".uno:InsertZWSP"/>
<menu:menuitem menu:id=".uno:InsertZWNBSP"/>
<menu:menuitem menu:id=".uno:InsertLRM"/>
......
......@@ -10838,6 +10838,22 @@ SfxVoidItem InsertNonBreakingSpace FN_INSERT_HARD_SPACE
GroupId = SfxGroupId::Insert;
]
SfxVoidItem InsertNarrowNobreakSpace FN_INSERT_NNBSP
()
[
AutoUpdate = FALSE,
FastCall = TRUE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
AccelConfig = TRUE,
MenuConfig = TRUE,
ToolBoxConfig = TRUE,
GroupId = SfxGroupId::Insert;
]
SfxVoidItem ManageLanguage SID_BASICIDE_MANAGE_LANG
()
......
......@@ -175,6 +175,7 @@ constexpr bool SW_ISPRINTABLE(sal_Unicode c) { return c >= ' ' && 127 != c; }
#define CHAR_LRM u'\x200E'
#define CHAR_ZWSP u'\x200B'
#define CHAR_ZWNBSP u'\x2060'
#define CHAR_NNBSP u'\x202F' //NARROW NO-BREAK SPACE
// Returns the APP - CharClass instance - used for all ToUpper/ToLower/...
SW_DLLPUBLIC CharClass& GetAppCharClass();
......
......@@ -219,6 +219,12 @@ interface BaseText
StateMethod = NoState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
FN_INSERT_NNBSP // status(final|play)
[
ExecMethod = ExecInsert ;
StateMethod = NoState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_INSERT_RLM
[
ExecMethod = ExecInsert ;
......
......@@ -92,6 +92,13 @@ interface Annotation : _Annotation
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
FN_INSERT_NNBSP // status(final|play)
[
ExecMethod = Exec ;
StateMethod = NoState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_INSERT_RLM
[
ExecMethod = Exec ;
......
......@@ -147,6 +147,12 @@ interface TextDrawText
StateMethod = NoState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
FN_INSERT_NNBSP // status(final|play)
[
ExecMethod = ExecDraw ;
StateMethod = NoState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_INSERT_RLM
[
ExecMethod = ExecDraw ;
......
......@@ -405,6 +405,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
case FN_INSERT_SOFT_HYPHEN:
case FN_INSERT_HARDHYPHEN:
case FN_INSERT_HARD_SPACE:
case FN_INSERT_NNBSP:
case SID_INSERT_RLM :
case SID_INSERT_LRM :
case SID_INSERT_ZWNBSP :
......@@ -416,6 +417,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
case FN_INSERT_SOFT_HYPHEN: cIns = CHAR_SOFTHYPHEN; break;
case FN_INSERT_HARDHYPHEN: cIns = CHAR_HARDHYPHEN; break;
case FN_INSERT_HARD_SPACE: cIns = CHAR_HARDBLANK; break;
case FN_INSERT_NNBSP: cIns = CHAR_NNBSP; break;
case SID_INSERT_RLM : cIns = CHAR_RLM ; break;
case SID_INSERT_LRM : cIns = CHAR_LRM ; break;
case SID_INSERT_ZWSP : cIns = CHAR_ZWSP ; break;
......
......@@ -363,6 +363,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq)
case FN_INSERT_SOFT_HYPHEN:
case FN_INSERT_HARDHYPHEN:
case FN_INSERT_HARD_SPACE:
case FN_INSERT_NNBSP:
case SID_INSERT_RLM :
case SID_INSERT_LRM :
case SID_INSERT_ZWNBSP :
......@@ -374,6 +375,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq)
case FN_INSERT_SOFT_HYPHEN: cIns = CHAR_SOFTHYPHEN; break;
case FN_INSERT_HARDHYPHEN: cIns = CHAR_HARDHYPHEN; break;
case FN_INSERT_HARD_SPACE: cIns = CHAR_HARDBLANK; break;
case FN_INSERT_NNBSP: cIns = CHAR_NNBSP; break;
case SID_INSERT_RLM : cIns = CHAR_RLM ; break;
case SID_INSERT_LRM : cIns = CHAR_LRM ; break;
case SID_INSERT_ZWSP : cIns = CHAR_ZWSP ; break;
......
......@@ -174,6 +174,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
}
break;
case FN_INSERT_NNBSP: // shift+mod2/alt+space inserts some other character w/o going through SwEditWin::KeyInput(), at least on macOS
case SID_INSERT_RLM :
case SID_INSERT_LRM :
case SID_INSERT_ZWNBSP :
......@@ -186,6 +187,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
case SID_INSERT_LRM : cIns = CHAR_LRM ; break;
case SID_INSERT_ZWSP : cIns = CHAR_ZWSP ; break;
case SID_INSERT_ZWNBSP: cIns = CHAR_ZWNBSP; break;
case FN_INSERT_NNBSP: cIns = CHAR_NNBSP; break;
}
rSh.Insert( OUString( cIns ) );
}
......
......@@ -593,11 +593,12 @@ void SwView::CheckReadonlyState()
SID_UNDO,
SID_REDO, SID_REPEAT, SID_PASTE,
SID_PASTE_UNFORMATTED,
SID_PASTE_SPECIAL, SID_SBA_BRW_INSERT,
SID_PASTE_SPECIAL, SID_SBA_BRW_INSERT,
SID_BACKGROUND_COLOR, FN_INSERT_BOOKMARK, SID_CHARMAP_CONTROL,
SID_CHARMAP, SID_EMOJI_CONTROL, FN_INSERT_SOFT_HYPHEN,
FN_INSERT_HARDHYPHEN, FN_INSERT_HARD_SPACE, FN_INSERT_BREAK,
FN_INSERT_LINEBREAK, FN_INSERT_COLUMN_BREAK, FN_INSERT_BREAK_DLG,
FN_INSERT_HARDHYPHEN, FN_INSERT_HARD_SPACE, FN_INSERT_NNBSP,
FN_INSERT_BREAK, FN_INSERT_LINEBREAK, FN_INSERT_COLUMN_BREAK,
FN_INSERT_BREAK_DLG,
FN_DELETE_SENT, FN_DELETE_BACK_SENT, FN_DELETE_WORD,
FN_DELETE_BACK_WORD, FN_DELETE_LINE, FN_DELETE_BACK_LINE,
FN_DELETE_PARA, FN_DELETE_BACK_PARA, FN_DELETE_WHOLE_LINE,
......
......@@ -312,6 +312,7 @@
<menu:menuitem menu:id=".uno:InsertNonBreakingSpace"/>
<menu:menuitem menu:id=".uno:InsertHardHyphen"/>
<menu:menuitem menu:id=".uno:InsertSoftHyphen"/>
<menu:menuitem menu:id=".uno:InsertNarrowNobreakSpace"/>
<menu:menuitem menu:id=".uno:InsertZWSP"/>
<menu:menuitem menu:id=".uno:InsertZWNBSP"/>
<menu:menuitem menu:id=".uno:InsertLRM"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment