Commit Graph

126 Commits

Author SHA1 Message Date
Georg Baum
4f4c5d4954 * src/support/lstrings.C
(lowercase): assert that input is pure ASCII
	(uppercase): ditto

	* src/support/lstrings.h
	(lowercase): document that only ASCII input is allowed
	(uppercase): ditto

	* src/lyxfind.C
	(stringSelected): Use compare_no_case (more efficient)

	* src/MenuBackend.C: remove unused using directive


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17393 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-02 16:52:49 +00:00
Bo Peng
8b56166641 Persistent-selection (and fix bug 3162)
* src/CutAndPaste.h/C: add selectionBuffer to save selected text
	* src/text3.C: proper handling of paste
	* src/lyxfind.C: save selection
	* src/BufferView.C: save selection
	* src/text.C: save selection
	* src/cursor.C: save selection
	* src/insets/insettabular.C: save selection
	* src/mathed/InsetMathGrid.C: save selection
	* src/mathed/InsetMathHull.C: save selection
	* src/mathed/InsetMathNest.C: save selection


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17022 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-02 03:10:15 +00:00
Michael Schmitt
1761baaf24 * src/lyxfind.C: fix change tracking crash
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17011 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-01 17:26:29 +00:00
Abdelrazak Younes
e4c489376c Fix screen update after CT bug.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16843 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-24 23:05:40 +00:00
Georg Baum
fed31122c4 Tell X the selection status also after it is changed by the keyboard, since
we got a consensus on this on the list.
Some calls of haveSelection are still missing, but we need to decide the
"persistent selection" question before those can be implemented properly.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16572 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-07 14:44:44 +00:00
Abdelrazak Younes
b2126408cf This commit do the Model/View separation of the LyXText and Paragraph classes. The separation is mostly complete for the Paragraph class but some more transfer should occur for the LyXText class.
* ParagraphMetrics.[Ch]: new files

* TextMetrics.[Ch]: new files.

* lyxtext.h/text2.C/text3.C: some code transferred to the TextMetrics class.

* paragraph.[Ch]: all screen oriented code transfered to ParagraphMetrics class.

* BufferView:
 - text_metrics_: new TextMetrics cache private member.
 - textMetrics(): new access method.
 - parMetrics(): ditto.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16433 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-29 23:54:48 +00:00
