Fixed center mousebutton-pastes into ERT insets.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2908 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2001-10-22 09:45:31 +00:00
parent 970f0247f7
commit 0677c7b0c9
7 changed files with 92 additions and 71 deletions

View File

@ -1,25 +1,21 @@
src/buffer.C
src/bufferlist.C
src/BufferView2.C src/BufferView2.C
src/bufferview_funcs.C
src/BufferView_pimpl.C src/BufferView_pimpl.C
src/Chktex.C src/Chktex.C
src/ColorHandler.C src/ColorHandler.C
src/CutAndPaste.C
src/FontLoader.C
src/LColor.C
src/LaTeX.C
src/LyXAction.C
src/LyXSendto.C
src/LyXView.C
src/MenuBackend.C
src/buffer.C
src/bufferlist.C
src/bufferview_funcs.C
src/converter.C src/converter.C
src/CutAndPaste.C
src/debug.C src/debug.C
src/exporter.C src/exporter.C
src/ext_l10n.h src/ext_l10n.h
src/figureForm.C
src/figure_form.C src/figure_form.C
src/figureForm.C
src/FontLoader.C
src/frontends/controllers/biblio.C
src/frontends/controllers/ButtonController.h src/frontends/controllers/ButtonController.h
src/frontends/controllers/character.C
src/frontends/controllers/ControlAboutlyx.C src/frontends/controllers/ControlAboutlyx.C
src/frontends/controllers/ControlBibtex.C src/frontends/controllers/ControlBibtex.C
src/frontends/controllers/ControlCharacter.C src/frontends/controllers/ControlCharacter.C
@ -32,8 +28,6 @@ src/frontends/controllers/ControlSearch.C
src/frontends/controllers/ControlSpellchecker.C src/frontends/controllers/ControlSpellchecker.C
src/frontends/controllers/ControlTexinfo.C src/frontends/controllers/ControlTexinfo.C
src/frontends/controllers/ControlThesaurus.C src/frontends/controllers/ControlThesaurus.C
src/frontends/controllers/biblio.C
src/frontends/controllers/character.C
src/frontends/controllers/helper_funcs.C src/frontends/controllers/helper_funcs.C
src/frontends/gnome/FormCitation.C src/frontends/gnome/FormCitation.C
src/frontends/gnome/FormIndex.C src/frontends/gnome/FormIndex.C
@ -42,6 +36,7 @@ src/frontends/gnome/FormRef.C
src/frontends/gnome/FormToc.C src/frontends/gnome/FormToc.C
src/frontends/gnome/Menubar_pimpl.C src/frontends/gnome/Menubar_pimpl.C
src/frontends/qt2/FileDialog.C src/frontends/qt2/FileDialog.C
src/frontends/qt2/lengthcombo.C
src/frontends/qt2/QAbout.C src/frontends/qt2/QAbout.C
src/frontends/qt2/QBibitem.C src/frontends/qt2/QBibitem.C
src/frontends/qt2/QBibtex.C src/frontends/qt2/QBibtex.C
@ -50,8 +45,8 @@ src/frontends/qt2/QCharacter.C
src/frontends/qt2/QCitation.C src/frontends/qt2/QCitation.C
src/frontends/qt2/QCitationDialog.C src/frontends/qt2/QCitationDialog.C
src/frontends/qt2/QDocument.C src/frontends/qt2/QDocument.C
src/frontends/qt2/QERT.C
src/frontends/qt2/QError.C src/frontends/qt2/QError.C
src/frontends/qt2/QERT.C
src/frontends/qt2/QExternal.C src/frontends/qt2/QExternal.C
src/frontends/qt2/QExternalDialog.C src/frontends/qt2/QExternalDialog.C
src/frontends/qt2/QGraphics.C src/frontends/qt2/QGraphics.C
@ -73,87 +68,86 @@ src/frontends/qt2/QThesaurus.C
src/frontends/qt2/QToc.C src/frontends/qt2/QToc.C
src/frontends/qt2/QURL.C src/frontends/qt2/QURL.C
src/frontends/qt2/QVCLog.C src/frontends/qt2/QVCLog.C
src/frontends/qt2/lengthcombo.C src/frontends/xforms/combox.C
src/frontends/xforms/FileDialog.C src/frontends/xforms/FileDialog.C
src/frontends/xforms/form_aboutlyx.C
src/frontends/xforms/FormAboutlyx.C src/frontends/xforms/FormAboutlyx.C
src/frontends/xforms/form_bibitem.C
src/frontends/xforms/FormBibitem.C src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibtex.C
src/frontends/xforms/FormBibtex.C src/frontends/xforms/FormBibtex.C
src/frontends/xforms/form_browser.C
src/frontends/xforms/form_character.C
src/frontends/xforms/FormCharacter.C src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_citation.C
src/frontends/xforms/FormCitation.C src/frontends/xforms/FormCitation.C
src/frontends/xforms/form_document.C
src/frontends/xforms/FormDocument.C src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormERT.C src/frontends/xforms/form_error.C
src/frontends/xforms/FormError.C src/frontends/xforms/FormError.C
src/frontends/xforms/form_ert.C
src/frontends/xforms/FormERT.C
src/frontends/xforms/form_external.C
src/frontends/xforms/FormExternal.C src/frontends/xforms/FormExternal.C
src/frontends/xforms/form_filedialog.C
src/frontends/xforms/FormFiledialog.C src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/form_float.C
src/frontends/xforms/FormFloat.C src/frontends/xforms/FormFloat.C
src/frontends/xforms/form_graphics.C
src/frontends/xforms/FormGraphics.C src/frontends/xforms/FormGraphics.C
src/frontends/xforms/form_include.C
src/frontends/xforms/FormInclude.C src/frontends/xforms/FormInclude.C
src/frontends/xforms/form_index.C
src/frontends/xforms/FormIndex.C src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormLog.C src/frontends/xforms/FormLog.C
src/frontends/xforms/FormMathsBitmap.C src/frontends/xforms/FormMathsBitmap.C
src/frontends/xforms/form_maths_deco.C
src/frontends/xforms/FormMathsDeco.C src/frontends/xforms/FormMathsDeco.C
src/frontends/xforms/form_maths_delim.C
src/frontends/xforms/FormMathsDelim.C src/frontends/xforms/FormMathsDelim.C
src/frontends/xforms/form_maths_matrix.C
src/frontends/xforms/FormMathsMatrix.C src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/form_maths_panel.C
src/frontends/xforms/FormMathsPanel.C src/frontends/xforms/FormMathsPanel.C
src/frontends/xforms/form_maths_space.C
src/frontends/xforms/FormMathsSpace.C src/frontends/xforms/FormMathsSpace.C
src/frontends/xforms/form_minipage.C
src/frontends/xforms/FormMinipage.C src/frontends/xforms/FormMinipage.C
src/frontends/xforms/form_paragraph.C
src/frontends/xforms/FormParagraph.C src/frontends/xforms/FormParagraph.C
src/frontends/xforms/form_preamble.C
src/frontends/xforms/FormPreamble.C src/frontends/xforms/FormPreamble.C
src/frontends/xforms/form_preferences.C
src/frontends/xforms/FormPreferences.C src/frontends/xforms/FormPreferences.C
src/frontends/xforms/form_print.C
src/frontends/xforms/FormPrint.C src/frontends/xforms/FormPrint.C
src/frontends/xforms/form_ref.C
src/frontends/xforms/FormRef.C src/frontends/xforms/FormRef.C
src/frontends/xforms/form_search.C
src/frontends/xforms/FormSearch.C src/frontends/xforms/FormSearch.C
src/frontends/xforms/form_spellchecker.C
src/frontends/xforms/FormSpellchecker.C src/frontends/xforms/FormSpellchecker.C
src/frontends/xforms/form_tabular.C
src/frontends/xforms/FormTabular.C src/frontends/xforms/FormTabular.C
src/frontends/xforms/form_tabular_create.C
src/frontends/xforms/FormTabularCreate.C src/frontends/xforms/FormTabularCreate.C
src/frontends/xforms/form_texinfo.C
src/frontends/xforms/FormTexinfo.C src/frontends/xforms/FormTexinfo.C
src/frontends/xforms/form_thesaurus.C
src/frontends/xforms/FormThesaurus.C src/frontends/xforms/FormThesaurus.C
src/frontends/xforms/form_toc.C
src/frontends/xforms/FormToc.C src/frontends/xforms/FormToc.C
src/frontends/xforms/form_url.C
src/frontends/xforms/FormUrl.C src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormVCLog.C src/frontends/xforms/FormVCLog.C
src/frontends/xforms/Menubar_pimpl.C
src/frontends/xforms/combox.C
src/frontends/xforms/form_aboutlyx.C
src/frontends/xforms/form_bibitem.C
src/frontends/xforms/form_bibtex.C
src/frontends/xforms/form_browser.C
src/frontends/xforms/form_character.C
src/frontends/xforms/form_citation.C
src/frontends/xforms/form_document.C
src/frontends/xforms/form_error.C
src/frontends/xforms/form_ert.C
src/frontends/xforms/form_external.C
src/frontends/xforms/form_filedialog.C
src/frontends/xforms/form_float.C
src/frontends/xforms/form_graphics.C
src/frontends/xforms/form_include.C
src/frontends/xforms/form_index.C
src/frontends/xforms/form_maths_deco.C
src/frontends/xforms/form_maths_delim.C
src/frontends/xforms/form_maths_matrix.C
src/frontends/xforms/form_maths_panel.C
src/frontends/xforms/form_maths_space.C
src/frontends/xforms/form_minipage.C
src/frontends/xforms/form_paragraph.C
src/frontends/xforms/form_preamble.C
src/frontends/xforms/form_preferences.C
src/frontends/xforms/form_print.C
src/frontends/xforms/form_ref.C
src/frontends/xforms/form_search.C
src/frontends/xforms/form_spellchecker.C
src/frontends/xforms/form_tabular.C
src/frontends/xforms/form_tabular_create.C
src/frontends/xforms/form_texinfo.C
src/frontends/xforms/form_thesaurus.C
src/frontends/xforms/form_toc.C
src/frontends/xforms/form_url.C
src/frontends/xforms/input_validators.C src/frontends/xforms/input_validators.C
src/frontends/xforms/Menubar_pimpl.C
src/frontends/xforms/xforms_helpers.C src/frontends/xforms/xforms_helpers.C
src/gettext.h src/gettext.h
src/importer.C src/importer.C
src/insets/figinset.C src/insets/figinset.C
src/insets/inset.C
src/insets/insetbib.C src/insets/insetbib.C
src/insets/inset.C
src/insets/insetcaption.C src/insets/insetcaption.C
src/insets/inseterror.C src/insets/inseterror.C
src/insets/insetert.C src/insets/insetert.C
@ -178,19 +172,25 @@ src/insets/insettoc.C
src/insets/inseturl.C src/insets/inseturl.C
src/kbsequence.C src/kbsequence.C
src/language.C src/language.C
src/LaTeX.C
src/layout.C src/layout.C
src/LColor.C
src/LyXAction.C
src/lyx_cb.C src/lyx_cb.C
src/lyx_gui_misc.C
src/lyx_main.C
src/lyxfind.C src/lyxfind.C
src/lyxfont.C src/lyxfont.C
src/lyxfunc.C src/lyxfunc.C
src/lyx_gui_misc.C
src/lyx_main.C
src/lyxrc.C src/lyxrc.C
src/LyXSendto.C
src/lyxvc.C src/lyxvc.C
src/mathed/formula.C src/LyXView.C
src/mathed/formulabase.C src/mathed/formulabase.C
src/mathed/formula.C
src/mathed/formulamacro.C src/mathed/formulamacro.C
src/mathed/math_cursor.C src/mathed/math_cursor.C
src/MenuBackend.C
src/minibuffer.C src/minibuffer.C
src/paragraph.C src/paragraph.C
src/print_form.C src/print_form.C
@ -199,6 +199,6 @@ src/support/getUserName.C
src/support/path.C src/support/path.C
src/support/path.h src/support/path.h
src/tabular.C src/tabular.C
src/text.C
src/text2.C src/text2.C
src/text.C
src/ext_l10n.h src/ext_l10n.h

