Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 4745 → Rev 4746

/branches/Version13x/Scribus/scribus/pageitem_textframe.cpp
2244,7 → 2244,7
altx = itemText.at(pos)->yp;
if ( altx > alty )
{
// we was at begin of line
// we were at begin of line
break;
}
}
2255,6 → 2255,9
}
else
{
//Control Home for start of frame text
pos=0;
/*
// paragraph begin
if ( pos < len &&
itemText.at(pos)->ch.at(0).latin1() == 13 )
2267,10 → 2270,14
}
else
--pos;
*/
}
CPos = pos;
if ( buttonState & ShiftButton )
ExpandSel(-1, oldPos);
if ( this->HasSel )
view->RefreshItem(this);
ScMW->setTBvals(this);
break;
case Key_End:
// go to end of line
2315,6 → 2322,9
}
else
{
//Control End for end of frame text
pos=static_cast<int>(itemText.count());
/*
// go to end of paragraph
if ( itemText.at(CPos)->ch.at(0).latin1() == 13 )
{
2328,77 → 2338,106
else
++pos;
}
*/
CPos = pos;
}
if ( buttonState & ShiftButton )
ExpandSel(1, oldPos);
if ( this->HasSel )
view->RefreshItem(this);
ScMW->setTBvals(this);
break;
case Key_Down:
if (CPos != static_cast<int>(itemText.count()))
if (buttonState & ControlButton)
{
bool down1=false;
double newy;
newy = alty = itemText.at(CPos)->yp;
altx = itemText.at(CPos)->xp;
do
// go to end of paragraph
len = static_cast<int>(itemText.count());
if ( CPos >= len )
break; // at end of frame
if ( itemText.at(CPos)->ch.at(0).latin1() == 13 )
{
++CPos;
if (CPos == static_cast<int>(itemText.count()))
break;
}
pos = CPos;
while ( pos < len )
{
if ( itemText.at(pos)->ch.at(0).latin1() == 13 )
break;
//CB Catch some funny empty lines. still testing
//if ((CPos < static_cast<int>(itemText.count())-1) && itemText.at(CPos+1)->ch[0].digitValue()==-1 && itemText.at(CPos)->ch[0].digitValue()==-1 && itemText.at(CPos)->xp == altx && itemText.at(CPos)->yp == alty)
// break;
if (itemText.at(CPos)->yp > alty)
else
++pos;
}
CPos = pos;
if ( buttonState & ShiftButton )
ExpandSel(1, oldPos);
}
else
{
if (CPos != static_cast<int>(itemText.count()))
{
bool down1=false;
double newy;
newy = alty = itemText.at(CPos)->yp;
altx = itemText.at(CPos)->xp;
do
{
if (down1 && itemText.at(CPos)->yp > newy)
++CPos;
if (CPos == static_cast<int>(itemText.count()))
break;
//CB Catch some funny empty lines. still testing
//if ((CPos < static_cast<int>(itemText.count())-1) && itemText.at(CPos+1)->ch[0].digitValue()==-1 && itemText.at(CPos)->ch[0].digitValue()==-1 && itemText.at(CPos)->xp == altx && itemText.at(CPos)->yp == alty)
// break;
if (itemText.at(CPos)->yp > alty)
{
--CPos;
if (down1 && itemText.at(CPos)->yp > newy)
{
--CPos;
break;
}
if (itemText.at(CPos)->xp >= altx)
break;
down1=true;
}
//CB Make the cursor move forward a column
if (itemText.at(CPos)->yp < alty)
{
double newX=altx+columnWidth();
while (itemText.at(CPos)->xp<newX && CPos < static_cast<int>(itemText.count())-1)
++CPos;
break;
}
if (itemText.at(CPos)->xp >= altx)
break;
down1=true;
newy=itemText.at(CPos)->yp;
}
//CB Make the cursor move forward a column
if (itemText.at(CPos)->yp < alty)
while (CPos < static_cast<int>(itemText.count()));
if ( buttonState & ShiftButton )
{
double newX=altx+columnWidth();
while (itemText.at(CPos)->xp<newX && CPos < static_cast<int>(itemText.count())-1)
++CPos;
break;
if ( buttonState & AltButton )
CPos = itemText.count();
ExpandSel(1, oldPos);
}
newy=itemText.at(CPos)->yp;
else
if (CPos == static_cast<int>(itemText.count()))
if (NextBox != 0)
{
if (NextBox->itemText.count() != 0)
{
view->Deselect(true);
NextBox->CPos = 0;
view->SelectItemNr(NextBox->ItemNr);
//currItem = currItem->NextBox;
}
}
}
while (CPos < static_cast<int>(itemText.count()));
if ( buttonState & ShiftButton )
else
{
if ( buttonState & AltButton )
CPos = itemText.count();
ExpandSel(1, oldPos);
}
else
if (CPos == static_cast<int>(itemText.count()))
if (NextBox != 0)
if (NextBox != 0)
{
if (NextBox->itemText.count() != 0)
{
if (NextBox->itemText.count() != 0)
{
view->Deselect(true);
NextBox->CPos = 0;
view->SelectItemNr(NextBox->ItemNr);
//currItem = currItem->NextBox;
}
view->Deselect(true);
NextBox->CPos = 0;
view->SelectItemNr(NextBox->ItemNr);
//currItem = currItem->NextBox;
}
}
else
{
if (NextBox != 0)
{
if (NextBox->itemText.count() != 0)
{
view->Deselect(true);
NextBox->CPos = 0;
view->SelectItemNr(NextBox->ItemNr);
//currItem = currItem->NextBox;
}
}
}
2407,64 → 2446,90
ScMW->setTBvals(this);
break;
case Key_Up:
if (CPos > 0)
if (buttonState & ControlButton)
{
if (CPos == static_cast<int>(itemText.count()))
--CPos;
alty = itemText.at(CPos)->yp;
altx = itemText.at(CPos)->xp;
if ( (pos = CPos) == 0 )
break; // at begin of frame
len = static_cast<int>(itemText.count());
if ( pos == len )
pos--;
// paragraph begin
if ( pos < len &&
itemText.at(pos)->ch.at(0).latin1() == 13 )
--pos;
while(pos > 0 )
if ( itemText.at(pos)->ch.at(0).latin1() == 13 )
{
++pos;
break;
}
else
--pos;
CPos = pos;
if ( buttonState & ShiftButton )
ExpandSel(-1, oldPos);
}
else
{
if (CPos > 0)
{
do
if (CPos == static_cast<int>(itemText.count()))
--CPos;
alty = itemText.at(CPos)->yp;
altx = itemText.at(CPos)->xp;
if (CPos > 0)
{
--CPos;
if (CPos == 0)
break;
if ( itemText.at(CPos)->ch.at(0).latin1() == 13 )
break;
if (itemText.at(CPos)->yp < alty)
do
{
if (itemText.at(CPos)->xp <= altx)
--CPos;
if (CPos == 0)
break;
if ( itemText.at(CPos)->ch.at(0).latin1() == 13 )
break;
if (itemText.at(CPos)->yp < alty)
{
if (itemText.at(CPos)->xp <= altx)
break;
}
//CB Make the cursor move back a column
if (itemText.at(CPos)->yp > alty)
{
double newX=altx-columnWidth();
while (itemText.at(CPos)->xp>newX && CPos > 0)
--CPos;
break;
}
}
//CB Make the cursor move back a column
if (itemText.at(CPos)->yp > alty)
while (CPos > 0);
}
if ( buttonState & ShiftButton )
{
if ( buttonState & AltButton )
CPos = 0;
ExpandSel(-1, oldPos);
}
else
if (CPos == 0)
{
double newX=altx-columnWidth();
while (itemText.at(CPos)->xp>newX && CPos > 0)
--CPos;
break;
if (BackBox != 0)
{
view->Deselect(true);
BackBox->CPos = BackBox->itemText.count();
view->SelectItemNr(BackBox->ItemNr);
//currItem = currItem->BackBox;
}
}
}
while (CPos > 0);
}
if ( buttonState & ShiftButton )
else
{
if ( buttonState & AltButton )
CPos = 0;
ExpandSel(-1, oldPos);
}
else
if (CPos == 0)
CPos = 0;
if (BackBox != 0)
{
if (BackBox != 0)
{
view->Deselect(true);
BackBox->CPos = BackBox->itemText.count();
view->SelectItemNr(BackBox->ItemNr);
//currItem = currItem->BackBox;
}
view->Deselect(true);
BackBox->CPos = BackBox->itemText.count();
view->SelectItemNr(BackBox->ItemNr);
//currItem = currItem->BackBox;
}
}
else
{
CPos = 0;
if (BackBox != 0)
{
view->Deselect(true);
BackBox->CPos = BackBox->itemText.count();
view->SelectItemNr(BackBox->ItemNr);
//currItem = currItem->BackBox;
}
}
if ( this->HasSel )