Georg Baum
55f575c4dd convert thesaurus and spellchecker to docstring
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16229 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-10 11:52:46 +00:00
Georg Baum
21c5579134 revert accidental change
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16213 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-08 19:49:01 +00:00
Georg Baum
26460b39ee Convert the spell checking machinery to docstring.
Fix a conversion char -> char_type without encoding conversion in
cap::replaceSelectionWithString().


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16212 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-08 19:46:16 +00:00
Michael Schmitt
dcc3f7f151 * src/lyxfind.C:
* src/paragraph.C: more change tracking cosmetics


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15513 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-23 16:25:29 +00:00
Michael Schmitt
0aaa8c5bcc change tracking:
* src/paragraph.h: rename erase() to eraseChars()
	for consistency with eraseChar()
	* src/paragraph_pimpl.h: dito; merge the two erase() methods
	* src/*.C: adjust properly


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15478 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-22 14:36:08 +00:00
André Pönitz
de6418f377 use more unicode in math
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15462 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-22 10:15:23 +00:00
André Pönitz
6c300f72a2 move everything into namespace lyx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15422 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-21 00:16:43 +00:00
Michael Schmitt
b6af1ce3e1 change tracking:
src/lyxfind.C: some source code reformatting;
	pass trackChange parameter to Paragraph::erase(..)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15405 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-20 13:16:15 +00:00
Michael Schmitt
b08f5ad69e change tracking:
* src/paragraph.h: insertXXX(...) requires either
        boolean parameter 'trackChanges' or a Change
        * src/insets/insettext.h: add trackChanges parameter
        to setText(...)
        * src/insets/*.C:
        * src/*.C: adjust properly & remove a couple of FIXMEs


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15399 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-20 11:44:58 +00:00
Georg Baum
6ada61e182 Rename namespace Alert to lyx::frontend::Alert.
This prevents a name clash with Qt 4.2.0 on OS X.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15267 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-07 16:47:54 +00:00
Abdelrazak Younes
b171e5f150 Free BufferView from LyXView!
* BufferView
  - layoutChanged: new boost signal.
  - LyXView owner(), owner_: deleted

* text3.C
  - emit BufferView::layoutChanged instead of calling LyXView::setLayout directly
  - LFUN_MOUSE_RELEASE: delete LyXView updateMenubar() and updateToolbars() direct calls.
    The update is of both bars is done in WorkArea::dispatch().

* WorkArea.C
  - dispatch(): add LyXView updateMenubar() call.

* LyXView
  - connects to BufferView::layoutChanged directly to Toolbars::setLayout()
  - setLayout(): deleted.

* qt4/GuiImplementation: modify BufferView construction (without LyXView).

All other files: cleanup header declaration of LyXView.h


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15153 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-26 10:06:46 +00:00
Abdelrazak Younes
1a0f5eaf8d deledelete BufferView::available() method because buffer serves the same purpose.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15018 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-16 14:00:13 +00:00
Abdelrazak Younes
972e1eec7c delete BufferView::text() method and add two FIXME in text.C
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15017 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-16 13:34:09 +00:00
Abdelrazak Younes
a6444784dc A bunch of conversion to docstring.
- bformat(): contributed by Georg Beaum
- Alert::XXX
- error(): in SpellBase, ispell, psell, aspell, buffer, etc.
- message(), message signal
- displayMessage(), setMessage,
- ErrorItems
- prettyName()
- makeDisplayPath()

and maybe some more...


- etc... 

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14970 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-11 08:54:10 +00:00
Lars Gullik Bjønnes
43b77ba2d7 Change _() to return a docstring. Fixup callers with the help of lyx::to_utf8.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14952 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-09 15:27:44 +00:00
Georg Baum
e33bac93cd Fix clipboard/selection encoding
* src/frontends/qt[34]/qt_helpers.[Ch]
	(toqstr): add variant for docstring
	(qstring_to_ucs4): Use docstring and port from qt4 to qt3

	* Many other files: Many std::string -> lyx::docstring conversions

	* src/support/lstrings.[Ch]
	(subst): Add variant for docstring and char_type
	(externalLineEnding): std::string -> lyx::docstring
	(internalLineEnding): std::string -> lyx::docstring


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14871 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-03 07:02:38 +00:00
Georg Baum
1fc0c01877 convert lfun arguments to docstring
* src/support/docstring.[Ch]
	(from_ascii): new conversion function
	(from_utf8): new conversion function
	(to_utf8): new conversion function
	(operator==) new, compare docstring and ASCII C string
	(operator!=) new, compare docstring and ASCII C string

	* src/support/Makefile.am: add new file docstring.C

	* development/scons/scons_manifest.py: ditto

	* src/funcrequest.[Ch]
	(argument): change name to argument_ and type to docstring,
	add an accessor
	(FuncRequest): Add two new constructors taking a docstring argument

	* all other files: adjust to the FuncRequest changes above


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14861 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-01 15:41:38 +00:00
Abdelrazak Younes
c70f77354a That commit replaces the Buffer::message() signal emissions from within "BufferView_pimpl.C" and "lyxfind.C" with BufferView::message() signal emission.
* BufferView.h: new message boost signal.

* BufferView_pimpl.C: replace Buffer::message() with BufferView::message() signal emission.

* lyxfind.C: ditto.

* WorkArea:
  - displayMessage(): new private method that calls LyXView::message().
  - messageConnection_: new signal connection.
  - setBufferView(): handle BufferView connection/disconnection.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14831 a592a061-630c-0410-9148-cb99ea01b6c8
2006-08-24 14:10:22 +00:00
Abdelrazak Younes
1451d739c4 replace LyXView::message() direct call with Buffer::message() boost signal emission.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14827 a592a061-630c-0410-9148-cb99ea01b6c8
2006-08-23 21:14:43 +00:00
Jean-Marc Lasgouttes
a772437054 Fix bug 2068 and do some cleanup
* src/CutAndPaste.C (setSelectionRange, replaceWord): remove.
	(replaceSelectionWithString): select the new string after
	replacement; add a bool parameter indicating in which sense the
	selection is made.

	* src/lyxfind.C (replace): adapt to above changes.
	(find): comment out debug message.

	* src/frontends/controllers/ControlSpellchecker.C (isLetter):
	rename parameter.
	(nextWord): take a LCursor as parameter; set the selection over
	the word that has been found.
	(check): adapt to changes above (the length of the word is not
	necessarily the length of the selection -- fixes bug 2068).
	(replace): use cap::replaceSelectionWithString




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14708 a592a061-630c-0410-9148-cb99ea01b6c8
2006-08-16 21:12:20 +00:00
Michael Schmitt
10c8081a54 src/paragraph.h:
remove lookupChangeType;
  rename setChange to setChangeType;
  rename setChangeFull to setChange

src/paragraph_pimpl.h:
  remove lookupChange;
  rename lookupChangeFull to lookupChange;
  rename setChange to setChangeType;
  rename setChangeFull to setChange

src/changes.h: remove lookup;
  rename lookupFull to lookup;
  rename loose_contains to containsOrPrecedes;

adjust the other files accordingly


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13812 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-08 20:30:52 +00:00
Michael Schmitt
d7bcff50a9 src/paragraph.h:
src/BufferView_pimpl.C:
	src/lyxfunc.C:
	src/paragraph_funcs.C:
	src/lyxfind.C:
	src/bufferparams.h:
	src/rowpainter.C:
	src/paragraph.C:
	src/text.C: rename methods: lookupChange => lookupChangeType,
	lookupChangeFull => lookupChange


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13802 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-05 23:11:19 +00:00
Lars Gullik Bjønnes
3b9338a3a8 Whitespace cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13565 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-05 23:56:29 +00:00
Martin Vermeer
bcf1a16e10 Fix bug 880, or the multi-paragraph change tracking patch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13339 a592a061-630c-0410-9148-cb99ea01b6c8
2006-03-11 13:31:41 +00:00
Jean-Marc Lasgouttes
5d0f08d856 fix crash when toggling change tracking off
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10421 a592a061-630c-0410-9148-cb99ea01b6c8
2005-09-07 10:00:19 +00:00
André Pönitz
4b7d477809 implement undo for textclass switches in order to avoid a crash
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10190 a592a061-630c-0410-9148-cb99ea01b6c8
2005-07-14 22:09:22 +00:00
Jean-Marc Lasgouttes
bec94eeade fix bugs discovered by msvc
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9507 a592a061-630c-0410-9148-cb99ea01b6c8
2005-01-20 14:38:45 +00:00
Lars Gullik Bjønnes
9c2ba3c4ff rename tostr.[Ch] to convert.[Ch]
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9448 a592a061-630c-0410-9148-cb99ea01b6c8
2005-01-06 16:39:35 +00:00
Lars Gullik Bjønnes
6a55be9506 tostr -> convert and some bformat work
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9446 a592a061-630c-0410-9148-cb99ea01b6c8
2005-01-06 15:40:49 +00:00
Jürgen Spitzmüller
f6d14695d4 get the change tracker working again (bug 1719)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9399 a592a061-630c-0410-9148-cb99ea01b6c8
2004-12-20 08:08:18 +00:00
Alfredo Braunstein
a2cd656e25 CoordBranch merge
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9325 a592a061-630c-0410-9148-cb99ea01b6c8
2004-11-30 01:59:49 +00:00
Alfredo Braunstein
ed064bdee6 par->pit renaming
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9300 a592a061-630c-0410-9148-cb99ea01b6c8
2004-11-24 21:53:46 +00:00
Jean-Marc Lasgouttes
ce2cab2732 update the screen while spellchecking and merging changes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9289 a592a061-630c-0410-9148-cb99ea01b6c8
2004-11-22 14:56:14 +00:00
Jean-Marc Lasgouttes
020972b7f9 get rid of Paragraph::isWord; ignore words with digits in spellchecker
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9268 a592a061-630c-0410-9148-cb99ea01b6c8
2004-11-18 14:58:54 +00:00
Angus Leeming
e978fa42e3 Whitespace, only whitespace.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9044 a592a061-630c-0410-9148-cb99ea01b6c8
2004-10-05 10:11:42 +00:00
Jean-Marc Lasgouttes
09b67226eb fix backwards search (bug 1666)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8988 a592a061-630c-0410-9148-cb99ea01b6c8
2004-09-17 16:28:47 +00:00
Lars Gullik Bjønnes
7c15014ec2 change "support/std_sstream.h" to <sstream>
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8849 a592a061-630c-0410-9148-cb99ea01b6c8
2004-07-24 10:55:30 +00:00
Lars Gullik Bjønnes
68b7ef25fb simple ws changes only
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8594 a592a061-630c-0410-9148-cb99ea01b6c8
2004-04-03 08:37:12 +00:00
Alfredo Braunstein
d34600cd3e add BufferView::getStatus and use it + some lyx::find fixes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8582 a592a061-630c-0410-9148-cb99ea01b6c8
2004-04-01 08:58:45 +00:00
Alfredo Braunstein
303a6c126c s/DocumentIterator/DocIterator/g a.k.a showing off my sed abilities. Sorry for the cvs spam.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8574 a592a061-630c-0410-9148-cb99ea01b6c8
2004-03-31 19:11:56 +00:00
Alfredo Braunstein
3e80b0b318 the pariterator stuff
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8554 a592a061-630c-0410-9148-cb99ea01b6c8
2004-03-28 22:00:22 +00:00
André Pönitz
0d43ba149a the stuff from the sneak preview:
For one, it still contains a few things that are already in CVS (the
'brown paperbag' changes).

Secondly, this changes the ParagraphList to a std::vector but does not
yet take full advantage of it except removing LyXText::parOffset() and
similar.

I had an extensive talk with my profiler and we are happy nevertheless.

This also moves almost all Cut&Paste specific stuff from text.C to
CutAndPaste.C. Much smaller interface now... Namespace CutAndPaste is
now  lyx::cap::. Was inconsistent with the rest....

Make ParagraphList a proper class. We'll need this later for a
specialized erase/insert.

Remove some unneeded prototypes and function declarations

Use ParameterStruct directly instead of ShareContainer<ParameterStruct>

Inline a few accesses to CursorSlice members as suggested by the profiler.

Fix commandline conversion crash reported by Kayvan.

Replace PosIterator by DocumentIterator. The latter can also iterate
through math and nested text in math...

Remove math specific hack from Documentiterator

Derive InsetCollapsable from InsetText instead of using an InsetText
member. This give us the opportunity to get rid of the InsetOld::owner_
backpointer.

Cosmetics in CutAndPaste.C and cursor.C. Fix nasty crash (popping slices
off an empty selection anchor). Add a few asserts.

Remove all 'manual' update calls. We do now one per user interaction which
is completely sufficient.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8527 a592a061-630c-0410-9148-cb99ea01b6c8
2004-03-25 09:16:36 +00:00
André Pönitz
7892c861f9 more 'value' semantics for paragraphs
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8504 a592a061-630c-0410-9148-cb99ea01b6c8
2004-03-18 16:12:51 +00:00
André Pönitz
fc52df8243 the DocIterator stuff
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8472 a592a061-630c-0410-9148-cb99ea01b6c8
2004-03-01 17:12:09 +00:00