View File

@ -564,7 +564,7 @@ void BufferView::Pimpl::workAreaMotionNotify(int x, int y, unsigned int state)
// Single-click on work area // Single-click on work area
void BufferView::Pimpl::workAreaButtonPress(int xpos, int ypos, void BufferView::Pimpl::workAreaButtonPress(int xpos, int ypos,
unsigned int button) unsigned int button)
{ {
if (!buffer_ || !screen_.get()) return; if (!buffer_ || !screen_.get()) return;
@ -589,9 +589,7 @@ void BufferView::Pimpl::workAreaButtonPress(int xpos, int ypos,
otherwise give the event to the inset */ otherwise give the event to the inset */
if (inset_hit == bv_->theLockingInset()) { if (inset_hit == bv_->theLockingInset()) {
bv_->theLockingInset()-> bv_->theLockingInset()->
insetButtonPress(bv_, insetButtonPress(bv_,xpos, ypos,button);
xpos, ypos,
button);
return; return;
} else { } else {
bv_->unlockInset(bv_->theLockingInset()); bv_->unlockInset(bv_->theLockingInset());

View File

@ -1,3 +1,8 @@
2001-10-22 Juergen Vigna <jug@sad.it>
* buffer.C (insertStringAsLines): modify the font for inserting
chars in certain conditions by calling checkInsertChar(font).
2001-10-19 Juergen Vigna <jug@sad.it> 2001-10-19 Juergen Vigna <jug@sad.it>
* text.C (workWidth): use getRow instead of wrong algorithm. * text.C (workWidth): use getRow instead of wrong algorithm.

View File

@ -1340,11 +1340,13 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
// needed to insert the selection // needed to insert the selection
void Buffer::insertStringAsLines(Paragraph *& par, Paragraph::size_type & pos, void Buffer::insertStringAsLines(Paragraph *& par, Paragraph::size_type & pos,
LyXFont const & font, LyXFont const & fn,string const & str) const
string const & str) const
{ {
LyXLayout const & layout = textclasslist.Style(params.textclass, LyXLayout const & layout = textclasslist.Style(params.textclass,
par->getLayout()); par->getLayout());
LyXFont font = fn;
(void)par->checkInsertChar(font);
// insert the string, don't insert doublespace // insert the string, don't insert doublespace
bool space_inserted = true; bool space_inserted = true;
for(string::const_iterator cit = str.begin(); for(string::const_iterator cit = str.begin();
@ -1352,7 +1354,7 @@ void Buffer::insertStringAsLines(Paragraph *& par, Paragraph::size_type & pos,
if (*cit == '\n') { if (*cit == '\n') {
if (par->size() || layout.keepempty) { if (par->size() || layout.keepempty) {
par->breakParagraph(params, pos, par->breakParagraph(params, pos,
layout.isEnvironment()); layout.isEnvironment());
par = par->next(); par = par->next();
pos = 0; pos = 0;
space_inserted = true; space_inserted = true;
@ -1360,8 +1362,9 @@ void Buffer::insertStringAsLines(Paragraph *& par, Paragraph::size_type & pos,
continue; continue;
} }
// do not insert consecutive spaces if !free_spacing // do not insert consecutive spaces if !free_spacing
} else if ((*cit == ' ' || *cit == '\t') } else if ((*cit == ' ' || *cit == '\t') &&
&& space_inserted && !layout.free_spacing) { space_inserted && !layout.free_spacing)
{
continue; continue;
} else if (*cit == '\t') { } else if (*cit == '\t') {
if (!layout.free_spacing) { if (!layout.free_spacing) {

View File

@ -1,3 +1,8 @@
2001-10-22 Juergen Vigna <jug@sad.it>
* insettext.C (checkInsertChar): added for REALLY checking the
font of the inserted char in the right inset!
2001-10-19 Juergen Vigna <jug@sad.it> 2001-10-19 Juergen Vigna <jug@sad.it>
* inset.h: added method allowSpellcheck() so that insets who do * inset.h: added method allowSpellcheck() so that insets who do

View File

@ -884,7 +884,7 @@ void InsetText::insetButtonPress(BufferView * bv, int x, int y, int button)
inset_boundary = cboundary(bv); inset_boundary = cboundary(bv);
the_locking_inset = uinset; the_locking_inset = uinset;
uinset->insetButtonPress(bv, x - inset_x, y - inset_y, uinset->insetButtonPress(bv, x - inset_x, y - inset_y,
button); button);
uinset->edit(bv, x - inset_x, y - inset_y, 0); uinset->edit(bv, x - inset_x, y - inset_y, 0);
if (the_locking_inset) if (the_locking_inset)
updateLocal(bv, CURSOR, false); updateLocal(bv, CURSOR, false);
@ -920,7 +920,7 @@ void InsetText::insetButtonPress(BufferView * bv, int x, int y, int button)
localDispatch(bv, LFUN_PASTE, ""); localDispatch(bv, LFUN_PASTE, "");
else else
localDispatch(bv, LFUN_PASTESELECTION, localDispatch(bv, LFUN_PASTESELECTION,
"paragraph"); "paragraph");
} }
if (clear) if (clear)
lt = 0; lt = 0;
@ -2316,3 +2316,11 @@ bool InsetText::searchBackward(BufferView * bv, string const & str,
bv->unlockInset(const_cast<InsetText *>(this)); bv->unlockInset(const_cast<InsetText *>(this));
return false; return false;
} }
bool InsetText::checkInsertChar(LyXFont & font)
{
if (owner())
return owner()->checkInsertChar(font);
return true;
}

View File

@ -238,7 +238,9 @@ public:
bool const & = true, bool const & = false); bool const & = true, bool const & = false);
bool searchBackward(BufferView *, string const &, bool searchBackward(BufferView *, string const &,
bool const & = true, bool const & = false); bool const & = true, bool const & = false);
///
bool checkInsertChar(LyXFont &);
///
// //
// Public structures and variables // Public structures and variables
/// ///