mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 03:11:59 +00:00
remove getSelectionSpan not-so-helper
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9346 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
597ef42648
commit
3ab0507497
@ -1,3 +1,9 @@
|
||||
|
||||
2004-12-06 Alfredo Braunstein <abraunst@lyx.org>
|
||||
|
||||
* text2.C (getSelectionSpan): remove
|
||||
(changeDepth, changeDepthAllowed): adjust
|
||||
|
||||
2004-12-05 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
|
||||
* Makefile.am (BOOST_LIBS): use boost variables
|
||||
|
29
src/text2.C
29
src/text2.C
@ -343,18 +343,6 @@ void LyXText::setLayout(LCursor & cur, string const & layout)
|
||||
namespace {
|
||||
|
||||
|
||||
void getSelectionSpan(LCursor & cur, pit_type & beg, pit_type & end)
|
||||
{
|
||||
if (!cur.selection()) {
|
||||
beg = cur.pit();
|
||||
end = cur.pit() + 1;
|
||||
} else {
|
||||
beg = cur.selBegin().pit();
|
||||
end = cur.selEnd().pit() + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool changeDepthAllowed(LyXText::DEPTH_CHANGE type,
|
||||
Paragraph const & par, int max_depth)
|
||||
{
|
||||
@ -375,11 +363,9 @@ bool changeDepthAllowed(LyXText::DEPTH_CHANGE type,
|
||||
bool LyXText::changeDepthAllowed(LCursor & cur, DEPTH_CHANGE type) const
|
||||
{
|
||||
BOOST_ASSERT(this == cur.text());
|
||||
pit_type beg, end;
|
||||
getSelectionSpan(cur, beg, end);
|
||||
int max_depth = 0;
|
||||
if (beg != 0)
|
||||
max_depth = pars_[beg - 1].getMaxDepthAfter();
|
||||
pit_type const beg = cur.selBegin().pit();
|
||||
pit_type const end = cur.selEnd().pit() + 1;
|
||||
int max_depth = (beg != 0 ? pars_[beg - 1].getMaxDepthAfter() : 0);
|
||||
|
||||
for (pit_type pit = beg; pit != end; ++pit) {
|
||||
if (::changeDepthAllowed(type, pars_[pit], max_depth))
|
||||
@ -393,13 +379,10 @@ bool LyXText::changeDepthAllowed(LCursor & cur, DEPTH_CHANGE type) const
|
||||
void LyXText::changeDepth(LCursor & cur, DEPTH_CHANGE type)
|
||||
{
|
||||
BOOST_ASSERT(this == cur.text());
|
||||
pit_type beg, end;
|
||||
getSelectionSpan(cur, beg, end);
|
||||
pit_type const beg = cur.selBegin().pit();
|
||||
pit_type const end = cur.selEnd().pit() + 1;
|
||||
recordUndoSelection(cur);
|
||||
|
||||
int max_depth = 0;
|
||||
if (beg != 0)
|
||||
max_depth = pars_[beg - 1].getMaxDepthAfter();
|
||||
int max_depth = (beg != 0 ? pars_[beg - 1].getMaxDepthAfter() : 0);
|
||||
|
||||
for (pit_type pit = beg; pit != end; ++pit) {
|
||||
Paragraph & par = pars_[pit];
|
||||
|
Loading…
Reference in New Issue
Block a user