- ucs4_to_qchar(): add a FIXME and an assertion
* GuiFontMetrics: replace the table based cache with two QHash based cache. With this change, the speed overhead is not negligible (exact same score with the UserGuide test) and the required additional memory is minimal (maybe one or two megabytes).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16132 a592a061-630c-0410-9148-cb99ea01b6c8
- add constants instead of hard-coded values.
- add assertions and comments for out of range values.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16126 a592a061-630c-0410-9148-cb99ea01b6c8
http://bugzilla.lyx.org/show_bug.cgi?id=2900
The only drawback is that it requires about 20Mo extra-memory when loading the UserGuide. If it turns out to be too much, we can switch to a QHash based solution instead of a table.
* dimension.[Ch]:
- Dimension(LyXFont const, char_typec): new ctor
- set(LyXFont const & font, char_type c): new method.
* frontends/FontMetrics.h:
- width(char_type): is now a pure virtual method.
* GuiFontMetrics:
- CharMetrics: new structure;
- the metrics cache now also cache ascent and descent. This is especially useful for mathed.
* MathSupport.[Ch]:
- mathed_char_dim(): deleted. We now use Dimension::set() directly instead.
* rowpainter.C: fixe empty space.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16124 a592a061-630c-0410-9148-cb99ea01b6c8
* src/buffer.C
(Buffer::save): Only try to make a backup if the buffer file already
exists. The try ... catch mechanism is fine, but when it was
introduced ot was overseen that copying a file could not only fail
because the destination dir does not exist, but also because the
source does not exist.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16121 a592a061-630c-0410-9148-cb99ea01b6c8
This pointer was one reason for the Mac crashes because it not always had
the same value as the application_ smart pointer
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16119 a592a061-630c-0410-9148-cb99ea01b6c8
../../../../src/frontends/qt4/GuiView.C:142: warning: comparison between signed and unsigned integer expressions
../../../../src/frontends/qt4/GuiView.C:144: warning: comparison between signed and unsigned integer expressions
../../../../src/frontends/qt4/GuiView.C:146: warning: comparison between signed and unsigned integer expressions
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16113 a592a061-630c-0410-9148-cb99ea01b6c8
Part 2: avoid pure virtual function,
if (theApp)
theApp->unregisterSocketCallback(fd_);
does not help, we've tested it!
Without a Mac it is hard to find a better solution
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16110 a592a061-630c-0410-9148-cb99ea01b6c8
* src/lyx_main.C
(easyParse): decrement the loop variable only when remove > 0
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16107 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
kAEOpenDocuments ApleEvent.
(event): new method to do the same thing using qt4 built-in support.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16099 a592a061-630c-0410-9148-cb99ea01b6c8
* LyXText::cursorPrevious(): Implement the same check for safety reason.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16092 a592a061-630c-0410-9148-cb99ea01b6c8
* src/support/docstring.C
(do_get): terminate the string before using it.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16086 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
This commits improves considerably math editing in Windows and solves one crash when viewing the moebius figure in UserGuide.lyx.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16071 a592a061-630c-0410-9148-cb99ea01b6c8
* src/support/docstring.C
(do_get): use reserve() and the += operator in order to
avoid a possible buffer overrun.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16070 a592a061-630c-0410-9148-cb99ea01b6c8
* LyX::exec(): in non-GUI mode, execute batch commands on all buffers.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16068 a592a061-630c-0410-9148-cb99ea01b6c8
rejectChange(); end-of-par characters are not considered
for the time being
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16064 a592a061-630c-0410-9148-cb99ea01b6c8
- execBatchCommands(): split in loadFiles() and execBatchCommands().
- exec(): enable batch command to be processed from GUI.
* Application:
- start(): deleted.
* GuiApplication:
- execBatchCommands(): new method
* GuiWorkArea::update(): call viewport()->repaint() instead of viewport()->update(), this enable to update the screen immediately when asked by a batch command.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16051 a592a061-630c-0410-9148-cb99ea01b6c8
use const_iterator to access paragraph insetlist; add
FIXME in accept/rejectChange
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16049 a592a061-630c-0410-9148-cb99ea01b6c8
items (instead of corrupting the source); adjust
calls to moveItem(); clean up breakParagraphConservative()
with regards to change tracking
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16047 a592a061-630c-0410-9148-cb99ea01b6c8
does not honour change tracking => make it a private method;
clarify the description of backspacePos0 (it does not always
merge paragraphs)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16033 a592a061-630c-0410-9148-cb99ea01b6c8
In use_gui mode, call execBatchCommand() after createApplication(). This enable to let the frontend parse the command line.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16027 a592a061-630c-0410-9148-cb99ea01b6c8
* src/gettext.[Ch]
(translateIfPossible): new function to translate stuff that might
already be in the native language
* src/MenuBackend.C
(Menu::read): Use translateIfPossible for item names and submenu
labels, since the user may have already entered them in his native
language into the .ui file
* src/ToolbarBackend.C
(ToolbarBackend::read): do the same with the tooltip
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16015 a592a061-630c-0410-9148-cb99ea01b6c8
* LyX::execBatchCommands(): allow any extra argument unknown to the core to be passed out to the frontend.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16014 a592a061-630c-0410-9148-cb99ea01b6c8
Add licence info to UpdateFlags.h.
Note to the author of UpdateFlags.h: Please fix the author information,
I don't know who wrote this file because not everybody used his own account.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16012 a592a061-630c-0410-9148-cb99ea01b6c8
* InsetMathNest::lfunMousePress(): Disable optimization introduced in revision 16006. This is because we need the box corners when navigating inside formulas.
* InsetMathNest::doDispatch(): ditto.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16011 a592a061-630c-0410-9148-cb99ea01b6c8
* InsetMathNest.C: adjust update flags in order to avoid unneeded screen redrawing.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16006 a592a061-630c-0410-9148-cb99ea01b6c8
mode, make the cursor jump over it; avoid crash in setCursorIntern
by using the right LyXText.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16001 a592a061-630c-0410-9148-cb99ea01b6c8
* buffer.h: changed() signal do not have an argument now.
* BufferView.C:
- setBuffer(): changed update() call to updateMetrics().
- update(): sanitize how the flags are used.
- scrollDocView(): add a call to updateMetrics() at the end.
* LyXFunc::dispatch(): adjust changed() signal emission.
* LyXText/text3.C:
- cursorPrevious(): delete BufferView::update call; adjust cursor flag.
- cursorNext(): ditto.
* frontends/LyXView.C: adjust Buffer::changed() signal connection.
* frontends/WorkArea.[Ch]:
- redraw(): no need to re-update the metrics if we don't change views.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15997 a592a061-630c-0410-9148-cb99ea01b6c8
* src/cursor.C: remove nested empty math box
* src/mathed/InsetMathNest.C: remove the whole empty math box if it
can not be deleted from within
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15990 a592a061-630c-0410-9148-cb99ea01b6c8
- merge exec() and priv_exec()
- LyX constructor is now public.
- there is no global singleton_ object anymore, only a pointer.
- IconvProcessor(): new utf8 to ucs4 convertor.
* main.C: instantiate a LyX object and exec() it. No more use of static methods.
* docstring.C: use utf8ToUcs4() instead of a static variable.
* unicode.h: declare extern utf8ToUcs4().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15967 a592a061-630c-0410-9148-cb99ea01b6c8
when iconpalette detached from the math dialog, the iconpalette widget
width may become too large to fit to the screen.
when detached resized to a too small size, icons overlap.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15966 a592a061-630c-0410-9148-cb99ea01b6c8
file names, and DocFileName contains the special extensions for documents,
included figures etc.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15965 a592a061-630c-0410-9148-cb99ea01b6c8
* src/mathed/MathFactory.C
(initSymbols): skip a line when it is empty or a comment.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15961 a592a061-630c-0410-9148-cb99ea01b6c8
where sizeof(wchar_t) == 2
* src/support/docstring.C:
- New class ascii_num_get_facet for inputting numbers from idocstreams.
- Add the ascii_num_get_facet facet to the locale initializer.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15959 a592a061-630c-0410-9148-cb99ea01b6c8
* BufferView:
- update(): returns a pair of bools in order to inform for singlePar cases.
- workAreaDispatch(): ditto and simplify the logic by using cursor update flags.
* text.C
- breakParagraph(): change the cursor update flag as needed.
- insertChar(): ditto.
- erase(): ditto
- redoParagraph(): now returns true if there is a height change.
* text3.C: dispatch():
- initialize the cursor flag at the beginning
- LFUN_MOUSE_PRESS: no need to update.
- LFUN_MOUSE_RELEASE: ditto.
- add some FIXMEs and comments.
* LyXFunc::dispatch(): simplify the BufferView update.
* insets/insetcollapsable.C: clarify and simplify the logic in doDispatch().
* WorkArea::dispatch(): redraw only if needed.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15958 a592a061-630c-0410-9148-cb99ea01b6c8
This fix will create extra translator work, and nobody will remmeber that
bformat should be used instead of your solution once the real problem is
fixed. If you use from_ascii instead of from_utf8 everything is OK. utf8
can be wrong as encoding for files anyway, so for now we require that files
are pure ascii.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15957 a592a061-630c-0410-9148-cb99ea01b6c8
* lyx_main.C:
- LyX::prepareExit(): avoid utf8_to_ucs4() conversion at this late stage because this can cause problem on Mac.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15955 a592a061-630c-0410-9148-cb99ea01b6c8
Following patch corrects some misbehavior in TOC dialog:
- When clicking on Toc insets, dialog switches to correct list.
- cursor goes to correct entry when clicked..
- some other fixes..
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15949 a592a061-630c-0410-9148-cb99ea01b6c8
* src/support/unicode.[Ch]
(IconvProcessor): Rework the implementation to fix two bugs:
- iconv_close was called even if the conversion descriptor was
invalid
- The compiler generated copy constructor did simply copy the pimpl_
pointer. Therefore pimpl_ was deleted twice for all IconvProcessor
instances created by eightbit_to_ucs4() and ucs4_to_eightbit().
This is solved by using a scoped_ptr for pimpl_.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15937 a592a061-630c-0410-9148-cb99ea01b6c8