+2000-10-09 Juergen Vigna <jug@sad.it>
+
+ * src/text.C (GetRow): small fix.
+
+ * src/BufferView_pimpl.C (cursorPrevious):
+ (cursorNext): added LyXText parameter to function.
+
+ * src/insets/insettabular.C (LocalDispatch): activate cell inset on
+ keypress depending on cursor position.
+
+2000-10-06 Juergen Vigna <jug@sad.it>
+
+ * src/insets/insettabular.C (Ascii): finally call right ascii-function.
+ (copySelection): redone this function and also copy ascii representa-
+ tion to clipboard.
+
+ * src/tabular.C (Ascii):
+ (AsciiPrintCell):
+ (AsciiBottomHLine):
+ (AsciiTopHLine):
+ (print_n_chars): new functions to realize the ascii export of tabulars.
+
+2000-10-05 Juergen Vigna <jug@sad.it>
+
+ * src/lyx_gui_misc.C (updateAllVisibleBufferRelatedDialogs): small fix
+ if we don't have a buffer.
+
2000-10-10 Allan Rae <rae@lyx.org>
* src/frontends/xforms/FormPreferences.[Ch] (hide): Fix the problem
}
-void BufferView::cursorPrevious()
+void BufferView::cursorPrevious(LyXText * text)
{
- pimpl_->cursorPrevious();
+ pimpl_->cursorPrevious(text);
}
-void BufferView::cursorNext()
+void BufferView::cursorNext(LyXText * text)
{
- pimpl_->cursorNext();
+ pimpl_->cursorNext(text);
}
///
void gotoError();
///
- void cursorPrevious();
+ void cursorPrevious(LyXText *);
///
- void cursorNext();
+ void cursorNext(LyXText *);
///
bool available() const;
///
}
-void BufferView::Pimpl::cursorPrevious()
+void BufferView::Pimpl::cursorPrevious(LyXText * text)
{
- if (!bv_->text->cursor.row()->previous()) return;
+ if (!text->cursor.row()->previous())
+ return;
- int y = bv_->text->first;
- Row * cursorrow = bv_->text->cursor.row();
- bv_->text->SetCursorFromCoordinates(bv_, bv_->text->cursor.x_fix(), y);
+ int y = text->first;
+ if (text->inset_owner)
+ y += bv_->text->first;
+ Row * cursorrow = text->cursor.row();
+ text->SetCursorFromCoordinates(bv_, bv_->text->cursor.x_fix(), y);
bv_->text->FinishUndo();
// This is to allow jumping over large insets
- if ((cursorrow == bv_->text->cursor.row()))
- bv_->text->CursorUp(bv_);
+ if ((cursorrow == text->cursor.row()))
+ text->CursorUp(bv_);
- if (bv_->text->cursor.row()->height() < workarea_->height())
+ if (text->inset_owner ||
+ text->cursor.row()->height() < workarea_->height())
screen_->Draw(bv_->text,
- bv_->text->cursor.y()
- - bv_->text->cursor.row()->baseline()
- + bv_->text->cursor.row()->height()
+ text->cursor.y()
+ - text->cursor.row()->baseline()
+ + text->cursor.row()->height()
- workarea_->height() + 1 );
updateScrollbar();
}
-void BufferView::Pimpl::cursorNext()
+void BufferView::Pimpl::cursorNext(LyXText * text)
{
- if (!bv_->text->cursor.row()->next()) return;
+ if (!text->cursor.row()->next())
+ return;
- int y = bv_->text->first;
- bv_->text->GetRowNearY(y);
- Row * cursorrow = bv_->text->cursor.row();
- bv_->text->SetCursorFromCoordinates(bv_, bv_->text->cursor.x_fix(), y
+ int y = text->first;
+// if (text->inset_owner)
+// y += bv_->text->first;
+ text->GetRowNearY(y);
+ Row * cursorrow = text->cursor.row();
+ text->SetCursorFromCoordinates(bv_, text->cursor.x_fix(), y
+ workarea_->height());
bv_->text->FinishUndo();
// This is to allow jumping over large insets
if ((cursorrow == bv_->text->cursor.row()))
- bv_->text->CursorDown(bv_);
+ text->CursorDown(bv_);
- if (bv_->text->cursor.row()->height() < workarea_->height())
- screen_->Draw(bv_->text, bv_->text->cursor.y()
- - bv_->text->cursor.row()->baseline());
+ if (text->inset_owner ||
+ text->cursor.row()->height() < workarea_->height())
+ screen_->Draw(bv_->text, text->cursor.y() -
+ text->cursor.row()->baseline());
updateScrollbar();
}
///
void cursorToggle();
///
- void cursorPrevious();
+ void cursorPrevious(LyXText *);
///
- void cursorNext();
+ void cursorNext(LyXText *);
///
bool available() const;
///
font1 = LyXFont(LyXFont::ALL_INHERIT, params.language_info);
for (LyXParagraph::size_type i = 0; i < par->size(); ++i) {
if (!i && !footnoteflag && !noparbreak){
- buffer << "\n\n";
+ if (linelen > 0)
+ buffer << "\n\n";
for(char j = 0; j < depth; ++j)
buffer << " ";
currlinelen = depth * 2;
case 5: /* Description */
break;
case 6: /* Abstract */
- buffer << "Abstract\n\n";
+ if (linelen > 0)
+ buffer << "Abstract\n\n";
+ else
+ buffer << "Abstract: ";
break;
case 7: /* Bibliography */
if (!ref_printed) {
- buffer << "References\n\n";
+ if (linelen > 0)
+ buffer << "References\n\n";
+ else
+ buffer << "References: ";
ref_printed = true;
}
break;
}
break;
case LyXParagraph::META_NEWLINE:
- buffer << "\n";
- for(char j = 0; j < depth; ++j)
- buffer << " ";
+ if (linelen > 0) {
+ buffer << "\n";
+ for(char j = 0; j < depth; ++j)
+ buffer << " ";
+ }
currlinelen = depth * 2;
if (ltype_depth > depth) {
for(char j = ltype_depth;
--- Qt Architect generated file ---
File: formindexdialogdata.C
- Last generated: Tue Oct 3 16:28:36 2000
+ Last generated: Fri Oct 6 13:10:23 2000
DO NOT EDIT!!! This file will be automatically
regenerated by qtarch. All changes will be lost.
*********************************************************************/
-#include <gettext.h>
-
#include <qpixmap.h>
#include <qlayout.h>
#include "formindexdialogdata.h"
labelindex->setLineWidth( 1 );
labelindex->setMidLineWidth( 0 );
labelindex->QFrame::setMargin( 0 );
- labelindex->setText( _("Keyword:") );
+ labelindex->setText( "Keyword:" );
labelindex->setAlignment( 289 );
labelindex->setMargin( -1 );
index->setBackgroundMode( QWidget::PaletteBase );
index->setFontPropagation( QWidget::NoChildren );
index->setPalettePropagation( QWidget::NoChildren );
- index->setText( _("") );
+ index->setText( "" );
index->setMaxLength( 32767 );
index->setFrame( QLineEdit::Normal );
index->setFrame( TRUE );
buttonOk->setBackgroundMode( QWidget::PaletteBackground );
buttonOk->setFontPropagation( QWidget::NoChildren );
buttonOk->setPalettePropagation( QWidget::NoChildren );
- buttonOk->setText( _("&OK") );
+ buttonOk->setText( "&OK" );
buttonOk->setAutoRepeat( FALSE );
buttonOk->setAutoResize( FALSE );
buttonOk->setToggleButton( FALSE );
buttonCancel->setBackgroundMode( QWidget::PaletteBackground );
buttonCancel->setFontPropagation( QWidget::NoChildren );
buttonCancel->setPalettePropagation( QWidget::NoChildren );
- buttonCancel->setText( _("&Cancel") );
+ buttonCancel->setText( "&Cancel" );
buttonCancel->setAutoRepeat( FALSE );
buttonCancel->setAutoResize( FALSE );
buttonCancel->setToggleButton( FALSE );
buttonCancel->setAutoDefault( FALSE );
buttonCancel->setIsMenuButton( FALSE );
- if (labelindex->sizeHint().width()!=-1)
- labelindex->setMinimumWidth(labelindex->sizeHint().width());
- if (labelindex->sizeHint().height()!=-1)
- labelindex->setMinimumHeight(labelindex->sizeHint().height());
- if (labelindex->sizeHint().width()!=-1)
- labelindex->setMaximumWidth(labelindex->sizeHint().width());
- if (labelindex->sizeHint().height()!=-1)
- labelindex->setMaximumHeight(labelindex->sizeHint().height());
- if (index->sizeHint().width()!=-1)
- index->setMinimumWidth(index->sizeHint().width());
- if (index->sizeHint().height()!=-1)
- index->setMinimumHeight(index->sizeHint().height());
- if (index->sizeHint().height()!=-1)
- index->setMaximumHeight(index->sizeHint().height());
- if (buttonOk->sizeHint().width()!=-1)
- buttonOk->setMinimumWidth(buttonOk->sizeHint().width());
- if (buttonOk->sizeHint().height()!=-1)
- buttonOk->setMinimumHeight(buttonOk->sizeHint().height());
- if (buttonOk->sizeHint().width()!=-1)
- buttonOk->setMaximumWidth(buttonOk->sizeHint().width());
- if (buttonOk->sizeHint().height()!=-1)
- buttonOk->setMaximumHeight(buttonOk->sizeHint().height());
- if (buttonCancel->sizeHint().width()!=-1)
- buttonCancel->setMinimumWidth(buttonCancel->sizeHint().width());
- if (buttonCancel->sizeHint().height()!=-1)
- buttonCancel->setMinimumHeight(buttonCancel->sizeHint().height());
- if (buttonCancel->sizeHint().width()!=-1)
- buttonCancel->setMaximumWidth(buttonCancel->sizeHint().width());
- if (buttonCancel->sizeHint().height()!=-1)
- buttonCancel->setMaximumHeight(buttonCancel->sizeHint().height());
QGridLayout* qtarch_layout_1 = new QGridLayout( this, 2, 1, 5, 5, NULL );
qtarch_layout_1->addColSpacing( 0, 5 );
qtarch_layout_1->setColStretch( 0, 1 );
--- Qt Architect generated file ---
File: formindexdialogdata.h
- Last generated: Tue Oct 3 16:28:36 2000
+ Last generated: Fri Oct 6 13:10:23 2000
DO NOT EDIT!!! This file will be automatically
regenerated by qtarch. All changes will be lost.
--- Qt Architect generated file ---
File: formprintdialogdata.C
- Last generated: Tue Oct 3 18:09:27 2000
+ Last generated: Fri Oct 6 13:10:28 2000
DO NOT EDIT!!! This file will be automatically
regenerated by qtarch. All changes will be lost.
*********************************************************************/
-#include <gettext.h>
-
#include <qpixmap.h>
#include <qlayout.h>
#include "formprintdialogdata.h"
pagesGroupBox->setLineWidth( 1 );
pagesGroupBox->setMidLineWidth( 0 );
pagesGroupBox->QFrame::setMargin( 0 );
- pagesGroupBox->setTitle( _("Pages") );
+ pagesGroupBox->setTitle( "Pages" );
pagesGroupBox->setAlignment( 1 );
pagesRadioGroup = new QButtonGroup( pagesGroupBox, "pagesRadioGroup" );
pagesRadioGroup->setLineWidth( 1 );
pagesRadioGroup->setMidLineWidth( 0 );
pagesRadioGroup->QFrame::setMargin( 0 );
- pagesRadioGroup->setTitle( _("") );
+ pagesRadioGroup->setTitle( "" );
pagesRadioGroup->setAlignment( 1 );
pagesRadioGroup->setExclusive( TRUE );
copies->setLineWidth( 1 );
copies->setMidLineWidth( 0 );
copies->QFrame::setMargin( 0 );
- copies->setTitle( _("Copies") );
+ copies->setTitle( "Copies" );
copies->setAlignment( 1 );
printToGroupBox = new QGroupBox( this, "printToGroupBox" );
printToGroupBox->setLineWidth( 1 );
printToGroupBox->setMidLineWidth( 0 );
printToGroupBox->QFrame::setMargin( 0 );
- printToGroupBox->setTitle( _("Print to") );
+ printToGroupBox->setTitle( "Print to" );
printToGroupBox->setAlignment( 1 );
printToRadioGroup = new QButtonGroup( printToGroupBox, "printToRadioGroup" );
printToRadioGroup->setLineWidth( 1 );
printToRadioGroup->setMidLineWidth( 0 );
printToRadioGroup->QFrame::setMargin( 0 );
- printToRadioGroup->setTitle( _("") );
+ printToRadioGroup->setTitle( "" );
printToRadioGroup->setAlignment( 1 );
printToRadioGroup->setExclusive( TRUE );
print->setBackgroundMode( QWidget::PaletteBackground );
print->setFontPropagation( QWidget::NoChildren );
print->setPalettePropagation( QWidget::NoChildren );
- print->setText( _("&Print") );
+ print->setText( "&Print" );
print->setAutoRepeat( FALSE );
print->setAutoResize( FALSE );
print->setToggleButton( FALSE );
cancel->setBackgroundMode( QWidget::PaletteBackground );
cancel->setFontPropagation( QWidget::NoChildren );
cancel->setPalettePropagation( QWidget::NoChildren );
- cancel->setText( _("&Cancel") );
+ cancel->setText( "&Cancel" );
cancel->setAutoRepeat( FALSE );
cancel->setAutoResize( FALSE );
cancel->setToggleButton( FALSE );
allpages->setBackgroundMode( QWidget::PaletteBackground );
allpages->setFontPropagation( QWidget::NoChildren );
allpages->setPalettePropagation( QWidget::NoChildren );
- allpages->setText( _("&All pages") );
+ allpages->setText( "&All pages" );
allpages->setAutoRepeat( FALSE );
allpages->setAutoResize( FALSE );
allpages->setChecked( FALSE );
evenpages->setBackgroundMode( QWidget::PaletteBackground );
evenpages->setFontPropagation( QWidget::NoChildren );
evenpages->setPalettePropagation( QWidget::NoChildren );
- evenpages->setText( _("&Even pages") );
+ evenpages->setText( "&Even pages" );
evenpages->setAutoRepeat( FALSE );
evenpages->setAutoResize( FALSE );
evenpages->setChecked( FALSE );
from->setBackgroundMode( QWidget::PaletteBase );
from->setFontPropagation( QWidget::NoChildren );
from->setPalettePropagation( QWidget::NoChildren );
- from->setText( _("") );
+ from->setText( "" );
from->setMaxLength( 32767 );
from->setFrame( QLineEdit::Normal );
from->setFrame( TRUE );
fromLabel->setLineWidth( 1 );
fromLabel->setMidLineWidth( 0 );
fromLabel->QFrame::setMargin( 0 );
- fromLabel->setText( _("From") );
+ fromLabel->setText( "From" );
fromLabel->setAlignment( 289 );
fromLabel->setMargin( -1 );
toLabel->setLineWidth( 1 );
toLabel->setMidLineWidth( 0 );
toLabel->QFrame::setMargin( 0 );
- toLabel->setText( _("To") );
+ toLabel->setText( "To" );
toLabel->setAlignment( 289 );
toLabel->setMargin( -1 );
oddpages->setBackgroundMode( QWidget::PaletteBackground );
oddpages->setFontPropagation( QWidget::NoChildren );
oddpages->setPalettePropagation( QWidget::NoChildren );
- oddpages->setText( _("&Odd pages") );
+ oddpages->setText( "&Odd pages" );
oddpages->setAutoRepeat( FALSE );
oddpages->setAutoResize( FALSE );
oddpages->setChecked( FALSE );
toprinter->setBackgroundMode( QWidget::PaletteBackground );
toprinter->setFontPropagation( QWidget::NoChildren );
toprinter->setPalettePropagation( QWidget::NoChildren );
- toprinter->setText( _("&Printer") );
+ toprinter->setText( "&Printer" );
toprinter->setAutoRepeat( FALSE );
toprinter->setAutoResize( FALSE );
toprinter->setChecked( FALSE );
tofile->setBackgroundMode( QWidget::PaletteBackground );
tofile->setFontPropagation( QWidget::NoChildren );
tofile->setPalettePropagation( QWidget::NoChildren );
- tofile->setText( _("&File") );
+ tofile->setText( "&File" );
tofile->setAutoRepeat( FALSE );
tofile->setAutoResize( FALSE );
tofile->setChecked( FALSE );
printername->setBackgroundMode( QWidget::PaletteBase );
printername->setFontPropagation( QWidget::NoChildren );
printername->setPalettePropagation( QWidget::NoChildren );
- printername->setText( _("") );
+ printername->setText( "" );
printername->setMaxLength( 32767 );
printername->setFrame( QLineEdit::Normal );
printername->setFrame( TRUE );
reverse->setBackgroundMode( QWidget::PaletteBackground );
reverse->setFontPropagation( QWidget::NoChildren );
reverse->setPalettePropagation( QWidget::NoChildren );
- reverse->setText( _("&Reverse order") );
+ reverse->setText( "&Reverse order" );
reverse->setAutoRepeat( FALSE );
reverse->setAutoResize( TRUE );
reverse->setChecked( FALSE );
filename->setBackgroundMode( QWidget::PaletteBase );
filename->setFontPropagation( QWidget::NoChildren );
filename->setPalettePropagation( QWidget::NoChildren );
- filename->setText( _("") );
+ filename->setText( "" );
filename->setMaxLength( 32767 );
filename->setFrame( QLineEdit::Normal );
filename->setFrame( TRUE );
sort->setBackgroundMode( QWidget::PaletteBackground );
sort->setFontPropagation( QWidget::NoChildren );
sort->setPalettePropagation( QWidget::NoChildren );
- sort->setText( _("&Sort") );
+ sort->setText( "&Sort" );
sort->setAutoRepeat( FALSE );
sort->setAutoResize( TRUE );
sort->setChecked( FALSE );
browse->setBackgroundMode( QWidget::PaletteBackground );
browse->setFontPropagation( QWidget::NoChildren );
browse->setPalettePropagation( QWidget::NoChildren );
- browse->setText( _("&Browse") );
+ browse->setText( "&Browse" );
browse->setAutoRepeat( FALSE );
browse->setAutoResize( FALSE );
browse->setToggleButton( FALSE );
count->setBackgroundMode( QWidget::PaletteBase );
count->setFontPropagation( QWidget::NoChildren );
count->setPalettePropagation( QWidget::NoChildren );
- count->setText( _("") );
+ count->setText( "" );
count->setMaxLength( 32767 );
count->setFrame( QLineEdit::Normal );
count->setFrame( TRUE );
countLabel->setLineWidth( 1 );
countLabel->setMidLineWidth( 0 );
countLabel->QFrame::setMargin( 0 );
- countLabel->setText( _("Count") );
+ countLabel->setText( "Count" );
countLabel->setAlignment( 289 );
countLabel->setMargin( -1 );
to->setBackgroundMode( QWidget::PaletteBase );
to->setFontPropagation( QWidget::NoChildren );
to->setPalettePropagation( QWidget::NoChildren );
- to->setText( _("") );
+ to->setText( "" );
to->setMaxLength( 32767 );
to->setFrame( QLineEdit::Normal );
to->setFrame( TRUE );
printToRadioGroup->insert( toprinter );
printToRadioGroup->insert( tofile );
- if (print->sizeHint().width()!=-1)
- print->setMinimumWidth(print->sizeHint().width());
- if (print->sizeHint().height()!=-1)
- print->setMinimumHeight(print->sizeHint().height());
- if (print->sizeHint().width()!=-1)
- print->setMaximumWidth(print->sizeHint().width());
- if (print->sizeHint().height()!=-1)
- print->setMaximumHeight(print->sizeHint().height());
- if (cancel->sizeHint().width()!=-1)
- cancel->setMinimumWidth(cancel->sizeHint().width());
- if (cancel->sizeHint().height()!=-1)
- cancel->setMinimumHeight(cancel->sizeHint().height());
- if (cancel->sizeHint().width()!=-1)
- cancel->setMaximumWidth(cancel->sizeHint().width());
- if (cancel->sizeHint().height()!=-1)
- cancel->setMaximumHeight(cancel->sizeHint().height());
- if (allpages->sizeHint().width()!=-1)
- allpages->setMinimumWidth(allpages->sizeHint().width());
- if (allpages->sizeHint().height()!=-1)
- allpages->setMinimumHeight(allpages->sizeHint().height());
- if (allpages->sizeHint().width()!=-1)
- allpages->setMaximumWidth(allpages->sizeHint().width());
- if (allpages->sizeHint().height()!=-1)
- allpages->setMaximumHeight(allpages->sizeHint().height());
- if (evenpages->sizeHint().width()!=-1)
- evenpages->setMinimumWidth(evenpages->sizeHint().width());
- if (evenpages->sizeHint().height()!=-1)
- evenpages->setMinimumHeight(evenpages->sizeHint().height());
- if (evenpages->sizeHint().width()!=-1)
- evenpages->setMaximumWidth(evenpages->sizeHint().width());
- if (evenpages->sizeHint().height()!=-1)
- evenpages->setMaximumHeight(evenpages->sizeHint().height());
- if (from->sizeHint().width()!=-1)
- from->setMinimumWidth(from->sizeHint().width());
- if (from->sizeHint().height()!=-1)
- from->setMinimumHeight(from->sizeHint().height());
- if (from->sizeHint().height()!=-1)
- from->setMaximumHeight(from->sizeHint().height());
- if (fromLabel->sizeHint().width()!=-1)
- fromLabel->setMinimumWidth(fromLabel->sizeHint().width());
- if (fromLabel->sizeHint().height()!=-1)
- fromLabel->setMinimumHeight(fromLabel->sizeHint().height());
- if (fromLabel->sizeHint().width()!=-1)
- fromLabel->setMaximumWidth(fromLabel->sizeHint().width());
- if (fromLabel->sizeHint().height()!=-1)
- fromLabel->setMaximumHeight(fromLabel->sizeHint().height());
- if (toLabel->sizeHint().width()!=-1)
- toLabel->setMinimumWidth(toLabel->sizeHint().width());
- if (toLabel->sizeHint().height()!=-1)
- toLabel->setMinimumHeight(toLabel->sizeHint().height());
- if (toLabel->sizeHint().width()!=-1)
- toLabel->setMaximumWidth(toLabel->sizeHint().width());
- if (toLabel->sizeHint().height()!=-1)
- toLabel->setMaximumHeight(toLabel->sizeHint().height());
- if (oddpages->sizeHint().width()!=-1)
- oddpages->setMinimumWidth(oddpages->sizeHint().width());
- if (oddpages->sizeHint().height()!=-1)
- oddpages->setMinimumHeight(oddpages->sizeHint().height());
- if (oddpages->sizeHint().width()!=-1)
- oddpages->setMaximumWidth(oddpages->sizeHint().width());
- if (oddpages->sizeHint().height()!=-1)
- oddpages->setMaximumHeight(oddpages->sizeHint().height());
- if (toprinter->sizeHint().width()!=-1)
- toprinter->setMinimumWidth(toprinter->sizeHint().width());
- if (toprinter->sizeHint().height()!=-1)
- toprinter->setMinimumHeight(toprinter->sizeHint().height());
- if (toprinter->sizeHint().width()!=-1)
- toprinter->setMaximumWidth(toprinter->sizeHint().width());
- if (toprinter->sizeHint().height()!=-1)
- toprinter->setMaximumHeight(toprinter->sizeHint().height());
- if (tofile->sizeHint().width()!=-1)
- tofile->setMinimumWidth(tofile->sizeHint().width());
- if (tofile->sizeHint().height()!=-1)
- tofile->setMinimumHeight(tofile->sizeHint().height());
- if (tofile->sizeHint().width()!=-1)
- tofile->setMaximumWidth(tofile->sizeHint().width());
- if (tofile->sizeHint().height()!=-1)
- tofile->setMaximumHeight(tofile->sizeHint().height());
- if (printername->sizeHint().width()!=-1)
- printername->setMinimumWidth(printername->sizeHint().width());
- if (printername->sizeHint().height()!=-1)
- printername->setMinimumHeight(printername->sizeHint().height());
- if (printername->sizeHint().height()!=-1)
- printername->setMaximumHeight(printername->sizeHint().height());
- if (reverse->sizeHint().width()!=-1)
- reverse->setMinimumWidth(reverse->sizeHint().width());
- if (reverse->sizeHint().height()!=-1)
- reverse->setMinimumHeight(reverse->sizeHint().height());
- if (reverse->sizeHint().width()!=-1)
- reverse->setMaximumWidth(reverse->sizeHint().width());
- if (reverse->sizeHint().height()!=-1)
- reverse->setMaximumHeight(reverse->sizeHint().height());
- if (filename->sizeHint().width()!=-1)
- filename->setMinimumWidth(filename->sizeHint().width());
- if (filename->sizeHint().height()!=-1)
- filename->setMinimumHeight(filename->sizeHint().height());
- if (filename->sizeHint().height()!=-1)
- filename->setMaximumHeight(filename->sizeHint().height());
- if (sort->sizeHint().width()!=-1)
- sort->setMinimumWidth(sort->sizeHint().width());
- if (sort->sizeHint().height()!=-1)
- sort->setMinimumHeight(sort->sizeHint().height());
- if (sort->sizeHint().width()!=-1)
- sort->setMaximumWidth(sort->sizeHint().width());
- if (sort->sizeHint().height()!=-1)
- sort->setMaximumHeight(sort->sizeHint().height());
- if (browse->sizeHint().width()!=-1)
- browse->setMinimumWidth(browse->sizeHint().width());
- if (browse->sizeHint().height()!=-1)
- browse->setMinimumHeight(browse->sizeHint().height());
- if (browse->sizeHint().width()!=-1)
- browse->setMaximumWidth(browse->sizeHint().width());
- if (browse->sizeHint().height()!=-1)
- browse->setMaximumHeight(browse->sizeHint().height());
- if (count->sizeHint().width()!=-1)
- count->setMinimumWidth(count->sizeHint().width());
- if (count->sizeHint().height()!=-1)
- count->setMinimumHeight(count->sizeHint().height());
- if (count->sizeHint().height()!=-1)
- count->setMaximumHeight(count->sizeHint().height());
- if (countLabel->sizeHint().width()!=-1)
- countLabel->setMinimumWidth(countLabel->sizeHint().width());
- if (countLabel->sizeHint().height()!=-1)
- countLabel->setMinimumHeight(countLabel->sizeHint().height());
- if (countLabel->sizeHint().width()!=-1)
- countLabel->setMaximumWidth(countLabel->sizeHint().width());
- if (countLabel->sizeHint().height()!=-1)
- countLabel->setMaximumHeight(countLabel->sizeHint().height());
- if (to->sizeHint().width()!=-1)
- to->setMinimumWidth(to->sizeHint().width());
- if (to->sizeHint().height()!=-1)
- to->setMinimumHeight(to->sizeHint().height());
- if (to->sizeHint().height()!=-1)
- to->setMaximumHeight(to->sizeHint().height());
QGridLayout* qtarch_layout_1 = new QGridLayout( this, 2, 1, 5, 5, NULL );
qtarch_layout_1->addColSpacing( 0, 5 );
qtarch_layout_1->setColStretch( 0, 1 );
--- Qt Architect generated file ---
File: formprintdialogdata.h
- Last generated: Tue Oct 3 18:09:27 2000
+ Last generated: Fri Oct 6 13:10:28 2000
DO NOT EDIT!!! This file will be automatically
regenerated by qtarch. All changes will be lost.
result = UNDISPATCHED;
break;
case LFUN_CUT:
- if (!copySelection())
+ if (!copySelection(bv))
break;
bv->text->SetUndo(bv->buffer(), Undo::DELETE,
#ifndef NEW_INSETS
if (!hasSelection())
break;
bv->text->FinishUndo();
- copySelection();
+ copySelection(bv);
break;
case LFUN_PASTE:
if (!hasPasteBuffer())
result = UNDISPATCHED;
if (the_locking_inset)
break;
- if (ActivateCellInset(bv)) {
+ if (ActivateCellInset(bv, 0, 0, 0, !cellstart(cursor.pos()))) {
result=the_locking_inset->LocalDispatch(bv, action, arg);
if (result == DISPATCHED_NOUPDATE)
return result;
int InsetTabular::Ascii(Buffer const * buf, ostream & os, int) const
{
// This should be changed to a real ascii export
- return tabular->Latex(buf, os, false, false);
+ return tabular->Ascii(buf, os);
}
int lx = tabular->GetWidthOfColumn(actcell) -
tabular->GetAdditionalWidth(actcell);
#warning Jürgen, can you rewrite this to _not_ use the sequencing operator. (Lgb)
-#if 0
+#if 1
for(; !tabular->IsLastCellInRow(actcell) && (lx < x);
++actcell,lx += tabular->GetWidthOfColumn(actcell) +
tabular->GetAdditionalWidth(actcell - 1));
}
-bool InsetTabular::copySelection()
+bool InsetTabular::copySelection(BufferView * bv)
{
if (!hasSelection())
return false;
}
int rows = sel_row_end - sel_row_start + 1;
- paste_tabular = new LyXTabular(this, rows, columns);
-
- if (sel_cell_start > sel_cell_end) {
- //int tmp = sel_cell_start;
- //sel_cell_start = sel_cell_end;
- //sel_cell_end = tmp;
- swap(sel_cell_start, sel_cell_end);
- }
- for(int i = sel_cell_start, j = 0; i <= sel_cell_end; ++i, ++j) {
- while(paste_tabular->row_of_cell(j) <
- (tabular->row_of_cell(i)-sel_row_start)) {
- ++j;
- }
- while(paste_tabular->row_of_cell(j) >
- (tabular->row_of_cell(i)-sel_row_start)) {
- ++i;
- }
- *(paste_tabular->GetCellInset(j)) = *(tabular->GetCellInset(i));
- }
+ paste_tabular = new LyXTabular(this, *tabular); // rows, columns);
+ int i;
+ for(i=0; i < sel_row_start; ++i)
+ paste_tabular->DeleteRow(0);
+ while(paste_tabular->rows() > rows)
+ paste_tabular->DeleteRow(rows);
+ paste_tabular->SetTopLine(0, true, true);
+ paste_tabular->SetBottomLine(paste_tabular->GetFirstCellInRow(rows-1),
+ true, true);
+ for(i=0; i < sel_col_start; ++i)
+ paste_tabular->DeleteColumn(0);
+ while(paste_tabular->columns() > columns)
+ paste_tabular->DeleteColumn(columns);
+ paste_tabular->SetLeftLine(0, true, true);
+ paste_tabular->SetRightLine(paste_tabular->GetLastCellInRow(0),true, true);
+
+ ostringstream sstr;
+ paste_tabular->Ascii(bv->buffer(), sstr);
+ bv->stuffClipboard(sstr.str());
return true;
}
///
bool hasPasteBuffer() const;
///
- bool copySelection();
+ bool copySelection(BufferView *);
///
bool pasteSelection(BufferView *);
///
x += TEXT_TO_INSET_OFFSET;
int y = 0;
Row * row = TEXT(bv)->GetRowNearY(y);
- y += baseline - row->ascent_of_text();
+ int fa = row->ascent_of_text();
+ y += baseline - fa;
+ while (row != 0) {
+ if (((y+row->height()) > 0) && (y < pain.paperHeight()))
+ break;
+ y += row->height();
+ row = row->next();
+ }
+ TEXT(bv)->first = y - top_baseline + fa;
if (cleared || !locked || (need_update == FULL)) {
while (row != 0) {
- TEXT(bv)->GetVisibleRow(bv, int(y), int(x), row, y, cleared);
+ if (((y+row->height()) > 0) && (y < pain.paperHeight()))
+ TEXT(bv)->GetVisibleRow(bv, int(y), int(x), row, y, cleared);
y += row->height();
row = row->next();
}
old_par = 0;
if (!checkAndActivateInset(bv, x, y, button))
TEXT(bv)->SetCursorFromCoordinates(bv, x-drawTextXOffset,
- y+TEXT(bv)->first+insetAscent);
+ y+insetAscent);
TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
bv->text->FinishUndo();
ShowInsetCursor(bv);
paste_internally = true;
}
TEXT(bv)->SetCursorFromCoordinates(bv, x-drawTextXOffset,
- y+TEXT(bv)->first+insetAscent);
+ y+insetAscent);
TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
UpdateLocal(bv, CURSOR, false);
bv->owner()->setLayout(cpar(bv)->GetLayout());
if (!no_selection) {
HideInsetCursor(bv);
TEXT(bv)->SetCursorFromCoordinates(bv, x-drawTextXOffset,
- y+TEXT(bv)->first+insetAscent);
+ y+insetAscent);
TEXT(bv)->SetSelection();
if (TEXT(bv)->toggle_cursor.par()!=TEXT(bv)->toggle_end_cursor.par() ||
TEXT(bv)->toggle_cursor.pos()!=TEXT(bv)->toggle_end_cursor.pos())
LyXParagraph * p = par;
unsigned int lines = 0;
+ string tmp;
while (p) {
- string const tmp = buf->asciiParagraph(p, linelen);
+ tmp = buf->asciiParagraph(p, linelen);
lines += countChar(tmp, '\n');
os << tmp;
p = p->next;
}
- os << "\n";
- ++lines;
return lines;
}
if (fd_latex_log->LaTeXLog->visible) {
LatexLogUpdate(0,0);
}
- if (current_view->buffer()->isReadonly()) {
+ if (current_view->buffer() && current_view->buffer()->isReadonly()) {
// a little crude perhaps but it works. ARRae
if (fd_form_character->form_character->visible) {
fl_hide_form(fd_form_character->form_character);
}
if (owner->view()->available() && owner->view()->theLockingInset()) {
- text = owner->view()->theLockingInset()->getLyXText(owner->view());
UpdatableInset::RESULT result;
if ((action > 1) || ((action == LFUN_UNKNOWN_ACTION) &&
(keyseq.length >= -1)))
}
}
}
+ if (owner->view()->theLockingInset())
+ text = owner->view()->theLockingInset()->
+ getLyXText(owner->view());
}
if (!text)
break;
case LFUN_PRIOR:
- if(!owner->view()->text->mark_set)
- owner->view()->beforeChange();
+ if(!text->mark_set)
+ owner->view()->beforeChange();
owner->view()->update(BufferView::UPDATE);
- owner->view()->cursorPrevious();
+ owner->view()->cursorPrevious(text);
owner->view()->text->FinishUndo();
- moveCursorUpdate(false);
+ if (text->inset_owner)
+ owner->view()->updateInset(text->inset_owner, false);
+ else
+ moveCursorUpdate(false);
owner->showState();
break;
case LFUN_NEXT:
- if(!owner->view()->text->mark_set)
+ if(!text->mark_set)
owner->view()->beforeChange();
owner->view()->update(BufferView::UPDATE);
- owner->view()->cursorNext();
+ owner->view()->cursorNext(text);
owner->view()->text->FinishUndo();
- moveCursorUpdate(false);
+ if (text->inset_owner)
+ owner->view()->updateInset(text->inset_owner, false);
+ else
+ moveCursorUpdate(false);
owner->showState();
break;
case LFUN_PRIORSEL:
owner->view()->update(BufferView::SELECT|BufferView::FITCUR);
- owner->view()->cursorPrevious();
+ owner->view()->cursorPrevious(text);
owner->view()->text->FinishUndo();
- moveCursorUpdate(true);
+ if (text->inset_owner)
+ owner->view()->updateInset(text->inset_owner, false);
+ else
+ moveCursorUpdate(true);
owner->showState();
break;
case LFUN_NEXTSEL:
owner->view()->update(BufferView::SELECT|BufferView::FITCUR);
- owner->view()->cursorNext();
+ owner->view()->cursorNext(text);
owner->view()->text->FinishUndo();
- moveCursorUpdate(true);
+ if (text->inset_owner)
+ owner->view()->updateInset(text->inset_owner, false);
+ else
+ moveCursorUpdate(true);
owner->showState();
break;
bool LyXTabular::IsMultiColumn(int cell, bool real) const
{
return ((!real || (column_of_cell(cell) != right_column_of_cell(cell))) &&
- (cellinfo_of_cell(cell)->multicolumn !=LyXTabular::CELL_NORMAL));
+ (cellinfo_of_cell(cell)->multicolumn != LyXTabular::CELL_NORMAL));
}
}
if (tmp == (n - fcell)){
os << "\\hline ";
- } else {
+ } else if (tmp) {
for (int i = fcell; i < n; ++i) {
if (TopLine(i)) {
os << "\\cline{"
<< "} ";
}
}
+ } else {
+ return 0;
}
- if (tmp) {
- os << endl;
- return 1;
- }
- return 0;
+ os << endl;
+ return 1;
}
}
if (tmp == (n-fcell)){
os << "\\hline";
- } else {
+ } else if (tmp) {
for (int i = fcell; i < n; ++i) {
if (BottomLine(i)) {
os << "\\cline{"
<< "} ";
}
}
+ } else {
+ return 0;
}
- if (tmp) {
- os << endl;
- return 1;
- }
- return 0;
+ os << endl;
+ return 1;
}
}
+static void print_n_chars(ostream & os, unsigned char ch, int const n)
+{
+ for(int i=0; i < n; ++i)
+ os << ch;
+}
+
+int LyXTabular::AsciiTopHLine(ostream & os, int row,
+ vector<unsigned int> const & clen) const
+{
+ int const fcell = GetFirstCellInRow(row);
+ int const n = NumberOfCellsInRow(fcell) + fcell;
+ int len;
+ int column = 0;
+ unsigned char ch;
+ int tmp = 0;
+
+ for (int i = fcell; i < n; ++i) {
+ if (TopLine(i))
+ ++tmp;
+ }
+ if (!tmp)
+ return 0;
+
+ for (int i = fcell; i < n; ++i) {
+ if (TopLine(i)) {
+ if (LeftLine(i))
+ os << "+-";
+ else
+ os << "--";
+ ch = '-';
+ } else {
+ os << " ";
+ ch = ' ';
+ }
+ column = column_of_cell(i);
+ len = clen[column];
+ while(IsPartOfMultiColumn(row, ++column))
+ len += clen[column] + 4;
+ print_n_chars(os, ch, len);
+ if (TopLine(i)) {
+ if (RightLine(i))
+ os << "-+";
+ else
+ os << "--";
+ } else {
+ os << " ";
+ }
+ }
+ os << endl;
+ return 1;
+}
+
+
+int LyXTabular::AsciiBottomHLine(ostream & os, int row,
+ vector<unsigned int> const & clen) const
+{
+ int const fcell = GetFirstCellInRow(row);
+ int const n = NumberOfCellsInRow(fcell) + fcell;
+ int len;
+ int column = 0;
+ unsigned char ch;
+ int tmp = 0;
+
+ for (int i = fcell; i < n; ++i) {
+ if (BottomLine(i))
+ ++tmp;
+ }
+ if (!tmp)
+ return 0;
+
+ for (int i = fcell; i < n; ++i) {
+ if (BottomLine(i)) {
+ if (LeftLine(i))
+ os << "+-";
+ else
+ os << "--";
+ ch = '-';
+ } else {
+ os << " ";
+ ch = ' ';
+ }
+ column = column_of_cell(i);
+ len = clen[column];
+ while(IsPartOfMultiColumn(row, ++column))
+ len += clen[column] + 4;
+ print_n_chars(os, ch, len);
+ if (BottomLine(i)) {
+ if (RightLine(i))
+ os << "-+";
+ else
+ os << "--";
+ } else {
+ os << " ";
+ }
+ }
+ os << endl;
+ return 1;
+}
+
+
+int LyXTabular::AsciiPrintCell(Buffer const * buf, ostream & os,
+ int cell, int row, int column,
+ vector<unsigned int> const & clen) const
+{
+ ostringstream sstr;
+ int ret = GetCellInset(cell)->Ascii(buf, sstr, 0);
+
+ if (LeftLine(cell))
+ os << "| ";
+ else
+ os << " ";
+
+ unsigned int len1 = sstr.str().length();
+ unsigned int len2 = clen[column];
+ while(IsPartOfMultiColumn(row, ++column))
+ len2 += clen[column] + 4;
+ len2 -= len1;
+
+ switch(GetAlignment(cell)) {
+ default:
+ case LYX_ALIGN_LEFT:
+ len1 = 0;
+ break;
+ case LYX_ALIGN_RIGHT:
+ len1 = len2;
+ len2 = 0;
+ break;
+ case LYX_ALIGN_CENTER:
+ len1 = len2 / 2;
+ len2 -= len1;
+ break;
+ }
+
+ unsigned int i;
+ for(i=0; i < len1; ++i)
+ os << " ";
+ os << sstr.str();
+ for(i=0; i < len2; ++i)
+ os << " ";
+ if (RightLine(cell))
+ os << " |";
+ else
+ os << " ";
+
+ return ret * 0;
+}
+
+
+int LyXTabular::Ascii(Buffer const * buf, ostream & os) const
+{
+ int ret = 0;
+
+ //+---------------------------------------------------------------------
+ //+ first calculate the width of the single columns +
+ //+---------------------------------------------------------------------
+ vector<unsigned int> clen(columns_);
+ int cell;
+
+ // first all non (real) multicolumn cells!
+ for(int j = 0; j < columns_; ++j) {
+ clen[j] = 0;
+ for(int i = 0; i < rows_; ++i) {
+ cell = GetCellNumber(i, j);
+ if (IsMultiColumn(cell, true))
+ continue;
+ ostringstream sstr;
+ (void)GetCellInset(cell)->Ascii(buf, sstr, 0);
+ if (clen[j] < sstr.str().length())
+ clen[j] = sstr.str().length();
+ }
+ }
+ // then all (real) multicolumn cells!
+ for(int j = 0; j < columns_; ++j) {
+ for(int i = 0; i < rows_; ++i) {
+ cell = GetCellNumber(i, j);
+ if (!IsMultiColumn(cell, true) || IsPartOfMultiColumn(i, j))
+ continue;
+ ostringstream sstr;
+ (void)GetCellInset(cell)->Ascii(buf, sstr, 0);
+ int len = (int)sstr.str().length();
+ int n = cells_in_multicolumn(cell);
+ for (int k = j; (len > 0) && (k < (j+n-1)); ++k)
+ len -= clen[k];
+ if (len > (int)clen[j+n-1])
+ clen[j+n-1] = len;
+ }
+ }
+ cell = 0;
+ for(int i = 0; i < rows_; ++i) {
+ AsciiTopHLine(os, i, clen);
+ for(int j = 0; j < columns_; ++j) {
+ if (IsPartOfMultiColumn(i,j))
+ continue;
+ ret += AsciiPrintCell(buf, os, cell, i, j, clen);
+ ++cell;
+ }
+ os << endl;
+ AsciiBottomHLine(os, i, clen);
+ }
+}
+
+
InsetText * LyXTabular::GetCellInset(int cell) const
{
return & cell_info[row_of_cell(cell)][column_of_cell(cell)].inset;
///
void AppendRow(int cell);
///
- void DeleteRow(int cell);
+ void DeleteRow(int row);
///
void AppendColumn(int cell);
///
- void DeleteColumn(int cell);
+ void DeleteColumn(int column);
///
bool IsFirstCellInRow(int cell) const;
///
///
int Latex(Buffer const *, std::ostream &, bool, bool) const;
///
+ // helper function for Latex returns number of newlines
+ ///
+ int AsciiTopHLine(std::ostream &, int row,
+ vector<unsigned int> const &) const;
+ ///
+ int AsciiBottomHLine(std::ostream &, int row,
+ vector<unsigned int> const &) const;
+ ///
+ int AsciiPrintCell(Buffer const *, std::ostream &, int cell, int row,
+ int column, vector<unsigned int> const &) const;
+ ///
+ int Ascii(Buffer const *, std::ostream &) const;
+ ///
int DocBookEndOfCell(std::ostream &, int cell, int & depth) const;
#if 0
///
Row * LyXText::GetRow(LyXParagraph * par,
LyXParagraph::size_type pos, int & y) const
{
+ if (!firstrow)
+ return 0;
+
Row * tmprow = firstrow;
y = 0;