Commit Graph

19 Commits

Author SHA1 Message Date
Abdelrazak Younes
af06ed5ff1 Transfer current_font and real_current_font from Text to Cursor.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19999 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-02 13:35:48 +00:00
André Pönitz
ed858d73e5 use bald pointers in clone()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19920 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-30 18:03:17 +00:00
Jean-Marc Lasgouttes
601a8e0192 Rewrite the label numbering code.
* buffer_funcs.cpp (updateLabels): new function taking a buffer and
	a ParIterator as arguments. This one is used to update labels
	into an InsetText. Cleanup the code to reset depth. Call setLabel
	for each paragraph, and then updateLabel on each inset it contains.
	(setCaptionLabels, setCaptions): removed.
	(setLabel): use Counters::current_float to make caption paragraphs
	labels.

	* insets/Inset.h (updateLabels): new virtual method, empty by
	default; this numbers the inset itself (if relevant) and then all
	the paragraphs it may contain.

	* insets/InsetText.cpp (updateLabels): basically calls
	lyx::updateLabels from buffer_func.cpp.

	* insets/InsetCaption.cpp (addToToc): use the label constructed by
	updateLabels.
	(computeFullLabel): removed.
	(metrics, plaintext): don't use computeFullLabel.
	(updateLabels): new method; set the label from
	Counters::current_float.

	* insets/InsetWrap.cpp (updateLabels):
	* insets/InsetFloat.cpp (updateLabel): new method; sets
	Counters::current_float to the float type.

	* insets/InsetBranch.cpp (updateLabels): new method; the numbering
	is reset afterwards if the branch is inactive. (bug 2671)

	* insets/InsetNote.cpp (updateLabels): new method; the numbering
	is reset after the underlying InsetText has been numbered.
	(bug 2671)

	* insets/InsetTabular.cpp (updateLabels): new method (also handles
	longtable)

	* insets/InsetListings.cpp (updateLabels): new method; mimics what
	is done for Floats (although Listings are not floats technically)

	* insets/InsetInclude.cpp (getScreenLabel): in the listings case,
	use the computed label.
	(updateLabels): new method; that either renumbers the child
	document or number the current listing.

	* LyXFunc.cpp (menuNew): do not updateLabels on empty documents
	(why do we do that at all?)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19482 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-12 21:43:58 +00:00
Lars Gullik Bjønnes
5ae54ddafb Get rid of a few warnings.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19409 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-10 20:14:54 +00:00
Bo Peng
c20baf584c Revert rev18728, which is not a good idea
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18729 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-09 18:06:11 +00:00
Bo Peng
05439b953b Allow prefixing a listings parameter with @ to bypass validation, useful when new parameters are added in a new listings version
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18728 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-09 13:34:17 +00:00
Michael Schmitt
78b71f9863 replace "Listings" by "Listing" (plural => singular)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18570 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-29 21:23:23 +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
Bo Peng
aa31866501 Do not use \&@#^_~$ as lstinline delimiter, as suggested by Herbert
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18529 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-26 20:45:24 +00:00
Bo Peng
093b9452a4 Choose a delimiter for lstinline (braces can not be used for some listings version)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18513 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-25 16:15:02 +00:00
Bo Peng
e5bf150a0c Use a new internal structure for InsetListingsParams, fix bugs 3713 and 3718
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18501 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-24 22:19:58 +00:00
Bo Peng
b78c1db290 Make listings dialog translatable (mostly strings from InsetListingsParams), fix bug 3645
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18468 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-23 02:09:58 +00:00
Jürgen Spitzmüller
5cb3e19200 * src/insets/InsetListings.{cpp,h}:
- implement metrics and draw, fix font initialization
	(fix bug 3653)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18429 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-20 05:53:49 +00:00
Bo Peng
f672df5dc2 BUG 3649: display float listings inline, like other float insets
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18413 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-18 20:01:56 +00:00
Bo Peng
73849af5df InsetListings: change the interface of diaplay function and allow AlignLeft. Applied to InsetListings. Fixes bug 3617, 3618
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18404 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-18 14:32:29 +00:00
Bo Peng
a90f967d6f InsetListings: fix bug 3626
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18373 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-16 20:34:57 +00:00
Bo Peng
72e0b87a90 Separate caption and label from InsetListingsParams and handle them separately in listings and Include dialog, from Jurgen
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18324 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-14 20:42:14 +00:00
Bo Peng
1038ed69e6 Fix InsetListings::init, call setButtonLabel explicitly because that function is not virtual
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18246 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-09 20:00:06 +00:00
Bo Peng
4ce743a0a7 Add support for listings package. Two listings command \lstinline, \lstinputlisting and an environment \lstlisting are supported, along with preamble \lstset. \lstinputlisting is implemented through Include dialog, and the other two are implemented with a new inset listings, along with its dialog.
* src/LyXAction.cpp: listing-insert action
	* src/insets/Inset.h,cpp: LISTINGS_CODE
	* src/insets/InsetInclude.cpp: handle \lstinputlisting
	* src/insets/InsetListings.h,cpp: new listings inset
	* src/insets/InsetListingsParams.h,cpp: parameters from listings package
	* src/insets/InsetCommandParams.h,cpp: handle lstinputlisting option
	* src/Bidi.cpp: handle LISTINGS_CODE
	* src/frontends/qt4/ui/TextLayoutUi.ui: update UI
	* src/frontends/qt4/ui/ListingsUi.ui: new dialog
	* src/frontends/qt4/ui/IncludeUi.ui: update UI
	* src/frontends/qt4/QInclude.h,cpp: add lstinputlisting
	* src/frontends/qt4/QDocument.h,cpp: add textedit for preamble listings_params
	* src/frontends/qt4/QListings.h,cpp: new listings inset
	* src/frontends/qt4/Dialogs.cpp: new listings dialog
	* src/frontends/controllers/ControlInclude.h,cpp: add lstinputlisting
	* src/frontends/controllers/ControlListings.h,cpp: new listings inset
	* src/LyXFunc.cpp: handle LISTING_CODE
	* src/Paragraph.cpp: handle LISTING_CODE
	* src/factory.cpp: new listings inset
	* src/CutAndPaste.cpp: handle LISTINGS_CODE
	* src/LaTeXFeatures.cpp: require listings
	* src/Text3.cpp: Handle LISTINGS_CODE
	* src/lfuns.h: add LFUN_LISTING_INSERT
	* src/Buffer.cpp: change lyx file format to 269
	* src/BufferParams.h,cpp: add listings_params to preamble
	* lib/lyx2lyx/LyX.py: lyx2lyx 
	* lib/lyx2lyx/lyx_1_5.py: lyx2lyx
	* lib/ui/stdmenus.inc: new menu item (no shortcut!)
	* src/insets/Makefile.am: update autotools
	* src/frontends/controllers/Makefile.am
	* src/frontends/qt4/Makefile.dialogs
	* src/frontends/qt4/Makefile.am
	* po/POTFILES.in: a few more translatable files.
	* development/scons/scons_manifest.py: scons build system
	* development/FORMAT: document format changes


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18243 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-09 19:11:42 +00:00