Commit Graph

51 Commits

Author SHA1 Message Date
Abdelrazak Younes
237c713046 Fix bug http://bugzilla.lyx.org/show_bug.cgi?id=5328
* Paragraph::insertInset(): check if inset insertion is allowed before insertion.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26810 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-08 14:03:15 +00:00
Abdelrazak Younes
5ce39aa8b5 Add a "List of Changes" in the Navigator. The list is updated only when the document structure is reset or when the update button is clicked. Some work is needed to track more finely individual changes as we do for sections.
Changes::addToToc(): New method to insert changes sorted by authors. The symbols 0x2702 and 0x270d are used to represent deletion and insertion.

TocBackend::item(): new method to lookup for a given item.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26639 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-30 11:06:34 +00:00
Abdelrazak Younes
f83a38b3de Paragraph::inInset() shall not be used if the owner inset was not initialized. Make this rule clear and unavoidable.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26385 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-13 17:01:54 +00:00
Abdelrazak Younes
0b18d24e56 Get rid of Paragraph::insetAllowed()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26372 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-12 13:57:15 +00:00
Abdelrazak Younes
236460445a Paragraph: Add a partial copy ctor that will get used in next commit.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26000 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-30 09:07:32 +00:00
Abdelrazak Younes
396a90decb Ensure that the Buffer pointer is correctly set with Clipboard operations.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25844 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-23 12:49:22 +00:00
Richard Heck
780bce0f96 Rename empty layout stuff to plain layout stuff.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25541 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-10 17:41:52 +00:00
Jean-Marc Lasgouttes
5cef8b6887 * LyXRC.cpp:
* development/MacOSX/lyxrc.dist.in: new variable mac_like_word_movement,
	set to true on Mac OS X. There is no GUI for it now.

	* src/Paragraph.cpp (isSpace): new method
	(isChar): return false for a space.

	* src/Text.cpp (cursorForwardOneWord, cursorBackWardOneWord): implement
	mac-like cursor movement.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25413 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-01 14:42:32 +00:00
Jean-Marc Lasgouttes
cfbe5dd9e1 Fix bug http://bugzilla.lyx.org/show_bug.cgi?id=3580
* Paragraph.cpp (isChar): new method; returns true when pointer is on 
	a character that is not a letter. Note that a footnote inset, for 
	example is neither a letter nor a character.

	* Text.cpp (cursorForwardOneWord, cursorBackwardOneWord): rewrite by
	using 3 character categories: letters, characters and others. 


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25373 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-24 09:19:52 +00:00
Abdelrazak Younes
eb28cb8755 Unify Paragraph::asString() methods.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24882 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-22 14:01:33 +00:00
Abdelrazak Younes
5398dce8ae forward port rev 24877. Even if trunk is not affected by 4857, it is safer to only display printable characters in the toc items and not go inside insets.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24878 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-22 10:14:20 +00:00
Richard Heck
9337d73f1f Comment.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23551 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-08 03:00:13 +00:00
Richard Heck
a01cb111a0 Change the interface to a paragraph's layout. We still store a LayoutPtr, but now privately, and make a Layout const & available to clients.
The need for a LayoutPtr arises from the fact that (a) we do not want to give our clients a Layout &, since we do not want them to be able to change our Layout; but (b) we also need to be able to change which layout is ours. So we cannot store a Layout const &. Or so it seems to the compiler.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23522 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 21:31:27 +00:00
Richard Heck
f401ce5d29 Changes LayoutList from a vector<LayoutPtr> to a vector<Layout>.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23519 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 20:01:30 +00:00
Stefan Schimanski
cd63c1380b * remove some garbage from the "buffer in inset" change
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23453 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-04 14:58:10 +00:00
Richard Heck
77f2d2e7d2 Fix types.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23305 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-28 07:18:54 +00:00
André Pönitz
db8c16d554 progress on buffer-reference-in-insets. beware of instabilities...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23289 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-27 20:43:16 +00:00
Stefan Schimanski
cd5bad62e0 * paragraph support for the global word list. To make it buffer
dependent, we need the buffer pointer. In fact we already have a
  pointer to the text inset. So as soon as inset know their buffer we
  can easily switch to a buffer local word list.
* there might be missing some more places to update the words from a
  buffer, like for example after backspace or more important when the
  cursor leaves a paragraph.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23244 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-26 13:07:59 +00:00
