r16020 by craig - #9521: extra patch for control double click in text frames
scribus-commit
scribus-commit at lists.scribus.net
Sat Nov 27 15:28:08 CET 2010
Author: craig
Date: Sat Nov 27 14:28:08 2010
New Revision: 16020
URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16020
Log:
#9521: extra patch for control double click in text frames
Modified:
trunk/Scribus/scribus/canvasmode_edit.cpp
Modified: trunk/Scribus/scribus/canvasmode_edit.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16020&path=/trunk/Scribus/scribus/canvasmode_edit.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_edit.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_edit.cpp Sat Nov 27 14:28:08 2010
@@ -443,17 +443,16 @@
start = currItem->itemText.startOfParagraph(nrPar);
stop = currItem->itemText.endOfParagraph(nrPar);
}
- //qDebug() << "start: " << start << " stop: " << stop;
+ currItem->itemText.deselectAll();
currItem->itemText.extendSelection(start, stop);
- currItem->CPos = stop;
- currItem->HasSel = (currItem->itemText.lengthOfSelection() > 0);
+ currItem->CPos = stop;
}
else
{ //Double click in a frame to select a word
oldCp = currItem->CPos;
- currItem->CPos = currItem->itemText.selectWord(currItem->CPos);
- currItem->HasSel = (currItem->itemText.lengthOfSelection() > 0);
- }
+ currItem->CPos = currItem->itemText.selectWord(currItem->CPos);
+ }
+ currItem->HasSel = (currItem->itemText.lengthOfSelection() > 0);
}
}
else
@@ -720,19 +719,33 @@
if (currItem->itemText.lengthOfSelection() > 0)
{
if (currItem->CPos < (currItem->itemText.startOfSelection() + currItem->itemText.endOfSelection()) / 2)
+ {
+ if (m->modifiers() & Qt::ControlModifier)
+ currItem->CPos = currItem->itemText.startOfParagraph(currItem->itemText.nrOfParagraph(currItem->CPos));
oldP = currItem->itemText.startOfSelection();
+ }
else
+ {
+ if (m->modifiers() & Qt::ControlModifier)
+ currItem->CPos = currItem->itemText.endOfParagraph(currItem->itemText.nrOfParagraph(currItem->CPos));
oldP = currItem->itemText.endOfSelection();
+ }
currItem->asTextFrame()->itemText.extendSelection(oldP, currItem->CPos);
oldCp = currItem->CPos;
}
else
{
int dir=1;
- if (oldCp>currItem->CPos)
+ if (oldCp > currItem->CPos)
dir=-1;
- if (currItem->asTextFrame())
- currItem->asTextFrame()->ExpandSel(dir, oldP);
+ if (m->modifiers() & Qt::ControlModifier) //no selection but Ctrl+Shift+click still select paragraphs
+ {
+ if (dir == 1)
+ currItem->CPos = currItem->itemText.endOfParagraph(currItem->itemText.nrOfParagraph(currItem->CPos));
+ else
+ currItem->CPos = currItem->itemText.startOfParagraph(currItem->itemText.nrOfParagraph(currItem->CPos));
+ }
+ currItem->asTextFrame()->ExpandSel(dir, oldP);
oldCp = oldP;
}
}
More information about the scribus-commit
mailing list