From bcbfc72c471223c17ff857309af3756c01996d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Tue, 15 Oct 2002 18:29:01 +0000 Subject: [PATCH] transpose const char git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5423 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 14 +++-- src/frontends/qt2/QBrowseBox.C | 48 ++++++++--------- src/frontends/qt2/QDocument.C | 97 ++++++++++++++++------------------ 3 files changed, 78 insertions(+), 81 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 222a443e02..82a40093ce 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2002-10-15 Lars Gullik Bjønnes + + * QBrowseBox.C (QBrowseBox): transpose const char + 2002-10-15 Angus Leeming * QBrowseBox.C (c-tor): default values should go only in the .h file. @@ -20,7 +24,7 @@ * qfont_loader.C (available): Implemented. 2002-10-09 Edwin Leuven - + * QDocument.C: Brand new document dialog * QDocument.h: * QDocumentDialog.C: @@ -51,7 +55,7 @@ * ui/QGraphicsDialog.ui: * ui/QPrintDialog.ui: * ui/QRefDialog.ui: - + 2002-09-28 Juergen Spitzmueller * ui/QWrapDialog.ui: @@ -61,7 +65,7 @@ * Dialogs.C: * Dialogs2.C: * Dialogs_impl.h: Implement Wrap figure dialog - + 2002-09-25 Angus Leeming * Dialogs2.C: @@ -76,8 +80,8 @@ 2002-09-24 Lars Gullik Bjønnes * ui/moc/Makefile.am (INCLUDES): - * ui/Makefile.am (INCLUDES): - * moc/Makefile.am (INCLUDES): + * ui/Makefile.am (INCLUDES): + * moc/Makefile.am (INCLUDES): * Makefile.am (INCLUDES): loose SIGC_INCLUDES 2002-09-24 John Levon diff --git a/src/frontends/qt2/QBrowseBox.C b/src/frontends/qt2/QBrowseBox.C index 51fb7180d3..0ddc6f6edf 100644 --- a/src/frontends/qt2/QBrowseBox.C +++ b/src/frontends/qt2/QBrowseBox.C @@ -2,7 +2,7 @@ * \file QBrowseBox.C * * Original file taken from klyx 0.10 sources: - * $Id: QBrowseBox.C,v 1.2 2002/10/15 17:45:12 leeming Exp $ + * $Id: QBrowseBox.C,v 1.3 2002/10/15 18:29:01 larsbj Exp $ * * \author Kalle Dalheimer ? * @@ -26,7 +26,7 @@ QBrowseBox::QBrowseBox(int rows, int cols, QWidget * parent, - const char * name, WFlags fl) + char const * name, WFlags fl) : QGridView() { setNumRows( rows ); @@ -34,8 +34,8 @@ QBrowseBox::QBrowseBox(int rows, int cols, QWidget * parent, setCellWidth( width()/cols ); setCellHeight( height()/rows ); - _texts = new QString[rows*cols]; - _pixmaps = new QPixmap[rows*cols]; + _texts = new QString[rows * cols]; + _pixmaps = new QPixmap[rows * cols]; _activecell.setX( 0 ); _activecell.setY( 0 ); @@ -67,13 +67,13 @@ int QBrowseBox::coordsToIndex( int row, int col ) return row + col*numCols(); } - + void QBrowseBox::insertItem( const QString& text, int row, int col ) { _texts[ coordsToIndex( row, col ) ] = text; } - + void QBrowseBox::insertItem( QPixmap pixmap, int row, int col ) { _pixmaps[ coordsToIndex( row, col ) ] = pixmap; @@ -83,9 +83,9 @@ void QBrowseBox::insertItem( QPixmap pixmap) { int w = (pixmap.width()/numCols()); int h = (pixmap.height()/numRows()); - + for( int row = 0; row < numRows(); row++ ) - for( int col = 0; col < numCols(); col++ ) + for( int col = 0; col < numCols(); col++ ) { QPixmap small(w,h); bitBlt(&small,0,0,&pixmap,col*w,row*h,w,h,Qt::CopyROP,false); @@ -95,14 +95,14 @@ void QBrowseBox::insertItem( QPixmap pixmap) resize(pixmap.width() + (numCols()+1)*frameWidth(), pixmap.height() +(numRows()+1)*frameWidth()); } - + void QBrowseBox::removeItem( int row, int col ) { _texts[ coordsToIndex( row, col ) ] = ""; _pixmaps[ coordsToIndex( row, col ) ].resize( 0, 0 ); } - + void QBrowseBox::clear() { for( int row = 0; row < numRows(); row++ ) @@ -110,7 +110,7 @@ void QBrowseBox::clear() removeItem( row, col ); } - + QString QBrowseBox::text( int row, int col ) { if( col<0 || col >= numCols() || row<0 || row >= numRows() ) @@ -118,7 +118,7 @@ QString QBrowseBox::text( int row, int col ) return _texts[ coordsToIndex( row, col ) ]; } - + QPixmap QBrowseBox::pixmap( int row, int col ) { static QPixmap empty; @@ -149,7 +149,7 @@ void QBrowseBox::keyPressEvent( QKeyEvent* e ) default: e->ignore(); } - + } void QBrowseBox::mouseReleaseEvent( QMouseEvent* e ) @@ -168,7 +168,7 @@ void QBrowseBox::paintCell( class QPainter * painter, int row, int col ) { painter->setClipRect(cellGeometry(row,col));//, QPainter::CoordPainter); bool ispixmap = false; - + if( ! _pixmaps[coordsToIndex(row,col)].isNull() ) { painter->drawPixmap(0,0,_pixmaps[coordsToIndex(row,col)]); ispixmap = true; @@ -212,7 +212,7 @@ void QBrowseBox::mouseMoveEvent( QMouseEvent* e ) int cellx; int celly; - + if( x < 0 || y < 0 || x > width() || y > height() ) { // outside the box cellx = -1; @@ -233,17 +233,17 @@ void QBrowseBox::mouseMoveEvent( QMouseEvent* e ) // remove old highlighting updateCell( oldactivecellx, oldactivecelly ); // set new highlighting - updateCell( _activecell.x(), _activecell.y() ); + updateCell( _activecell.x(), _activecell.y() ); } } void QBrowseBox::moveLeft( ) { int const y = _activecell.y(); - + if (y>0) _activecell.setY(y-1); - + updateCell(_activecell.x(), y); updateCell(_activecell.x(), _activecell.y()); } @@ -251,10 +251,10 @@ void QBrowseBox::moveLeft( ) void QBrowseBox::moveRight( ) { int const y = _activecell.y(); - + if (y0) _activecell.setX(x-1); - + updateCell(x, _activecell.y()); updateCell(_activecell.x(),_activecell.y()); } @@ -273,10 +273,10 @@ void QBrowseBox::moveUp( ) void QBrowseBox::moveDown( ) { int const x = _activecell.x(); - + if (xlangModule->languageCO->insertItem( lit->first.c_str()); } - + dialog_->langModule->quoteStyleCO->insertItem(_("``text''")); dialog_->langModule->quoteStyleCO->insertItem(_("''text''")); dialog_->langModule->quoteStyleCO->insertItem(_(",,text``")); @@ -87,7 +87,7 @@ void QDocument::build_dialog() "koi8-r","koi8-u","cp866","cp1251", "iso88595","pt154",0}; dialog_->packagesModule->encodingCO->insertStrList(items); - + dialog_->packagesModule->lspacingCO->insertItem( _("Single"),Spacing::Single); dialog_->packagesModule->lspacingCO->insertItem( @@ -120,12 +120,12 @@ void QDocument::build_dialog() QString font = tex_fonts[n]; dialog_->layoutModule->fontsCO->insertItem(font); } - + dialog_->layoutModule->fontsizeCO->insertItem(_("default")); dialog_->layoutModule->fontsizeCO->insertItem(_("10")); dialog_->layoutModule->fontsizeCO->insertItem(_("11")); dialog_->layoutModule->fontsizeCO->insertItem(_("12")); - + dialog_->layoutModule->skipCO->insertItem(_("Smallskip")); dialog_->layoutModule->skipCO->insertItem(_("Medskip")); dialog_->layoutModule->skipCO->insertItem(_("Bigskip")); @@ -143,7 +143,7 @@ void QDocument::build_dialog() string const bmtablefile = LibFileSearch("images", "standard", "xpm"); QString s = bmtablefile.c_str(); qWarning("%d",s); - + // Manage the restore, ok, apply, restore and cancel/close buttons bc().setOK(dialog_->okPB); bc().setApply(dialog_->applyPB); @@ -157,7 +157,7 @@ void QDocument::apply() /* preamble */ controller().params().preamble = dialog_->preambleModule->preambleMLE->text().latin1(); - + /* biblio */ controller().params().use_natbib = dialog_->biblioModule->natbibCB->isChecked(); @@ -170,7 +170,7 @@ void QDocument::apply() else controller().params().quotes_times = InsetQuotes::DoubleQ; - + InsetQuotes::quote_language lga = InsetQuotes::EnglishQ; switch (dialog_->langModule->quoteStyleCO->currentItem()) { case 0: @@ -221,13 +221,13 @@ void QDocument::apply() ); break; } - + controller().params().graphicsDriver = dialog_->packagesModule->psdriverCO->currentText().latin1(); - + controller().params().use_amsmath = dialog_->packagesModule->amsCB->isChecked(); - + controller().params().inputenc = dialog_->packagesModule->encodingCO->currentText().latin1(); @@ -236,16 +236,16 @@ void QDocument::apply() dialog_->layoutModule->classCO->currentItem(); //bool succes = controller().classApply(); - + controller().params().fonts = dialog_->layoutModule->fontsCO->currentText().latin1(); - + controller().params().fontsize = dialog_->layoutModule->fontsizeCO->currentText().latin1(); - + controller().params().pagestyle = dialog_->layoutModule->pagestyleCO->currentText().latin1(); - + if (dialog_->layoutModule->indentRB->isChecked()) controller().params().paragraph_separation = BufferParams::PARSEP_INDENT; else @@ -280,14 +280,14 @@ void QDocument::apply() controller().params().options = dialog_->layoutModule->optionsLE->text().latin1(); - + controller().params().float_placement = dialog_->layoutModule->floatPlacementLE->text().latin1(); /* paper */ controller().params().papersize2 = dialog_->paperModule->papersizeCO->currentItem(); - + controller().params().paperwidth = LyXLength(dialog_->paperModule->paperwidthLE->text().toDouble(), dialog_->paperModule->paperwidthUnitCO->currentLengthItem() @@ -302,12 +302,12 @@ void QDocument::apply() controller().params().columns = 2; else controller().params().columns = 1; - + if (dialog_->paperModule->facingPagesCB->isChecked()) controller().params().sides = LyXTextClass::TwoSides; else controller().params().sides = LyXTextClass::OneSide; - + if (dialog_->paperModule->landscapeRB->isChecked()) controller().params().orientation = BufferParams::ORIENTATION_LANDSCAPE; else @@ -322,12 +322,12 @@ void QDocument::apply() margin = margin - 1; } controller().params().paperpackage = char(margin); - + controller().params().leftmargin = LyXLength(dialog_->marginsModule->innerLE->text().toDouble(), dialog_->marginsModule->innerUnit->currentLengthItem() ).asString(); - + controller().params().topmargin = LyXLength(dialog_->marginsModule->topLE->text().toDouble(), dialog_->marginsModule->topUnit->currentLengthItem() @@ -397,13 +397,13 @@ void QDocument::update_contents() controller().params().use_natbib); dialog_->biblioModule->citeStyleCO->setCurrentItem( controller().params().use_numerical_citations ? 1 : 0); - + /* language & quotes */ dialog_->langModule->singleQuoteRB->setChecked( controller().params().quotes_times == InsetQuotes::SingleQ); dialog_->langModule->doubleQuoteRB->setChecked( controller().params().quotes_times == InsetQuotes::DoubleQ); - + int const pos = int(findPos(lang_, controller().params().language->lang())); dialog_->langModule->languageCO->setCurrentItem(pos); @@ -430,8 +430,8 @@ void QDocument::update_contents() } ++pos2; } - - + + QString text = controller().params().graphicsDriver.c_str(); int nitem = dialog_->packagesModule->psdriverCO->count(); for (int n=0; npackagesModule->psdriverCO->setCurrentItem(n); } } - - + + dialog_->packagesModule->amsCB->setChecked( controller().params().use_amsmath); @@ -465,11 +465,11 @@ void QDocument::update_contents() dialog_->updateFontsize(controller().textClass().opt_fontsize(), controller().params().fontsize); - + dialog_->updatePagestyle(controller().textClass().opt_pagestyle(), controller().params().pagestyle); - - + + for (int n=0; tex_fonts[n][0]; ++n) { if (tex_fonts[n]==controller().params().fonts) { dialog_->layoutModule->fontsCO->setCurrentItem(n); @@ -483,7 +483,7 @@ void QDocument::update_contents() } else { dialog_->layoutModule->skipRB->setChecked(true); } - + int skip = 0; switch (controller().params().getDefSkip().kind()) { case VSpace::SMALLSKIP: @@ -516,7 +516,7 @@ void QDocument::update_contents() } else { dialog_->layoutModule->optionsLE->setText(""); } - + /* paper */ int const psize = controller().params().papersize2; dialog_->paperModule->papersizeCO->setCurrentItem(psize); @@ -530,22 +530,22 @@ void QDocument::update_contents() dialog_->paperModule->facingPagesCB->setChecked( controller().params().sides == LyXTextClass::TwoSides); - + dialog_->paperModule->twoColumnCB->setChecked( controller().params().columns == 2); - + dialog_->paperModule->paperwidthUnitCO->setCurrentItem( LyXLength(controller().params().paperwidth).unit()); - + dialog_->paperModule->paperwidthLE->setText( tostr(LyXLength(controller().params().paperwidth).value()).c_str()); - + dialog_->paperModule->paperheightUnitCO->setCurrentItem( LyXLength(controller().params().paperheight).unit()); dialog_->paperModule->paperheightLE->setText( tostr(LyXLength(controller().params().paperheight).value()).c_str()); - + /* margins */ int item = controller().params().paperpackage; if (controller().params().use_geometry) { @@ -560,43 +560,36 @@ void QDocument::update_contents() LyXLength(controller().params().topmargin).unit()); dialog_->marginsModule->topLE->setText( tostr(LyXLength(controller().params().topmargin).value()).c_str()); - + dialog_->marginsModule->bottomUnit->setCurrentItem( LyXLength(controller().params().bottommargin).unit()); dialog_->marginsModule->bottomLE->setText( tostr(LyXLength(controller().params().bottommargin).value()).c_str()); - + dialog_->marginsModule->innerUnit->setCurrentItem( LyXLength(controller().params().leftmargin).unit()); dialog_->marginsModule->innerLE->setText( tostr(LyXLength(controller().params().leftmargin).value()).c_str()); - + dialog_->marginsModule->outerUnit->setCurrentItem( LyXLength(controller().params().rightmargin).unit()); dialog_->marginsModule->outerLE->setText( tostr(LyXLength(controller().params().rightmargin).value()).c_str()); - + dialog_->marginsModule->headheightUnit->setCurrentItem( LyXLength(controller().params().headheight).unit()); dialog_->marginsModule->headheightLE->setText( tostr(LyXLength(controller().params().headheight).value()).c_str()); - + dialog_->marginsModule->headsepUnit->setCurrentItem( LyXLength(controller().params().headsep).unit()); dialog_->marginsModule->headsepLE->setText( tostr(LyXLength(controller().params().headsep).value()).c_str()); - + dialog_->marginsModule->footskipUnit->setCurrentItem( LyXLength(controller().params().footskip).unit()); dialog_->marginsModule->footskipLE->setText( tostr(LyXLength(controller().params().footskip).value()).c_str()); - - + + } - - - - - - -