Stefan Schimanski
f8d516c7af Revert "* compile fix"
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23234 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-25 22:02:48 +00:00
Stefan Schimanski
1669c17c0f * compile fix
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23233 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-25 21:53:16 +00:00
André Pönitz
0fb8f3fba1 mostly s/Paragraph::layout(...)/Paragraph::setLayout(...)/
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23159 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-23 16:45:38 +00:00
Richard Heck
040f3431e7 Fix bug 4037 and related problems. The patch has been cleaned up a bit
from the one posted to the list.

The basic idea has two parts. First, we hard code an "empty layout"
(called PlainLayout, for want of a better name) in TextClass and read it
before doing anything else. It can therefore be customized by classes,
if they want---say, to make it left-aligned. Second, InsetText's are
divided into three types: (i) normal ones, that use the "default" layout
defined by the text class; (ii) highly restrictive ones, such as ERT and
(not quite an inset) table cells, which demand the empty layout; (iii)
middling ones, which default to an empty layout and use the empty layout
in place of the default. (This is so we don't get the same problem we
had with ERT in e.g. footnotes.) The type of inset is signaled by new
methods InsetText::forceEmptyLayout() and InsetText::useEmptyLayout().
(The latter might better be called: useEmptyLayoutInsteadOfDefault(),
but that's silly.) The old InsetText::forceDefaultParagraphs() has been
split into these, plus a new method InsetText::allowParagraphCustomization(). 
A lot of the changes just adapt to this change.

The other big change is in GuiToolbar: We want to show LyXDefault and
the "default" layout only when they're active.

There are a handful of places where I'm not entirely sure whether we
should be using forceEmptyLayout or !allowParagraphCustomization() or
both. The InsetCaption is one of these. These places, and some others,
are marked with FIXMEs, so I'd appreciate it if people would search
through the patch and let me know whether these need changing. If they
don't, the FIXMEs can be deleted.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22966 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-12 17:31:07 +00:00
Jean-Marc Lasgouttes
21ff30cc38 * src/Text.cpp (changeCase): do not set the selection if it was not
already set.

	* src/Paragraph.cpp (changeCase): make sure to update the selection 
	as needed.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22695 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-28 10:50:24 +00:00
Stefan Schimanski
36dbec4506 * Lazy MathData to avoid unneeded interpretation of macro definitions
* DocIterator as MacroPosition
* Iterative search for macro in scope until a visible one is found.
This include the ability to resolve macro inside nested text insets.
* Speed up macro lookups by factor 2: only getMacro(name) call, no
further hasMacro(name) call before
* Both way child/master support
* Correct macro scope for multi-paragraph environments
* Correct macro scope for multi-depth-paragraphs
* Buffer::updateMacros made const
* Update macros when loaded (of master and child)
* Do not remove too many braces when unfolding a macro. This could
lead to a data loss because the relationship between arguments of
macros can be mixed up if nested macros are unfold at once.
* Reduce dependencies to MetricsInfo in MathMacro   
* Update macros when needed. Normally it's done just before doing
metrics. But in cases without a brace around some constructs (like
\left(bla\right)) there is some help needed.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22241 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-21 20:42:46 +00:00
André Pönitz
a8cd9a4b8f cosmetics. mainly replace #include "dostring.h" by #include "strfwd.h"
in header files when possible. Adjust .cpp files.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21358 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-01 22:17:22 +00:00
Stefan Schimanski
1231489798 * dynamic macros as described in http://1stein.org/download/dynmacro.pdf
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21328 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-01 11:13:07 +00:00
André Pönitz
a5263e0f92 introduce a header to forward declare std::string.
hope there are only conforming implementaions out there ;-}


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21312 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-31 22:40:34 +00:00
Abdelrazak Younes
5ddc612b73 Splitup Font in saner bits:
* Font::FontBits -> FontInfo
* Font::FONT_XXX -> all enums transfered to FontEnums.h and renamed to FontXxx

