Skip to content

Commit 6ce6b48

Browse files
authored
Merge pull request sabrogden#899 from sabrogden/plain-text-position
Added keyboard shortcuts to paste position as plain text
2 parents 47c48ee + 031910e commit 6ce6b48

5 files changed

Lines changed: 87 additions & 2 deletions

File tree

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,17 @@
3636
*.exe
3737
*.out
3838
*.app
39+
/.vs
40+
/packages
41+
/Debug64
42+
*.log
43+
*.recipe
44+
*.ilk
45+
*.res
46+
/enc_temp_folder
47+
/focusdll/Debug64
48+
CP_Main.vcxproj.user
49+
CP_Main_i.c
50+
CP_Main_i.h
51+
*.idb
52+
*.lnk

src/ActionEnums.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,36 @@ CString ActionEnums::EnumDescription(ActionEnumValues value)
392392
case PASTE_MULTI_IMAGE_VERTICAL:
393393
val = "Paste Muliple Images Vertically";
394394
break;
395+
case PASTE_POSITION_1_PLAIN_TEXT:
396+
val = "Paste Position 1 Plain Text Only";
397+
break;
398+
case PASTE_POSITION_2_PLAIN_TEXT:
399+
val = "Paste Position 2 Plain Text Only";
400+
break;
401+
case PASTE_POSITION_3_PLAIN_TEXT:
402+
val = "Paste Position 3 Plain Text Only";
403+
break;
404+
case PASTE_POSITION_4_PLAIN_TEXT:
405+
val = "Paste Position 4 Plain Text Only";
406+
break;
407+
case PASTE_POSITION_5_PLAIN_TEXT:
408+
val = "Paste Position 5 Plain Text Only";
409+
break;
410+
case PASTE_POSITION_6_PLAIN_TEXT:
411+
val = "Paste Position 6 Plain Text Only";
412+
break;
413+
case PASTE_POSITION_7_PLAIN_TEXT:
414+
val = "Paste Position 7 Plain Text Only";
415+
break;
416+
case PASTE_POSITION_8_PLAIN_TEXT:
417+
val = "Paste Position 8 Plain Text Only";
418+
break;
419+
case PASTE_POSITION_9_PLAIN_TEXT:
420+
val = "Paste Position 9 Plain Text Only";
421+
break;
422+
case PASTE_POSITION_10_PLAIN_TEXT:
423+
val = "Paste Position 10 Plain Text Only";
424+
break;
395425
}
396426

397427
CString translatedValue = theApp.m_Language.GetQuickPasteKeyboardString(value, val);

src/ActionEnums.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ class ActionEnums
134134
PASTE_MULTI_IMAGE_HORIZONTAL,
135135
PASTE_MULTI_IMAGE_VERTICAL,
136136
ASCII_TEXT_ONLY,
137+
PASTE_POSITION_1_PLAIN_TEXT,
138+
PASTE_POSITION_2_PLAIN_TEXT,
139+
PASTE_POSITION_3_PLAIN_TEXT,
140+
PASTE_POSITION_4_PLAIN_TEXT,
141+
PASTE_POSITION_5_PLAIN_TEXT,
142+
PASTE_POSITION_6_PLAIN_TEXT,
143+
PASTE_POSITION_7_PLAIN_TEXT,
144+
PASTE_POSITION_8_PLAIN_TEXT,
145+
PASTE_POSITION_9_PLAIN_TEXT,
146+
PASTE_POSITION_10_PLAIN_TEXT,
137147

138148
LAST_ACTION
139149
};

src/QPasteWnd.cpp

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,14 +1074,15 @@ BOOL CQPasteWnd::OpenSelection(CSpecialPasteOptions pasteOptions)
10741074
return TRUE;
10751075
}
10761076

1077-
BOOL CQPasteWnd::OpenIndex(int item)
1077+
BOOL CQPasteWnd::OpenIndex(int item, bool plainTextOnly)
10781078
{
10791079
if (item >= m_lstHeader.GetItemCount())
10801080
{
10811081
return FALSE;
10821082
}
10831083

10841084
CSpecialPasteOptions pasteOptions;
1085+
pasteOptions.m_pasteAsPlainText = plainTextOnly;
10851086
return OpenID(m_lstHeader.GetItemData(item), pasteOptions);
10861087
}
10871088

@@ -3244,6 +3245,36 @@ bool CQPasteWnd::DoAction(CAccel a)
32443245
case ActionEnums::PASTE_POSITION_10:
32453246
ret = OpenIndex(9);
32463247
break;
3248+
case ActionEnums::PASTE_POSITION_1_PLAIN_TEXT:
3249+
ret = OpenIndex(0, true);
3250+
break;
3251+
case ActionEnums::PASTE_POSITION_2_PLAIN_TEXT:
3252+
ret = OpenIndex(1, true);
3253+
break;
3254+
case ActionEnums::PASTE_POSITION_3_PLAIN_TEXT:
3255+
ret = OpenIndex(2, true);
3256+
break;
3257+
case ActionEnums::PASTE_POSITION_4_PLAIN_TEXT:
3258+
ret = OpenIndex(3, true);
3259+
break;
3260+
case ActionEnums::PASTE_POSITION_5_PLAIN_TEXT:
3261+
ret = OpenIndex(4, true);
3262+
break;
3263+
case ActionEnums::PASTE_POSITION_6_PLAIN_TEXT:
3264+
ret = OpenIndex(5, true);
3265+
break;
3266+
case ActionEnums::PASTE_POSITION_7_PLAIN_TEXT:
3267+
ret = OpenIndex(6, true);
3268+
break;
3269+
case ActionEnums::PASTE_POSITION_8_PLAIN_TEXT:
3270+
ret = OpenIndex(7, true);
3271+
break;
3272+
case ActionEnums::PASTE_POSITION_9_PLAIN_TEXT:
3273+
ret = OpenIndex(8, true);
3274+
break;
3275+
case ActionEnums::PASTE_POSITION_10_PLAIN_TEXT:
3276+
ret = OpenIndex(9, true);
3277+
break;
32473278
case ActionEnums::CONFIG_SHOW_FIRST_TEN_TEXT:
32483279
ret = OnShowFirstTenText();
32493280
break;

src/QPasteWnd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class CQPasteWnd: public CWndEx
186186

187187
BOOL OpenID(int id, CSpecialPasteOptions pasteOptions);
188188
BOOL OpenSelection(CSpecialPasteOptions pasteOptions);
189-
BOOL OpenIndex(int item);
189+
BOOL OpenIndex(int item, bool plainTextOnly = false);
190190
BOOL NewGroup(bool bGroupSelection = true, int parentId = -1);
191191

192192
CString LoadDescription(int nItem);

0 commit comments

Comments
 (0)