LyXText::acceptOrRejectChanges() caused by too aggressive deletion
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16860 a592a061-630c-0410-9148-cb99ea01b6c8
* src/text.C: rename acceptOrRejectChange() to acceptOrRejectChanges() because it can handle many changes within the given selection; add acceptChanges() and rejectChanges()
* src/text3.C:
* src/BufferView.C: adjust
* src/insets/insettext.C: accept/rejectChanges() become wrapper methods that call LyXText::acccept/rejectChanges
* src/text2.C: add assertion
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16859 a592a061-630c-0410-9148-cb99ea01b6c8
* src/text.C:
* src/text3.C:
* src/BufferView.C: adjust
* src/insets/insettext.C: acceptChanges() / rejectChanges(): fix pars_size bug introduced in previous commit; call deleteEmptyParagraphMechanism()
* src/text2.C: track changes in DEPM (I am not sure about whether this is actually useful; time will tell..); add deleteEmptyParagraphMechanism(pit_type, pit_type, bool)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16858 a592a061-630c-0410-9148-cb99ea01b6c8
* BufferView:
- checkDepm(): new method for DEPM mechanism.
- mouseSetCursor(): use checkDepm().
* text2.C:
- use BufferView::checkDepm() instead of using LyXText::deleteEmptyParagraphMechanism() directly.
- deleteEmptyParagraphMechanism(): prepare for conversion to DocIterator (code transferred to BufferView::checkDepm()).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16442 a592a061-630c-0410-9148-cb99ea01b6c8
new doc
type: foo bar
put cursor after foo: foo| bar
enter space: foo | bar
click somewhere else -> CRASH
The problem is that the paragraph breaking needs to be redone after the empty space is deleted.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16295 a592a061-630c-0410-9148-cb99ea01b6c8
* lyxtext.h/text2.C:
- LyXText::getPitNearY(): this is non const anymore. The CoordCache will be updated automatically if the paragraph is not found in there.
- LyXText::checkInsetHit(): this is non const anymore because of the above.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16104 a592a061-630c-0410-9148-cb99ea01b6c8
* text2.C
- LyXText::cursorUp(): ensure that BufferView::FitCursor() is tested.
- LyXText::cursorDown(): ditto
- LyXText::cursorRight(): ditto
- LyXText::cursorLeft(): ditto
* text3.C
- LyXText::dispatch(): add FIXME and ensure that update flag is at least equal to FitCursor.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16072 a592a061-630c-0410-9148-cb99ea01b6c8
labelstring_appendix in layout files
* src/text2.C
(LyXText::setLayout): Translate labelwidthstring for paragraph
(LyXText::getStringToIndex): labelwidthstring is now a docstring
* src/buffer.[Ch]
(Buffer::translateLabel): New method for translating a label if it
is not already translated by the user in the layout file
* src/lyxtext.h
(setParagraph): labelwidthstring is now a docstring
* src/support/lstrings.[Ch]
(bool isAscii): New utility function: Determine whether a docstring
contains only pure ascii
* src/text3.C
(LyXText::dispatch): setParagraph() now takes a docstring
* src/lyxlayout.C
(LyXLayout::read): Don't use from_ascii when reading labelstring_,
endlabelstring_ and labelstring_appendix_
* src/buffer_funcs.C
(setLabel): labelwidthstring is now a docstring
(setLabel): Use Buffer::translateLabel instead of Buffer::B_ to
translate labels
(expandLabel): ditto
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15855 a592a061-630c-0410-9148-cb99ea01b6c8
* LyXText
- bv(), bv_owner, : deleted.
- These methods now need a (Buffer const &) argument: getFont(), applyOuterFont(), getLayoutFont(), getLabelFont(), setCharFont(), setLayout(), singleWidth(), leftMargin(), rightMargin(), computeRowMetrics(), isMainText(), spacing(), isRTL(), cursorX(), rowBreakPoint(), setRowWidth(), labelFill(), labelEnd().
- These methods now need a (BufferView const &) argument and are propably candidates for future removal when 1.6 is opened for development: redoParagraph(), x2pos(), getRowNearY(), getColumnNearX(), checkInsetHit(), setHeightOfRow().
- recUndo(): now need a LCursor argument.
* CoordCache::get(LyXText const *, pit_type):
- now const.
- use const_iterator instead of iterator.
* FontIterator:
- add (Buffer const &) argument to ctor
- buffer_: new const reference to applicable BufferView.
* InsetBase
- xo(), yo(), covers() and neverIndent() are now const.
* InsetText::setViewCache(): deleted
All other changes are due to the LyXText and InsetBase API changes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15618 a592a061-630c-0410-9148-cb99ea01b6c8
seems. ChangeTracking responsible please verify all
erase/eraseChar where we added false or where it is
called without changetracking bool (jug).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15456 a592a061-630c-0410-9148-cb99ea01b6c8
src/text2.C: invoke insertInset with correct
Change parameter; only check for change _type_
(DELETED) for DEPM purposes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15406 a592a061-630c-0410-9148-cb99ea01b6c8
theCoords is now a thing of the past and all CoordCache accesses are done via BufferView::coordCache() now. I had to modify a number of methods to pass BufferView.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15324 a592a061-630c-0410-9148-cb99ea01b6c8
* lyxfunc.h:
- theLyXFunc(): new function in the global namespace.
- lyx::dispatch(): new function in the lyx namespace.
- lyx::getStatus(): new function in the lyx namespace.
* bufferlist.h:
- theBufferList(): new function in the global namespace.
* Clipboard.h:
- theClipboard(): new function in the global namespace.
* Selection.h:
- theSelection(): new function in the global namespace.
* FontLoader.h:
- theFontLoader(): new function in the global namespace.
* FontMetrics.h:
- theFontMetrics(LyXFont const &): new function in the global namespace.
* Application.C: implements the functions defined above.
* LyXView.h:
- getLyXFunc(): deleted.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15298 a592a061-630c-0410-9148-cb99ea01b6c8
Basically, I replaced all methods in the font_metrics namespace by a proper virtual interface FontMetrics. The FontLoader is _the_ container for FontMetrics.
This patch should also bring some optimizations in a number of place in the code. This is because we do not need any more to search for the LyXFont at each font_metrics call. In effect, the speed advantage is not as sensible and this is a bit deceiving considering that this was my primary motivation behind the patch. But I like the patch anyway as it cleans up the relation and interfacing between fonts, metrics and frontends.
* frontends/FontMetrics.h: new virtual interface. Renamed from font_metrics.h
* qt4/GuiFontMetrics: corresponding qt4 implememtation. Renamed from qfont_metrics.C. The smallCaps particular case treatment has been transfered here as well as the width cache for MacOSX and Windows.
* qt4/QLPainter.C: the smallCapsText has been reworked to return the width of the drawn text.C
all other files: replace font_metric helper function call with corresponding FontMetrics method calls.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15265 a592a061-630c-0410-9148-cb99ea01b6c8