I've replaced Font uses with FontInfo were the language() member was not needed, basically all draw() and metrics methods. There's one problematic cases with InsetQuotes which I solved by taking the Buffer main language.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21240 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-28 18:51:54 +00:00
Abdelrazak Younes
1026a87b72 * InsetList: introducing find() and count()
* Paragraph:
- erase numberOfOptArgs() and bibitem()
- move onlyText() to Private.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21180 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-24 15:32:43 +00:00
Abdelrazak Younes
372e605c2f Introducing Paragraph::find().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21168 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-24 08:22:26 +00:00
Abdelrazak Younes
1297114b73 Introducing Paragraph::changeCase().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21167 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-24 07:49:24 +00:00
Abdelrazak Younes
d7c3ab3203 * Paragraph: Move more things to Paragraph::Private
- remove META_INSET from Paragraph.h
- move text_ container to Private. I know this put there for performance reason but I don't see any penalty with this move. I guess this is because Buffer loading doesn't use Paragraph::getChar() anymore. I will move performance critical code to Paragraph::Private when/if we detect them.
- replace Paragraph::value_type with straight char_type: this was more noise than anything.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21163 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-24 07:08:55 +00:00
André Pönitz
b99433e73b cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21157 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-23 21:41:17 +00:00
Abdelrazak Younes
e6f3d34556 * Paragraph: erase unused some method and move some members to Paragraph::Private.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21148 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-23 13:25:05 +00:00
Abdelrazak Younes
e6f059a132 * Paragraph:
- simpleTeXOnePar(): renamed to latex(), beginning of de-spaghettization by truly splitting inset and character cases.
- appendChar(), appendString(): new method for buffer reading.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21117 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-22 13:09:16 +00:00
André Pönitz
f934b86850 cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21097 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-21 10:50:56 +00:00
Abdelrazak Younes
b4ef7c9968 * Paragraph: Cosmetics and cleanups, remove uneeded redirection and uniformize Private members naming. Still a lot of cleanup needed.
* InsetList: remove clone() and create a copy ctor.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21052 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-19 08:57:22 +00:00
Abdelrazak Younes
6725b2db59 Reduce header dependencies in Paragraph.h
- Move Changes.h out of Paragraph.h
- pimpl the inset list.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21033 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-18 15:29:51 +00:00
Abdelrazak Younes
87b112496c Use InsetCode.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20940 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-13 09:48:18 +00:00
Abdelrazak Younes
f7b1c86393 Move Inset::Code to InsetCode.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20936 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-13 09:04:52 +00:00
Alfredo Braunstein
a8ed1add4d rename Paragraph::isRightToLeftPar -> isRTL for the sake of consistence
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20031 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-04 10:27:55 +00:00
Abdelrazak Younes
7d97e555fc Transfer Paragraph::hfillExpansion() to ParagraphMetrics. This also reduce the dependency to Row.h which is probably going to change in the near future.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19951 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-31 14:46:13 +00:00
André Pönitz
39c7e2faf0 rename Layout_ptr into LayoutPtr
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19758 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-23 19:59:07 +00:00
Michael Schmitt
7f74d469a4 * src/Author.h:
* src/Changes.cpp:
	* src/support/userinfo.cpp:
	* src/Paragraph.cpp:
	* src/Changes.h:
	* src/Buffer.cpp:
	* src/Paragraph.h:
	* src/BufferParams.cpp: do not save the name of authors
	in LyX documents, who have not made a single change in 
	change tracking mode


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19019 a592a061-630c-0410-9148-cb99ea01b6c8
2007-07-09 20:52:34 +00:00
Lars Gullik Bjønnes
897436efbb Whitespace cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18550 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-28 22:27:45 +00:00
Richard Heck
dfd9a1d53d Fix for bug 3650. Made changes to the Paragraph::checkBiblio() routine,
which now returns 1 if an InsetBibitem was inserted (and the cursor needs
to be incremented) or -POS if an InsetBibitem was deleted at position POS
(and the cursor needs to be decremented if it was past POS). Otherwise, it
returns 0. Made the corresponding changes in TextMetrics.cpp.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18424 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-19 19:29:50 +00:00
André Pönitz
75637c0dd8 remove RowList_fwd.h. Not really needed
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18135 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-30 22:02:15 +00:00
André Pönitz
0bf9ac02a8 rename LyXLayout into Layout
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18096 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-29 18:58:28 +00:00
André Pönitz
fc6ce7cd08 rename LyXFont to Font except in tex2lyx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18095 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-29 18:17:15 +00:00
André Pönitz
32871c1284 rename InsetBase to Inset
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18089 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-29 13:39:47 +00:00