View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002570 | Scribus | Text Frames / Story Editor | public | 2005-09-16 01:26 | 2005-11-30 23:40 |
| Reporter | intrigeri | Assigned To | fschmid | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | ppc | OS | Debian | OS Version | sarge |
| Product Version | 1.3.1cvs | ||||
| Fixed in Version | 1.3.1cvs | ||||
| Summary | 0002570: Special characters, when copied to search/replace dialog, are replaced by their raw display character | ||||
| Description | When a non-breaking space is copied in the story editor then pasted into the search/replace dialog, an underscore is pasted instead of a non-breaking space. It's really annoying to be compelled to exit the story editor, edit a text frame containing a nbsp, copy it, go back to the story editor, then run search/replace. | ||||
| Additional Information | That's why I hacked SEditor:copy() in story.cpp so that the special characters' Scribus Unicode char is copied into tBuffer, and thus can be pasted into the search/replace dialog. Two problems are remaining with this patch : * when pasted into another application, the copied text results in weird Unicode chars ; this is not worse than before : underscore were copied instead of nbsp, etc/ * it slows down selection, which has to be scanned for special chars, instead of using the quick selectedText() Qt function. | ||||
| Tags | No tags attached. | ||||
| Attached Files | story-copy_cvs20050915.diff (2,032 bytes)
--- Scribus/scribus/story.cpp 2005-09-11 23:21:42.000000000 +0200
+++ Scribus-work/scribus/story.cpp 2005-09-16 03:05:56.000000000 +0200
@@ -1566,7 +1566,56 @@
{
disconnect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(ClipChange()));
disconnect(QApplication::clipboard(), SIGNAL(selectionChanged()), this, SLOT(SelClipChange()));
- tBuffer = selectedText();
+ tBuffer = "";
+ int PStart, PEnd, SelStart, SelEnd, start, end;
+ int p, i;
+ QChar origChar;
+ QChar nextOrigChar;
+ QColor dispColor;
+ QChar destChar;
+ getSelection(&PStart, &SelStart, &PEnd, &SelEnd);
+ getCursorPosition(&p, &i);
+ for (int pa = PStart; pa < PEnd+1; ++pa)
+ {
+ if (pa == PStart)
+ start = SelStart;
+ else
+ start = 0;
+ if (pa == PEnd)
+ end = SelEnd;
+ else
+ end = paragraphLength(pa);
+ for (int ca = start; ca < end; ++ca)
+ {
+ origChar = text(pa)[ca];
+ setCursorPosition(pa,ca+1);
+ dispColor = color();
+ // special chars are displayed in red
+ if (dispColor == QColor(red))
+ {
+ if (origChar == '#')
+ destChar = QChar(ScApp->scrActions["specialPageNumber"]->actionInt());
+ else if (origChar == '_')
+ destChar = QChar(ScApp->scrActions["specialNonBreakingSpace"]->actionInt());
+ else if (origChar == '*')
+ destChar = QChar(ScApp->scrActions["specialNewLine"]->actionInt());
+ else if (origChar == '|')
+ destChar = QChar(ScApp->scrActions["specialFrameBreak"]->actionInt());
+ else if (origChar == '^')
+ destChar = QChar(ScApp->scrActions["specialColumnBreak"]->actionInt());
+ else if (origChar == '=')
+ destChar = QChar(ScApp->scrActions["specialNonBreakingHyphen"]->actionInt());
+ else
+ destChar = origChar;
+ }
+ else
+ destChar = origChar;
+ tBuffer.append(destChar);
+ }
+ if (pa != PEnd)
+ tBuffer.append("\n");
+ }
+ setCursorPosition(p,i);
copyStyledText();
QApplication::clipboard()->setText(tBuffer, QClipboard::Clipboard);
ClipData = 1;
| ||||
| Patch | |||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2005-09-16 01:26 | intrigeri | New Issue | |
| 2005-09-16 01:26 | intrigeri | File Added: story-copy_cvs20050915.diff | |
| 2005-09-16 12:13 |
|
Assigned To | => fschmid |
| 2005-09-16 12:13 |
|
Status | new => assigned |
| 2005-09-16 20:59 | fschmid | Status | assigned => resolved |
| 2005-09-16 20:59 | fschmid | Fixed in Version | => 1.3.1cvs |
| 2005-09-16 20:59 | fschmid | Resolution | open => fixed |
| 2005-09-23 22:29 | cbradney | Relationship added | related to 0002602 |
| 2005-09-23 22:29 | cbradney | Note Added: 0006689 | |
| 2005-09-23 22:29 | cbradney | Status | resolved => assigned |
| 2005-09-24 08:02 | fschmid | Status | assigned => resolved |
| 2005-10-01 04:58 |
|
Relationship added | related to 0002635 |
| 2005-11-30 23:40 | cbradney | Status | resolved => closed |
| 2015-09-17 20:08 | Kunda | Category | Story Editor / Text Frames => Story Ed/Txt Frames |
| 2015-09-17 20:12 | Kunda | Category | Story Ed/Txt Frames => Story Editor / Text Frames |
| 2025-04-27 19:16 | cbradney | Category | Story Editor / Text Frames => Text Frames / Story Editor |