Re: Todays 1.6svn crash in various ways when opening existing documents
Bo Peng wrote: > During a fast-evolving period like this, with no public release in > between, reversion of lyx2lyx is IMHO acceptable I think we discussed this sufficiently now. It doesn't matter in which release perdiod we are. Jürgen
Re: [Cvslog] r21375 - /lyx-devel/trunk/src/frontends/qt4/ui/PrefUi.ui
Bo Peng wrote: > I change from 4.3 format to 4.22 (which is supposedly the same as > 4.1). I could not compile the trunk without this change. Now I'm puzzled. Jürgen
Re: warnings
Andre Poenitz wrote: > ../../trunk/src/LyXFunc.cpp:2477: warning: enumeration value > 'RC_DEFFILE' not handled in switch > ../../trunk/src/LyXFunc.cpp:2477: warning: enumeration value > 'RC_USE_PIXMAP_CACHE' not handled in switch The latter is fixed. This is commented-out code btw. Jürgen
Re: [Cvslog] r21398 - /lyx-devel/trunk/src/TextClass.cpp
OK, thanks. - Martin
Re: [Cvslog] r21396 - in /lyx-devel/trunk/src: CutAndPaste.cpp TextCla...
On Sat, Nov 03, 2007 at 12:35:08AM +, [EMAIL PROTECTED] wrote: > Author: younes > Date: Sat Nov 3 01:35:07 2007 > New Revision: 21396 > > URL: http://www.lyx.org/trac/changeset/21396 > Log: > Further cleanup of InsetFlex, InsetCollapsable and InsetLayout: > - Getting rid of some unneeded init() methods. > - InsetCollapsable::layout_ is now a const pointer. > > Modified: > lyx-devel/trunk/src/CutAndPaste.cpp > lyx-devel/trunk/src/TextClass.cpp > lyx-devel/trunk/src/factory.cpp > lyx-devel/trunk/src/insets/InsetBox.cpp > lyx-devel/trunk/src/insets/InsetBranch.cpp > lyx-devel/trunk/src/insets/InsetCollapsable.cpp > lyx-devel/trunk/src/insets/InsetCollapsable.h > lyx-devel/trunk/src/insets/InsetERT.cpp > lyx-devel/trunk/src/insets/InsetERT.h > lyx-devel/trunk/src/insets/InsetFlex.cpp > lyx-devel/trunk/src/insets/InsetFlex.h > lyx-devel/trunk/src/insets/InsetNote.cpp > > Modified: lyx-devel/trunk/src/CutAndPaste.cpp > URL: > http://www.lyx.org/trac/file/lyx-devel/trunk/src/CutAndPaste.cpp?rev=21396 > == > --- lyx-devel/trunk/src/CutAndPaste.cpp (original) > +++ lyx-devel/trunk/src/CutAndPaste.cpp Sat Nov 3 01:35:07 2007 > @@ -448,7 +448,7 @@ > InsetFlex & inset = > static_cast(*it); > string const name = inset.params().name; > - InsetLayout const il = > + InsetLayout const & il = > tclass2.insetlayout(from_utf8(name)); > inset.setLayout(il); > if (il.labelstring == from_utf8("UNDEFINED")) { > > Modified: lyx-devel/trunk/src/TextClass.cpp > URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/TextClass.cpp?rev=21396 > == > --- lyx-devel/trunk/src/TextClass.cpp (original) > +++ lyx-devel/trunk/src/TextClass.cpp Sat Nov 3 01:35:07 2007 > @@ -707,6 +707,9 @@ > break; > case IL_LABELFONT: > labelfont = lyxRead(lexrc, inherit_font); > + // The label font is generally used as-is without > + // any realization against a given context. > + labelfont.realize(sane_font); Great. Did you also remember to change the labelfont initialization (above) inherit_font -> sane_font? (i.e., fix my mistake's first part)? - Martin > break; > case IL_FORCELTR: > lexrc.next();
Re: [Cvslog] r21394 - in /lyx-devel/trunk/src/insets: InsetListings.cp...
On Fri, Nov 02, 2007 at 11:12:45PM +, [EMAIL PROTECTED] wrote: > Author: younes > Date: Sat Nov 3 00:12:43 2007 > New Revision: 21394 > > URL: http://www.lyx.org/trac/changeset/21394 > Log: > Remremove unneeded init() method. > > > Modified: > lyx-devel/trunk/src/insets/InsetListings.cpp > lyx-devel/trunk/src/insets/InsetListings.h > > Modified: lyx-devel/trunk/src/insets/InsetListings.cpp > URL: > http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetListings.cpp?rev=21394 > == > --- lyx-devel/trunk/src/insets/InsetListings.cpp (original) > +++ lyx-devel/trunk/src/insets/InsetListings.cpp Sat Nov 3 00:12:43 2007 > @@ -31,43 +31,28 @@ > > #include > > -namespace lyx { > - > -using support::token; > -using support::contains; > -using support::subst; > - > using std::istringstream; > using std::ostream; > using std::ostringstream; > using std::string; > > +namespace lyx { > + > +using support::token; > +using support::contains; > +using support::subst; > + > char const lstinline_delimiters[] = > > "!*()-=+|;:'\"`,<.>/?QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm"; > > -void InsetListings::init() > -{ > - setButtonLabel(); > - layout_.labelfont.setColor(Color_none); Great. I see you did Box too. - Martin
Re: Support request for Japanese without CJK
Uwe Stöhr wrote: This description is independent from CTAN. We need an explanation for all document classes we ship with LyX in LateXConfig.lyx. So it would be nice when you could send a patch for LaTeXConfig.lyx the next days. Sorry for being late. Please apply the attached patch to add description in LaTeXConfig.lyx. Thanks, Koji --- lib/doc/LaTeXConfig.lyx.orig Fri Oct 12 23:59:48 2007 +++ lib/doc/LaTeXConfig.lyx Sat Nov 3 12:54:44 2007 @@ -1959,6 +1999,175 @@ \end_layout \begin_layout Subsection +Japanese standard classes +\end_layout + +\begin_layout Description +Found: +\family sans +jarticle +\family default +: +\begin_inset Info +type "textclass" +arg "jarticle" +\end_inset + +, +\family sans +jreport +\family default +: +\begin_inset Info +type "textclass" +arg "jreport" +\end_inset + +, +\family sans +jbook +\family default +: +\begin_inset Info +type "textclass" +arg "jbook" +\end_inset + +, +\family sans +tarticle +\family default +: +\begin_inset Info +type "textclass" +arg "tarticle" +\end_inset + +, +\family sans +treport +\family default +: +\begin_inset Info +type "textclass" +arg "treport" +\end_inset + +, +\family sans +tbook +\family default +: +\begin_inset Info +type "textclass" +arg "tbook" +\end_inset + + +\end_layout + +\begin_layout Description +CTAN: +\family typewriter +language/japanese/ptex-texmf/ +\end_layout + +\begin_layout Description +Notes: These document classes provide different versions of the base LaTeX + document classes +\family sans +article +\family default +, +\family sans +report +\family default + and +\family sans +book +\family default +. + They are modified to suit Japanese writing. + Classes beginning with +\begin_inset Quotes eld +\end_inset + +t- +\begin_inset Quotes erd +\end_inset + + should be used for traditional vertical writing. +\end_layout + +\begin_layout Subsection +Japanese new standard classes +\end_layout + +\begin_layout Description +Found: +\family sans +jsarticle +\family default +: +\begin_inset Info +type "textclass" +arg "jsarticle" +\end_inset + +, +\family sans +jsbook +\family default +: +\begin_inset Info +type "textclass" +arg "jsbook" +\end_inset + + +\end_layout + +\begin_layout Description +CTAN: +\family typewriter +language/japanese/jsclasses/ +\end_layout + +\begin_layout Description +Notes: These document classes provide different versions of the base LaTeX + document classes +\family sans +article +\family default +, +\family sans +report +\family default + and +\family sans +book +\family default + with better look for Japanese typesettings. + Equivalence of the +\family sans +report +\family default + class can be obtained by using the +\family sans + jsbook +\family default + class with option +\begin_inset Quotes eld +\end_inset + +report +\begin_inset Quotes erd +\end_inset + +. +\end_layout + +\begin_layout Subsection kluwer \end_layout
Re: Todays 1.6svn crash in various ways when opening existing documents
> But this introduces crashed: I can for example not open Stefan's macro > example file, see my just > sent post on the list. As far as I know, today's crash is caused by some insets, not \begin manifest. Bo
Re: feynmf and DVI preview
> I need to include feynman diagrams in my lyx-document. Here is an alternative that don't need metafont scripts: http://wiki.lyx.org/Tips/FeynmanDiagrams regards Uwe
Re: Todays 1.6svn crash in various ways when opening existing documents
> During a fast-evolving period like this, with no public release in > between, reversion of lyx2lyx is IMHO acceptable. But this introduces crashed: I can for example not open Stefan's macro example file, see my just sent post on the list. Besides this we have the general problem that LyX can crash when a file is not in the right format. This definitively should not happen; no matter what format the file is, LyX should display an error message that the file is broken or whatever, but not crash. This could be done when LyX is using a try .. finally routine in the file open code. I'm not experienced how this is done in C++, but something should be done in this field. regards uwe
Re: Todays 1.6svn crash in various ways when opening existing documents
Martin Vermeer wrote: On Sat, Nov 03, 2007 at 12:00:42AM +0100, Abdelrazak Younes wrote: ... I fought with this fruitlessly until Jean-Marc showed me. You reverted to my old non-working code :-( Calm down, I found a better solution (appended below, I guess you cannot read lyx-cvs?). Yes, but I didn't notice until later. Looks like you got it working again (?) Yes. but the thingy in Text3.cpp doesn't look pretty. Really? In any case, I don't think we need to set the layout. Why not just accessing it through Inset::getLayout() when we need it? This will avoid an unnecessary copy and get rid of the layout_ member altogether. Also, you shouldn't modify layout_ from within the inset. (can this be enforced by const?). We can do that yes. Would be a good thing. Or see above. Can you not simply fully realize the labelfont (or a local copy) before using it in dimensionCollapsed()? A minimal fix. I fixed it by realizing it at setLayout() time. It works fine now but some insets don't have entry in stdinsets.inc. OK... but I agree with your suspicion that this is better done in insetlayout parsing. I'll do that. Abdel.
Re: Integration of my dynmacro patch
Stefan Schimanski schrieb: I have many test cases here: http://1stein.org/download/testcases.lyx With this file LyX crashes. Could you send me a file that I can open with current trunk? thanks and regards Uwe
Re: [Cvslog] r21392 - in /lyx-devel/trunk/src: Text3.cpp insets/Inset....
On Fri, Nov 02, 2007 at 09:27:41PM -, [EMAIL PROTECTED] wrote: > Author: younes > Date: Fri Nov 2 22:27:41 2007 > New Revision: 21392 > > URL: http://www.lyx.org/trac/changeset/21392 > Log: > Further cleanup of collapsable insets. The layouts are now properly read and > applied. > > > Modified: > lyx-devel/trunk/src/Text3.cpp > lyx-devel/trunk/src/insets/Inset.h > lyx-devel/trunk/src/insets/InsetBox.cpp > lyx-devel/trunk/src/insets/InsetCollapsable.cpp > lyx-devel/trunk/src/insets/InsetCollapsable.h > > Modified: lyx-devel/trunk/src/Text3.cpp > URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/Text3.cpp?rev=21392 > == > --- lyx-devel/trunk/src/Text3.cpp (original) > +++ lyx-devel/trunk/src/Text3.cpp Fri Nov 2 22:27:41 2007 > @@ -189,6 +189,9 @@ > Inset * inset = createInset(&cur.bv(), cmd); > if (!inset) > return false; > + > + if (InsetCollapsable * ci = inset->asInsetCollapsable()) > + ci->setLayout(cur.bv().buffer().params()); I once more think that insets should have a pointer to their buffer. Andre'
Re: Todays 1.6svn crash in various ways when opening existing documents
On Sat, Nov 03, 2007 at 12:00:42AM +0100, Abdelrazak Younes wrote: ... > >> OK, I've done some cleanup an the crashes are gone but the inset layouts > >> are broken! > >> > >> Martin, Richard, do you have an idea here? I don't know if we shall we > >> fix Inset::getLayout() or if we shall assume that each inset hard-code > >> its own layout. > >> > >> Help please, > >> Abdel. > > Abdel, > > this is precisely the way _not_ to do it. The calls to setLayout() in the > > various insets are designed (by Jean-Marc during the Bromarv meeting) to > > get precisely the right insetlayout based on the inset's name(). > > Year I noticed that... calling virtual methods in ctors is dangerous and > should be avoided. OK... > > I fought with this fruitlessly until Jean-Marc showed me. You > > reverted to my old non-working code :-( > > Calm down, I found a better solution (appended below, I guess you cannot > read lyx-cvs?). Yes, but I didn't notice until later. Looks like you got it working again (?) but the thingy in Text3.cpp doesn't look pretty. > > Also, you shouldn't modify layout_ from within the inset. (can this be > > enforced by const?). > > We can do that yes. Would be a good thing. > > Can you not simply fully realize the labelfont (or a local > > copy) before using it in dimensionCollapsed()? A minimal fix. > > I fixed it by realizing it at setLayout() time. It works fine now but some > insets don't have entry in stdinsets.inc. OK... but I agree with your suspicion that this is better done in insetlayout parsing. > Abdel. - Martin
Re: Todays 1.6svn crash in various ways when opening existing documents
Martin Vermeer wrote: On Fri, Nov 02, 2007 at 06:51:54PM +0100, Abdelrazak Younes wrote: Martin Vermeer wrote: On Fri, Nov 02, 2007 at 12:45:49PM +0100, Helge Hafting wrote: Start lyx, open a "recent document" - assert. Case one (A11.lyx, beamer presentation) ... Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xa62949b0 (LWP 10363)] 0x0832ec16 in lyx::InsetCollapsable::dimensionCollapsed (this=0x8c5a5e8) at ../../lyx-devel/src/insets/InsetCollapsable.cpp:178 178 layout_.labelstring, dim.wid, dim.asc, dim.des); (gdb) bt #0 0x0832ec16 in lyx::InsetCollapsable::dimensionCollapsed (this=0x8c5a5e8) at ../../lyx-devel/src/insets/InsetCollapsable.cpp:178 #1 0x083301ef in lyx::InsetCollapsable::metrics (this=0x8c5a5e8, [EMAIL PROTECTED], [EMAIL PROTECTED]) at ../../lyx-devel/src/insets/InsetCollapsable.cpp:218 #2 0x0834eca8 in lyx::InsetFootlike::metrics (this=0x8c5a5e8, [EMAIL PROTECTED], This is similar to the earlier reported bug for ERT. From memory (I am travelling) the fix is to replace the call in the constructor to InsetCollapse(bp) or ...(bp, status) by ...(bp, collapse). In ERT, Footlike, perhaps more. There is something fishy here that needs fixing at a more fundamental level, but please try this first as I cannot do much from here now. OK, I've done some cleanup an the crashes are gone but the inset layouts are broken! Martin, Richard, do you have an idea here? I don't know if we shall we fix Inset::getLayout() or if we shall assume that each inset hard-code its own layout. Help please, Abdel. Abdel, this is precisely the way _not_ to do it. The calls to setLayout() in the various insets are designed (by Jean-Marc during the Bromarv meeting) to get precisely the right insetlayout based on the inset's name(). Year I noticed that... calling virtual methods in ctors is dangerous and should be avoided. I fought with this fruitlessly until Jean-Marc showed me. You reverted to my old non-working code :-( Calm down, I found a better solution (appended below, I guess you cannot read lyx-cvs?). Also, you shouldn't modify layout_ from within the inset. (can this be enforced by const?). We can do that yes. Can you not simply fully realize the labelfont (or a local copy) before using it in dimensionCollapsed()? A minimal fix. I fixed it by realizing it at setLayout() time. It works fine now but some insets don't have entry in stdinsets.inc. Abdel. Author: younes Date: Fri Nov 2 22:27:41 2007 New Revision: 21392 URL: http://www.lyx.org/trac/changeset/21392 Log: Further cleanup of collapsable insets. The layouts are now properly read and applied. Modified: lyx-devel/trunk/src/Text3.cpp lyx-devel/trunk/src/insets/Inset.h lyx-devel/trunk/src/insets/InsetBox.cpp lyx-devel/trunk/src/insets/InsetCollapsable.cpp lyx-devel/trunk/src/insets/InsetCollapsable.h Modified: lyx-devel/trunk/src/Text3.cpp URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/Text3.cpp?rev=21392 == --- lyx-devel/trunk/src/Text3.cpp (original) +++ lyx-devel/trunk/src/Text3.cpp Fri Nov 2 22:27:41 2007 @@ -189,6 +189,9 @@ Inset * inset = createInset(&cur.bv(), cmd); if (!inset) return false; + + if (InsetCollapsable * ci = inset->asInsetCollapsable()) + ci->setLayout(cur.bv().buffer().params()); cur.recordUndo(); if (cmd.action == LFUN_INDEX_INSERT) { Modified: lyx-devel/trunk/src/insets/Inset.h URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/Inset.h?rev=21392 == --- lyx-devel/trunk/src/insets/Inset.h (original) +++ lyx-devel/trunk/src/insets/Inset.h Fri Nov 2 22:27:41 2007 @@ -35,6 +35,7 @@ class FuncRequest; class FuncStatus; class InsetIterator; +class InsetCollapsable; class InsetLayout; class InsetList; class InsetMath; @@ -88,6 +89,10 @@ virtual InsetText * asTextInset() { return 0; } /// is this inset based on the TextInset class? virtual InsetText const * asTextInset() const { return 0; } + /// is this inset based on the InsetCollapsable class? + virtual InsetCollapsable * asInsetCollapsable() { return 0; } + /// is this inset based on the InsetCollapsable class? + virtual InsetCollapsable const * asInsetCollapsable() const { return 0; } /// the real dispatcher void dispatch(Cursor & cur, FuncRequest & cmd); Modified: lyx-devel/trunk/src/insets/InsetBox.cpp URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetBox.cpp?rev=21392 == --- lyx-devel/trunk/src/insets/InsetBox.cpp (original) +++ lyx-devel/trunk/src/insets/InsetBox.cpp Fri Nov 2 22:27:41 2007 @@ -199,7 +199,6 @@
Re: Todays 1.6svn crash in various ways when opening existing documents
On Fri, Nov 02, 2007 at 06:51:54PM +0100, Abdelrazak Younes wrote: > Martin Vermeer wrote: > > On Fri, Nov 02, 2007 at 12:45:49PM +0100, Helge Hafting wrote: > >> Start lyx, open a "recent document" - assert. > >> > >> Case one (A11.lyx, beamer presentation) > > ... > >> Program received signal SIGSEGV, Segmentation fault. > >> [Switching to Thread 0xa62949b0 (LWP 10363)] > >> 0x0832ec16 in lyx::InsetCollapsable::dimensionCollapsed (this=0x8c5a5e8) > >> at ../../lyx-devel/src/insets/InsetCollapsable.cpp:178 > >> 178 layout_.labelstring, dim.wid, dim.asc, dim.des); > >> (gdb) bt > >> #0 0x0832ec16 in lyx::InsetCollapsable::dimensionCollapsed > >> (this=0x8c5a5e8) > >> at ../../lyx-devel/src/insets/InsetCollapsable.cpp:178 > >> #1 0x083301ef in lyx::InsetCollapsable::metrics (this=0x8c5a5e8, > >> [EMAIL PROTECTED], [EMAIL PROTECTED]) > >> at ../../lyx-devel/src/insets/InsetCollapsable.cpp:218 > >> #2 0x0834eca8 in lyx::InsetFootlike::metrics (this=0x8c5a5e8, > >> [EMAIL PROTECTED], > > This is similar to the earlier reported bug for ERT. > > From memory (I am travelling) the fix is to replace the call > > in the constructor to InsetCollapse(bp) or ...(bp, status) > > by ...(bp, collapse). In ERT, Footlike, perhaps more. > > There is something fishy here that needs fixing at a more > > fundamental level, but please try this first as I cannot do > > much from here now. > > OK, I've done some cleanup an the crashes are gone but the inset layouts are > broken! > > Martin, Richard, do you have an idea here? I don't know if we shall we fix > Inset::getLayout() or if we shall assume that each inset hard-code its own > layout. > > Help please, > Abdel. Abdel, this is precisely the way _not_ to do it. The calls to setLayout() in the various insets are designed (by Jean-Marc during the Bromarv meeting) to get precisely the right insetlayout based on the inset's name(). I fought with this fruitlessly until Jean-Marc showed me. You reverted to my old non-working code :-( Also, you shouldn't modify layout_ from within the inset. (can this be enforced by const?). Can you not simply fully realize the labelfont (or a local copy) before using it in dimensionCollapsed()? A minimal fix. - Martin
Re: Todays 1.6svn crash in various ways when opening existing documents
On Nov 2, 2007 3:47 PM, Uwe Stöhr <[EMAIL PROTECTED]> wrote: > >> I can do that, no problem. > >> I though lyx2lyx would do such things anyway though, > > > > I did not want to complicate lyx2lyx by adding another reversion > > function to remove this section. > > This won't complicate lyx2lyx, that's what lyx2lyx is for. Removing stuff > manually from a LyX file > using an editor is no option! During a fast-evolving period like this, with no public release in between, reversion of lyx2lyx is IMHO acceptable. In this particular case, if version 250 adds the manifest section, and 260 removes this section, all 1.5.0 to 1.6.0 conversion will go through this useless addition and removal, so I reverted part of version 250 (I do not remember the exact format number). Cheers, Bo
Re: Todays 1.6svn crash in various ways when opening existing documents
>> I can do that, no problem. >> I though lyx2lyx would do such things anyway though, > > I did not want to complicate lyx2lyx by adding another reversion > function to remove this section. This won't complicate lyx2lyx, that's what lyx2lyx is for. Removing stuff manually from a LyX file using an editor is no option! When you tell me what need to be changed, I can implement this as I think this is not complicated. regards Uwe
Re: [patch] pixmap cache goes rc
> I applied the thing to branch. I need to describe this in the docs. What exactly does the pixmap? Is there a wiki-page about this? regards Uwe
warnings
lyxactOnUpdatedPrefs(const lyx::LyXRC&, const lyx::LyXRC&)': ../../trunk/src/LyXFunc.cpp:2477: warning: enumeration value 'RC_DEFFILE' not handled in switch ../../trunk/src/LyXFunc.cpp:2477: warning: enumeration value 'RC_USE_PIXMAP_CACHE' not handled in switch Please fix. Andre'
Re: docstring help needed
On Fri, Nov 02, 2007 at 02:33:03PM +0100, Edwin Leuven wrote: > Uwe Stöhr wrote: >> Then my comments are not good enough. \href requires some characters to be >> escaped or changed. The for loop parse the string for a certain character >> and do something with it when found. Every loop run checks for another >> character of the list. > > maybe qurl can help here? > http://doc.trolltech.com/4.1/qurl.html Heretic. Andre'
Re: Todays 1.6svn crash in various ways when opening existing documents
Abdelrazak Younes wrote: OK, I've done some cleanup an the crashes are gone but the inset layouts are broken! Martin, Richard, do you have an idea here? I don't know if we shall we fix Inset::getLayout() or if we shall assume that each inset hard-code its own layout. OK, I see that the font definitions comes from 'lib/stdinsets.inc'. For example we have this for footnotes: InsetLayout Foot LabelString foot LatexType command LatexName footnote Font Color foreground SizeSmall Family Roman Shape Up Series Medium MiscNo_Emph MiscNo_Noun MiscNo_Bar EndFont LabelFont Color Green SizeSmall EndFont MultiPar true End It seems that this is not properly parsed then. I am going to remove the work around in the code so that we can fix the parsing instead. Abdel.
Re: [Cvslog] r21375 - /lyx-devel/trunk/src/frontends/qt4/ui/PrefUi.ui
Andre Poenitz wrote: On Fri, Nov 02, 2007 at 05:33:08PM +0100, Abdelrazak Younes wrote: Jürgen Spitzmüller wrote: [EMAIL PROTECTED] wrote: save prefui in qt422 format Since when do we require qt 4.2? The format is the same as 4.1. In any case, we should bump the requirements. Are you prepared for another political fight? ;-) Abdel.
Re: [Cvslog] r21375 - /lyx-devel/trunk/src/frontends/qt4/ui/PrefUi.ui
On Fri, Nov 02, 2007 at 05:33:08PM +0100, Abdelrazak Younes wrote: > Jürgen Spitzmüller wrote: >> [EMAIL PROTECTED] wrote: >>> save prefui in qt422 format >> Since when do we require qt 4.2? > > The format is the same as 4.1. In any case, we should bump the requirements. Andre'
Re: [Cvslog] r21375 - /lyx-devel/trunk/src/frontends/qt4/ui/PrefUi.ui
On Nov 2, 2007 11:55 AM, Jürgen Spitzmüller <[EMAIL PROTECTED]> wrote: > Abdelrazak Younes wrote: > > The format is the same as 4.1. > > So why the change? I did the designer changes with qt 4.1. I change from 4.3 format to 4.22 (which is supposedly the same as 4.1). I could not compile the trunk without this change. Bo
Re: Todays 1.6svn crash in various ways when opening existing documents
Martin Vermeer wrote: On Fri, Nov 02, 2007 at 12:45:49PM +0100, Helge Hafting wrote: Start lyx, open a "recent document" - assert. Case one (A11.lyx, beamer presentation) ... Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xa62949b0 (LWP 10363)] 0x0832ec16 in lyx::InsetCollapsable::dimensionCollapsed (this=0x8c5a5e8) at ../../lyx-devel/src/insets/InsetCollapsable.cpp:178 178 layout_.labelstring, dim.wid, dim.asc, dim.des); (gdb) bt #0 0x0832ec16 in lyx::InsetCollapsable::dimensionCollapsed (this=0x8c5a5e8) at ../../lyx-devel/src/insets/InsetCollapsable.cpp:178 #1 0x083301ef in lyx::InsetCollapsable::metrics (this=0x8c5a5e8, [EMAIL PROTECTED], [EMAIL PROTECTED]) at ../../lyx-devel/src/insets/InsetCollapsable.cpp:218 #2 0x0834eca8 in lyx::InsetFootlike::metrics (this=0x8c5a5e8, [EMAIL PROTECTED], This is similar to the earlier reported bug for ERT. From memory (I am travelling) the fix is to replace the call in the constructor to InsetCollapse(bp) or ...(bp, status) by ...(bp, collapse). In ERT, Footlike, perhaps more. There is something fishy here that needs fixing at a more fundamental level, but please try this first as I cannot do much from here now. OK, I've done some cleanup an the crashes are gone but the inset layouts are broken! Martin, Richard, do you have an idea here? I don't know if we shall we fix Inset::getLayout() or if we shall assume that each inset hard-code its own layout. Help please, Abdel. Author: younes Date: Fri Nov 2 18:47:51 2007 New Revision: 21382 URL: http://www.lyx.org/trac/changeset/21382 Log: * InsetCollapsable: - InsetCollapsable(): Move labelfont initialisation to InsetCollapsable::setLayout(). - read(): reset the inset layout. All other insets: get rid of redundant setLayout() calls. This commit fixes the multiple crashes in trunk but the color used for text and background are completely wrong... Modified: lyx-devel/trunk/src/insets/InsetBox.cpp lyx-devel/trunk/src/insets/InsetBranch.cpp lyx-devel/trunk/src/insets/InsetCollapsable.cpp lyx-devel/trunk/src/insets/InsetERT.cpp lyx-devel/trunk/src/insets/InsetFoot.cpp lyx-devel/trunk/src/insets/InsetIndex.cpp lyx-devel/trunk/src/insets/InsetListings.cpp lyx-devel/trunk/src/insets/InsetMarginal.cpp lyx-devel/trunk/src/insets/InsetNote.cpp Modified: lyx-devel/trunk/src/insets/InsetBox.cpp URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetBox.cpp?rev=21382 == --- lyx-devel/trunk/src/insets/InsetBox.cpp (original) +++ lyx-devel/trunk/src/insets/InsetBox.cpp Fri Nov 2 18:47:51 2007 @@ -94,7 +94,6 @@ InsetBox::InsetBox(BufferParams const & bp, string const & label) : InsetCollapsable(bp), params_(label) { - setLayout(bp); init(); } @@ -135,7 +134,6 @@ { params_.read(lex); InsetCollapsable::read(buf, lex); - setLayout(buf.params()); setButtonLabel(); } Modified: lyx-devel/trunk/src/insets/InsetBranch.cpp URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetBranch.cpp?rev=21382 == --- lyx-devel/trunk/src/insets/InsetBranch.cpp (original) +++ lyx-devel/trunk/src/insets/InsetBranch.cpp Fri Nov 2 18:47:51 2007 @@ -45,7 +45,6 @@ InsetBranchParams const & params) : InsetCollapsable(bp), params_(params) { - setLayout(bp); init(); } @@ -86,8 +85,6 @@ { params_.read(lex); InsetCollapsable::read(buf, lex); - setLayout(buf.params()); - setButtonLabel(); } @@ -137,7 +134,6 @@ InsetBranchMailer::string2params(to_utf8(cmd.argument()), params); params_.branch = params.branch; setLayout(cur.buffer().params()); - setButtonLabel(); break; } Modified: lyx-devel/trunk/src/insets/InsetCollapsable.cpp URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetCollapsable.cpp?rev=21382 == --- lyx-devel/trunk/src/insets/InsetCollapsable.cpp (original) +++ lyx-devel/trunk/src/insets/InsetCollapsable.cpp Fri Nov 2 18:47:51 2007 @@ -82,14 +82,7 @@ setDrawFrame(true); setFrameColor(Color_collapsableframe); setButtonLabel(); - // Fallback for lacking inset layout item - layout_.bgcolor = Color_background; - - // FIXME: it seems some insets don't properly initialise that! - layout_.labelfont = sane_font; - layout_.labelfont.decSize(); - layout_.labelfont.decSize(); - layout_.labelfont.setColor(Color_collapsable); + setLayout(bp); } @@ -110,7 +103,25 @@ void InsetCollapsable::setLayout(BufferParams const & bp) { + // Fallback for lacking in
Re: [Cvslog] r21375 - /lyx-devel/trunk/src/frontends/qt4/ui/PrefUi.ui
Jürgen Spitzmüller wrote: Abdelrazak Younes wrote: The format is the same as 4.1. So why the change? I did the designer changes with qt 4.1. Yep, and that was the reason why the change was so big in your last commit. I think Designer 4.2 sometimes re-arrange the structure but it stays 4.1 compatible. If the question is why Bo change it back to 4.2, I don't know. We should probably settle on a single version in order to avoid those big diffs. Abdel.
Re: [Cvslog] r21375 - /lyx-devel/trunk/src/frontends/qt4/ui/PrefUi.ui
Abdelrazak Younes wrote: > The format is the same as 4.1. So why the change? I did the designer changes with qt 4.1. Jürgen
Re: [Cvslog] r21375 - /lyx-devel/trunk/src/frontends/qt4/ui/PrefUi.ui
Jürgen Spitzmüller wrote: [EMAIL PROTECTED] wrote: save prefui in qt422 format Since when do we require qt 4.2? The format is the same as 4.1. Abdel.
Re: [Cvslog] r21375 - /lyx-devel/trunk/src/frontends/qt4/ui/PrefUi.ui
[EMAIL PROTECTED] wrote: > save prefui in qt422 format Since when do we require qt 4.2? Jürgen
Re: trunk compile problem
> This seems to be my fault. Which Qt do you use? Maybe the QColor > constructors with reals are too new. Cannot check myself right now as I am > in the middle of a OS update, sorry. 4.3.0 pavel
Re: trunk compile problem
GuiPainter.cpp: In member function 'QColor lyx::frontend::GuiPainter::filterColor(const QColor&)': GuiPainter.cpp:140: warning: passing 'qreal' for argument 1 to 'QColor::QColor(int, int, int, int)' GuiPainter.cpp:140: warning: passing 'qreal' for argument 2 to 'QColor::QColor(int, int, int, int)' GuiPainter.cpp:140: warning: passing 'qreal' for argument 3 to 'QColor::QColor(int, int, int, int)' GuiKeySymbol.cpp: At global scope: GuiKeySymbol.cpp:44: warning: 'char lyx::encode(const std::string&, const QString&)' defined but not used make[6]: *** [liblyxqt4.lo] Error 1 This seems to be my fault. Which Qt do you use? Maybe the QColor constructors with reals are too new. Cannot check myself right now as I am in the middle of a OS update, sorry. Stefan PGP.sig Description: Signierter Teil der Nachricht
Re: Todays 1.6svn crash in various ways when opening existing documents
Martin Vermeer wrote: On Fri, Nov 02, 2007 at 12:45:49PM +0100, Helge Hafting wrote: Start lyx, open a "recent document" - assert. Case one (A11.lyx, beamer presentation) ... Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xa62949b0 (LWP 10363)] 0x0832ec16 in lyx::InsetCollapsable::dimensionCollapsed (this=0x8c5a5e8) at ../../lyx-devel/src/insets/InsetCollapsable.cpp:178 178 layout_.labelstring, dim.wid, dim.asc, dim.des); (gdb) bt #0 0x0832ec16 in lyx::InsetCollapsable::dimensionCollapsed (this=0x8c5a5e8) at ../../lyx-devel/src/insets/InsetCollapsable.cpp:178 #1 0x083301ef in lyx::InsetCollapsable::metrics (this=0x8c5a5e8, [EMAIL PROTECTED], [EMAIL PROTECTED]) at ../../lyx-devel/src/insets/InsetCollapsable.cpp:218 #2 0x0834eca8 in lyx::InsetFootlike::metrics (this=0x8c5a5e8, [EMAIL PROTECTED], This is similar to the earlier reported bug for ERT. From memory (I am travelling) the fix is to replace the call in the constructor to InsetCollapse(bp) or ...(bp, status) by ...(bp, collapse). In ERT, Footlike, perhaps more. There is something fishy here that needs fixing at a more fundamental level, but please try this first as I cannot do much from here now. The problems seems to lie in the default InsetLayout. I guess layout_.labelfont needs to be realized before being passed to the theFontMetrics? Dimension InsetCollapsable::dimensionCollapsed() const { Dimension dim; theFontMetrics(layout_.labelfont).buttonText( layout_.labelstring, dim.wid, dim.asc, dim.des); return dim; } Abdel.
Re: Font problem with the modular "code" style in 1.6svn
On Fri, Nov 02, 2007 at 04:12:15PM +0100, Helge Hafting wrote: > I experiment with the new modules, and saw a problem > with "code" today. (LyX compiled 17.oct) > > If I emphasize a paragraph that contains a word in 'code' > text style, then the code is emphasized too - as it should. > > If I first emphasize the word and then apply 'code' > around the emphasized word, then everything look > ok on screen (emphasized courier) but > view->pdf gives me upright courier. The emphasis was lost. > > Helge Hafting Yes... I believe this can be fixed in the layout (module) file. Look at what I did for the other text styles... unfortunately I have no graphical login from here, so I can only play consultancy cat... - Martin
Re: Todays 1.6svn crash in various ways when opening existing documents
> I can do that, no problem. > I though lyx2lyx would do such things anyway though, I did not want to complicate lyx2lyx by adding another reversion function to remove this section. > or that the unknown stuff would be lost the next time I save > a changed file? Yes. (But the trunk crashes quite often now). Bo
Font problem with the modular "code" style in 1.6svn
I experiment with the new modules, and saw a problem with "code" today. (LyX compiled 17.oct) If I emphasize a paragraph that contains a word in 'code' text style, then the code is emphasized too - as it should. If I first emphasize the word and then apply 'code' around the emphasized word, then everything look ok on screen (emphasized courier) but view->pdf gives me upright courier. The emphasis was lost. Helge Hafting
Re: Todays 1.6svn crash in various ways when opening existing documents
Bo Peng wrote: On Nov 2, 2007 6:45 AM, Helge Hafting <[EMAIL PROTECTED]> wrote: Start lyx, open a "recent document" - assert. Case one (A11.lyx, beamer presentation) Handling unknown body token: `\begin_manifest' Handling unknown body token: `\end_manifest' Handling unknown body token: `\begin_manifest' Handling unknown body token: `\end_manifest' This will not crash lyx but please manually remove \begin_manifest to \end_manifest from your lyx file. This section has been removed and I have removed such lines from our documentations. I can do that, no problem. I though lyx2lyx would do such things anyway though, or that the unknown stuff would be lost the next time I save a changed file? Helge Hafting
Re: Repeatable crash with lyx 1.5.2.
> Confirmed. Please open a bug report with target 1.5.3. Done. 4317. Bo
Re: Repeatable crash with lyx 1.5.2.
Bo Peng wrote: > 1. Create a new file, enter two lines of text and change the style of > the first line to section. ( a sample is attached). > > 2. select both lines, with mouse ending at the first line. > > 3. type something, the section title is changed > > 4. click on the second line, lyx crashes Confirmed. Please open a bug report with target 1.5.3. Jürgen
Re: [PATCH] 1.5.x, fix ambigous translation of "cc"
Helge Hafting wrote: > "cc" is a unit of measure, as well as short for "carbon copy". > These cases need different translations, this is now possible > by changing to "cc[[unit of measure]]". (The bracketed explanation is > not used in the compiled binary, of course.) committed to trunk and branch. Jürgen
Re: Todays 1.6svn crash in various ways when opening existing documents
On Nov 2, 2007 6:45 AM, Helge Hafting <[EMAIL PROTECTED]> wrote: > Start lyx, open a "recent document" - assert. > > Case one (A11.lyx, beamer presentation) > > Handling unknown body token: `\begin_manifest' > Handling unknown body token: `\end_manifest' > Handling unknown body token: `\begin_manifest' > Handling unknown body token: `\end_manifest' This will not crash lyx but please manually remove \begin_manifest to \end_manifest from your lyx file. This section has been removed and I have removed such lines from our documentations. Bo
Re: Todays 1.6svn crash in various ways when opening existing documents
On Fri, Nov 02, 2007 at 12:45:49PM +0100, Helge Hafting wrote: > Start lyx, open a "recent document" - assert. > > Case one (A11.lyx, beamer presentation) ... > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread 0xa62949b0 (LWP 10363)] > 0x0832ec16 in lyx::InsetCollapsable::dimensionCollapsed (this=0x8c5a5e8) > at ../../lyx-devel/src/insets/InsetCollapsable.cpp:178 > 178 layout_.labelstring, dim.wid, dim.asc, dim.des); > (gdb) bt > #0 0x0832ec16 in lyx::InsetCollapsable::dimensionCollapsed (this=0x8c5a5e8) > at ../../lyx-devel/src/insets/InsetCollapsable.cpp:178 > #1 0x083301ef in lyx::InsetCollapsable::metrics (this=0x8c5a5e8, > [EMAIL PROTECTED], [EMAIL PROTECTED]) > at ../../lyx-devel/src/insets/InsetCollapsable.cpp:218 > #2 0x0834eca8 in lyx::InsetFootlike::metrics (this=0x8c5a5e8, > [EMAIL PROTECTED], This is similar to the earlier reported bug for ERT. >From memory (I am travelling) the fix is to replace the call in the constructor to InsetCollapse(bp) or ...(bp, status) by ...(bp, collapse). In ERT, Footlike, perhaps more. There is something fishy here that needs fixing at a more fundamental level, but please try this first as I cannot do much from here now. - Martin
Re: docstring help needed
Edwin Leuven wrote: Uwe Stöhr wrote: Then my comments are not good enough. \href requires some characters to be escaped or changed. The for loop parse the string for a certain character and do something with it when found. Every loop run checks for another character of the list. maybe qurl can help here? http://doc.trolltech.com/4.1/qurl.html This is not frontend code but inset code. But you're right that it would help. Abdel.
Re: Wide patch? (was Re: Patch Candidate List #6)
Abdelrazak Younes wrote: > Juergen? OK. Jürgen
Re: docstring help needed
Uwe Stöhr wrote: Then my comments are not good enough. \href requires some characters to be escaped or changed. The for loop parse the string for a certain character and do something with it when found. Every loop run checks for another character of the list. maybe qurl can help here? http://doc.trolltech.com/4.1/qurl.html
Re: docstring help needed
Uwe Stöhr wrote: > There are other things to clean up in there, it is not clear what the different 'for' loop are > doing with the strings. Then my comments are not good enough. \href requires some characters to be escaped or changed. The for loop parse the string for a certain character and do something with it when found. Every loop run checks for another character of the list. OK, I guess we have some existing helper function that does that. If not, it makes sense to factorize the different search in a common helper function. > - url = to_utf8(getParam("type")) + url; > + url += getParam("type"); For me this format is not intuitive. With the format above you immediately see if it is Oups, I've created a bug here, sorry you're right, I'll correct that. url + x yes. or x + url no. because this would result in a different output. Well, that's the STL string notation, it's a matter of getting used to it. If you really don't like it you can also use url.append(...) which I agree is clearer. Using 'url = url + x' is not efficient memory and CPU wise as you have an additional instantiation and an additional copy. Abdel.
Re: trunk compile problem
>> Richard, we have a restriction of which you might not ave heard yet: >> static functions/objects need to have different names, even if they >> are in different .cpp files, otherwise the 'chunked build' will fail. >> > Sorry! I've fixed it. > > rh there is another one problem: make[6]: Entering directory `/home/paf/mac/ledpar/src/frontends/qt4' /bin/sh ../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../src -DQT_CLEAN_NAMESPACE -DQT_GENUINE_STR -DQT_NO_STL -DQT_NO_KEYWORDS -I../../../src -I../../../src/frontends -I../../../images -DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I../../../boost -I../../../src/frontends/controllers -Wextra -Wall -O -MT liblyxqt4.lo -MD -MP -MF .deps/liblyxqt4.Tpo -c -o liblyxqt4.lo liblyxqt4.cpp g++ -DHAVE_CONFIG_H -I. -I../../../src -DQT_CLEAN_NAMESPACE -DQT_GENUINE_STR -DQT_NO_STL -DQT_NO_KEYWORDS -I../../../src -I../../../src/frontends -I../../../images -DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I../../../boost -I../../../src/frontends/controllers -Wextra -Wall -O -MT liblyxqt4.lo -MD -MP -MF .deps/liblyxqt4.Tpo -c liblyxqt4.cpp -o liblyxqt4.o ui_TextLayoutUi.h: In member function 'void Ui_TextLayoutUi::setupUi(QWidget*)': ui_TextLayoutUi.h:154: error: expected primary-expression before '(' token ui_TextLayoutUi.h:154: error: expected type-specifier ui_TextLayoutUi.h:154: error: expected `>' ui_TextLayoutUi.h:154: error: expected `(' ui_TextLayoutUi.h:154: error: expected unqualified-id before numeric constant ui_TextLayoutUi.h:154: error: expected `)' before numeric constant ../../../src/DispatchResult.h: In constructor 'lyx::DispatchResult::DispatchResult()': ../../../src/DispatchResult.h:24: error: expected unqualified-id before numeric constant GuiPainter.cpp: In member function 'QColor lyx::frontend::GuiPainter::filterColor(const QColor&)': GuiPainter.cpp:140: warning: passing 'qreal' for argument 1 to 'QColor::QColor(int, int, int, int)' GuiPainter.cpp:140: warning: passing 'qreal' for argument 2 to 'QColor::QColor(int, int, int, int)' GuiPainter.cpp:140: warning: passing 'qreal' for argument 3 to 'QColor::QColor(int, int, int, int)' GuiKeySymbol.cpp: At global scope: GuiKeySymbol.cpp:44: warning: 'char lyx::encode(const std::string&, const QString&)' defined but not used make[6]: *** [liblyxqt4.lo] Error 1 pavel
Re: docstring help needed
Thanks for looking at this! > That's because you used strings instead of characters. Yes this was really my problem - sometimes things can be so simple. > There are other things to clean up in there, it is not clear what the different 'for' loop are > doing with the strings. Then my comments are not good enough. \href requires some characters to be escaped or changed. The for loop parse the string for a certain character and do something with it when found. Every loop run checks for another character of the list. > - url = to_utf8(getParam("type")) + url; > + url += getParam("type"); For me this format is not intuitive. With the format above you immediately see if it is url + x or x + url because this would result in a different output. thanks and regards Uwe
[Patch] 1.6svn fix ambigous translation of length units
Two tranlsation clashes in lengthcommon.cpp fixed in the attached patch: The unit cc clashes with cc meaning carbon copy. The unit in clashes with other use of the word in. Solved by changing to cc[[unit of measure]] and in[[unit of measure]] I changed the units only, because these are less likely to need translation than the other cases. Also, it is enough for solving the problem. Helge Hafting Index: lengthcommon.cpp === --- lengthcommon.cpp(revisjon 21367) +++ lengthcommon.cpp(arbeidskopi) @@ -36,7 +36,7 @@ // the LyX gui units char const * const unit_name_gui[] = { N_("sp"), N_("pt"), N_("bp"), N_("dd"), N_("mm"), N_("pc"), - N_("cc"), N_("cm"), N_("in"), N_("ex"), N_("em"), N_("mu"), + N_("cc[[unit of measure]]"), N_("cm"), N_("in[[unit of measure]]"), N_("ex"), N_("em"), N_("mu"), N_("Text Width %"), N_("Column Width %"), N_("Page Width %"), N_("Line Width %"), N_("Text Height %"), N_("Page Height %"), "" };
[PATCH] 1.5.x, fix ambigous translation of "cc"
"cc" is a unit of measure, as well as short for "carbon copy". These cases need different translations, this is now possible by changing to "cc[[unit of measure]]". (The bracketed explanation is not used in the compiled binary, of course.) The patch is minimal as the cc unit appear once, while "carbon copy cc" exists in several .layout files. Helge Hafting Index: lengthcommon.cpp === --- lengthcommon.cpp(revisjon 21287) +++ lengthcommon.cpp(arbeidskopi) @@ -35,7 +35,7 @@ // the LyX gui units char const * const unit_name_gui[] = { N_("sp"), N_("pt"), N_("bp"), N_("dd"), N_("mm"), N_("pc"), - N_("cc"), N_("cm"), N_("in"), N_("ex"), N_("em"), N_("mu"), + N_("cc[[unit of measure]]"), N_("cm"), N_("in"), N_("ex"), N_("em"), N_("mu"), N_("Text Width %"), N_("Column Width %"), N_("Page Width %"), N_("Line Width %"), N_("Text Height %"), N_("Page Height %"), "" };
Todays 1.6svn crash in various ways when opening existing documents
Start lyx, open a "recent document" - assert. Case one (A11.lyx, beamer presentation) Handling unknown body token: `\begin_manifest' Handling unknown body token: `\end_manifest' Handling unknown body token: `\begin_manifest' Handling unknown body token: `\end_manifest' Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xa62949b0 (LWP 10363)] 0x0832ec16 in lyx::InsetCollapsable::dimensionCollapsed (this=0x8c5a5e8) at ../../lyx-devel/src/insets/InsetCollapsable.cpp:178 178 layout_.labelstring, dim.wid, dim.asc, dim.des); (gdb) bt #0 0x0832ec16 in lyx::InsetCollapsable::dimensionCollapsed (this=0x8c5a5e8) at ../../lyx-devel/src/insets/InsetCollapsable.cpp:178 #1 0x083301ef in lyx::InsetCollapsable::metrics (this=0x8c5a5e8, [EMAIL PROTECTED], [EMAIL PROTECTED]) at ../../lyx-devel/src/insets/InsetCollapsable.cpp:218 #2 0x0834eca8 in lyx::InsetFootlike::metrics (this=0x8c5a5e8, [EMAIL PROTECTED], [EMAIL PROTECTED]) at ../../lyx-devel/src/insets/InsetFootlike.cpp:39 #3 0x08189049 in lyx::TextMetrics::redoParagraph (this=0x8c4af8c, pit=12) at ../../lyx-devel/src/TextMetrics.cpp:422 #4 0x081dd7ff in lyx::BufferView::updateMetrics (this=0x8c663b8, singlepar=false) at ../../lyx-devel/src/BufferView.cpp:1868 #5 0x0856a5fc in lyx::frontend::TabWorkArea::on_currentTabChanged ( this=0x89b8f78, i=1) at ../../../../lyx-devel/src/frontends/qt4/GuiWorkArea.cpp:812 #6 0x0856a837 in lyx::frontend::TabWorkArea::qt_metacall (this=0x89b8f78, _c=QMetaObject::InvokeMetaMethod, _id=-2, _a=0xafab979c) at ./GuiWorkArea_moc.cpp:132 #7 0xa7524aca in QMetaObject::activate () from /usr/lib/libQtCore.so.4 #8 0xa7525682 in QMetaObject::activate () from /usr/lib/libQtCore.so.4 #9 0xa7b13f73 in QTabWidget::currentChanged () from /usr/lib/libQtGui.so.4 #10 0xa7b1615a in ?? () from /usr/lib/libQtGui.so.4 #11 0x089b8f78 in ?? () #12 0x0001 in ?? () #13 0xa7127492 in std::basic_streambuf >::xsputn () from /usr/lib/libstdc++.so.6 #14 0xa7d45f48 in ?? () from /usr/lib/libQtGui.so.4 #15 0x in ?? () Case 2 (lek08.lyx using modified komascript book) Handling unknown body token: `\begin_manifest' Handling unknown body token: `\end_manifest' ASSERT failure in QFont::setPointSizeF: "point size must be greater than 0", file text/qfont.cpp, line 710 Program received signal SIGABRT, Aborted. [Switching to Thread 0xa63519b0 (LWP 10416)] 0xa7fb2410 in __kernel_vsyscall () (gdb) bt #0 0xa7fb2410 in __kernel_vsyscall () #1 0xa70017f5 in raise () from /lib/i686/cmov/libc.so.6 #2 0xa7003181 in abort () from /lib/i686/cmov/libc.so.6 #3 0xa75135c5 in qt_message_output () from /usr/lib/libQtCore.so.4 #4 0xa7513679 in qFatal () from /usr/lib/libQtCore.so.4 #5 0xa75136cc in qt_assert_x () from /usr/lib/libQtCore.so.4 #6 0xa79a83d6 in QFont::setPointSizeF () from /usr/lib/libQtGui.so.4 #7 0x08489ecf in GuiFontInfo (this=0x8ba0e70, [EMAIL PROTECTED]) at ../../../../lyx-devel/src/frontends/qt4/GuiFontLoader.cpp:318 #8 0x0848baea in lyx::frontend::GuiFontLoader::metrics (this=0x87c11c0, [EMAIL PROTECTED]) at ../../../../lyx-devel/src/frontends/qt4/GuiFontLoader.h:75 #9 0x083f44a5 in lyx::theFontMetrics ([EMAIL PROTECTED]) at ../../../lyx-devel/src/frontends/Application.cpp:115 #10 0x0832ec13 in lyx::InsetCollapsable::dimensionCollapsed (this=0x8b8a1e0) at ../../lyx-devel/src/insets/InsetCollapsable.cpp:178 #11 0x0832f875 in lyx::InsetCollapsable::draw (this=0x8b8a1e0, [EMAIL PROTECTED], x=164, y=625) at ../../lyx-devel/src/insets/InsetCollapsable.cpp:259 #12 0x08265e74 in lyx::RowPainter::paintInset (this=0xafb5de44, inset=0x8b8a1e0, pos=88) at ../../lyx-devel/src/rowpainter.cpp:140 #13 0x082683e0 in lyx::RowPainter::paintText (this=0xafb5de44) at ../../lyx-devel/src/rowpainter.cpp:792 #14 0x0818ac2f in lyx::TextMetrics::drawParagraph (this=0x8b43224, [EMAIL PROTECTED], pit=91, x=0, y=625) at ../../lyx-devel/src/TextMetrics.cpp:2001 #15 0x0818b01c in lyx::TextMetrics::draw (this=0x8b43224, [EMAIL PROTECTED], x=0, y=592) at ../../lyx-devel/src/TextMetrics.cpp:1916 #16 0x081dcc41 in lyx::BufferView::draw (this=0x8b8aa00, [EMAIL PROTECTED]) at ../../lyx-devel/src/BufferView.cpp:2124 #17 0x0856887e in lyx::frontend::GuiWorkArea::updateScreen (this=0x8b8ba58) at ../../../../lyx-devel/src/frontends/qt4/GuiWorkArea.cpp:503 #18 0x08569133 in lyx::frontend::GuiWorkArea::paintEvent (this=0x8b8ba58, ev=0xafb5e5e4) at ../../../../lyx-devel/src/frontends/qt4/GuiWorkArea.cpp:480 #19 0xa78733fd in QWidget::event () from /usr/lib/libQtGui.so.4 #20 0xa7b68493 in QFrame::event () from /usr/lib/libQtGui.so.4 #21 0xa7bee1df in QAbstractScrollArea::viewportEvent () from /usr/lib/libQtGui.so.4 #22 0xa7bef3d5 in ?? () from /usr/lib/libQtGui.so.4 #23 0x08b8ba58 in ?? () #24 0xafb5e5e4 in ?? () #25 0xafb5e278 in ?? () #26 0xa78295d2 in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4 Backtrace stopped: fra
Re: Translation problem: "cc" has two different meanings, but only one translation
Pavel Sanda wrote: What is the correct way to do this? you can not do this until somebody changes string in source code using [[]] . Ok, I'll create a trivial patch to the source for this. Helge Hafting
Re: [patch] pixmap cache goes rc
Abdelrazak Younes wrote: > And I confirm that it works fine. Good. I applied the thing to branch. Will do trunk later. Jürgen
Wide patch? (was Re: Patch Candidate List #6)
Abdelrazak Younes wrote: Bennett Helm wrote: On Oct 24, 2007, at 11:45 AM, Abdelrazak Younes wrote: Bennett Helm wrote: On Oct 24, 2007, at 2:16 AM, Abdelrazak Younes wrote: I'm not sure what to be testing here. Is the patch already applied in changeset 20728? (If not, what is the patch?) In any case, what should I be testing? The attached patch. Sorry, I meant: what functionality should I be testing? Speed and Inset drawing correctness (WRT text frames, etc). Speed looks much better, I am not really surprised but thanks for the conformation :-) though I suspect someone should try it with PPC Mac. (Anders?) Yes, please. I notice a few drawing mistakes: with a colored background in the inset (as with LyX Notes), the color of the line with the cursor in it bleeds out of the note (see attached screenshot). This is when the inset is at least 2 lines long and you've typed something in the line. The attached updated patch solves this. Note that 1.5.2 is also buggy WRT that. This bug is visible when you insert a Note (or any inset with non default background color) within a fixed width box for example. The behavior is now correct with my patch. With the second screenshot, the cursor is inside the yellow inset, just outside the inner white inset; however, notice that it is drawn outside the yellow inset. Also notice that the word "long" in the 3rd line is pushed too far to the right (slightly outside the yellow inset border) because it is immediately followed by the white inset. This one is difficult to solve but tolerable IMHO. Juergen? Abdel.
Re: [patch] pixmap cache goes rc
Abdelrazak Younes wrote: Abdelrazak Younes wrote: Abdelrazak Younes wrote: Juergen Spitzmueller wrote: The attached patch implements a pref option to enable the pixmap cache on Windows and the Mac (it is now disabled by default). I cannot really test, since I'm on Linux. Could someone do this and check that it works? -bool const usePixmapCache = USE_PIXMAP_CACHE; +bool const usePixmapCache = (lyxrc.use_pixmap_cache && USE_PIXMAP_CACHE); This will require a restart to take the change into account. A static member in QLPainter that you change in the prefs dialog should do the trick. Here is an updated patch that does that (untested). Here is one that do compile. The static trick is not needed at the end. And I confirm that it works fine. Abdel.
Re: [patch] pixmap cache goes rc
Abdelrazak Younes wrote: Abdelrazak Younes wrote: Juergen Spitzmueller wrote: The attached patch implements a pref option to enable the pixmap cache on Windows and the Mac (it is now disabled by default). I cannot really test, since I'm on Linux. Could someone do this and check that it works? -bool const usePixmapCache = USE_PIXMAP_CACHE; +bool const usePixmapCache = (lyxrc.use_pixmap_cache && USE_PIXMAP_CACHE); This will require a restart to take the change into account. A static member in QLPainter that you change in the prefs dialog should do the trick. Here is an updated patch that does that (untested). Here is one that do compile. The static trick is not needed at the end. Abdel. Index: frontends/qt4/QLPainter.cpp === --- frontends/qt4/QLPainter.cpp (revision 21367) +++ frontends/qt4/QLPainter.cpp (working copy) @@ -23,6 +23,7 @@ #include "debug.h" #include "Language.h" #include "Color.h" +#include "LyXRC.h" #include "support/unicode.h" @@ -45,7 +46,6 @@ namespace { -bool const usePixmapCache = USE_PIXMAP_CACHE; QString generateStringSignature(QString const & str, Font const & f) { @@ -61,7 +61,8 @@ } // anon namespace QLPainter::QLPainter(QPaintDevice * device) - : QPainter(device), Painter() + : QPainter(device), Painter(), + use_pixmap_cache_(lyxrc.use_pixmap_cache && USE_PIXMAP_CACHE) { // new QPainter has default QPen: current_color_ = Color::black; @@ -306,7 +307,7 @@ return textwidth; } - if (!usePixmapCache) { + if (!use_pixmap_cache_) { // don't use the pixmap cache, // draw directly onto the painting device setQPainterPen(f.realColor()); Index: frontends/qt4/QLPainter.h === --- frontends/qt4/QLPainter.h (revision 21367) +++ frontends/qt4/QLPainter.h (working copy) @@ -111,6 +111,8 @@ Color::color current_color_; Painter::line_style current_ls_; Painter::line_width current_lw_; + /// + bool const use_pixmap_cache_; }; } // namespace frontend Index: frontends/qt4/QPrefs.cpp === --- frontends/qt4/QPrefs.cpp(revision 21367) +++ frontends/qt4/QPrefs.cpp(working copy) @@ -1813,6 +1813,8 @@ this, SIGNAL(changed())); connect(lastfilesSB, SIGNAL(valueChanged(int)), this, SIGNAL(changed())); + connect(pixmapCacheCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); lastfilesSB->setMaximum(maxlastfiles); } @@ -1835,6 +1837,7 @@ rc.autosave = autoSaveSB->value() * 60; rc.make_backup = autoSaveCB->isChecked(); rc.num_lastfiles = lastfilesSB->value(); + rc.use_pixmap_cache = pixmapCacheCB->isChecked(); } @@ -1859,6 +1862,10 @@ autoSaveSB->setValue(mins); autoSaveCB->setChecked(rc.make_backup); lastfilesSB->setValue(rc.num_lastfiles); + pixmapCacheCB->setChecked(rc.use_pixmap_cache); +#if (QT_VERSION < 0x040200) || defined(Q_WS_X11) + pixmapCacheGB->setEnabled(false); +#endif } Index: frontends/qt4/ui/PrefUi.ui === --- frontends/qt4/ui/PrefUi.ui (revision 21367) +++ frontends/qt4/ui/PrefUi.ui (working copy) @@ -5,14 +5,12 @@ 0 0 -459 -425 +464 +497 - -1 -1 + 0 0 @@ -21,70 +19,6 @@ - -9 - - -6 - - - - - Scrolling - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - 11 - - - 6 - - - - - Cursor follows &scrollbar - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - B&rowse... - - - @@ -95,6 +29,16 @@ + + + + + + + Bro&wse... + + + @@ -105,25 +49,20 @@ - - + + - - + + - Bro&wse... + B&rowse... - - - - - 5 - 5 + 0 0 @@ -132,12 +71,24 @@ Session - + 9 - + + 9 + + + 9 + + + 9 + + 6 + + 6 + @@ -190,12 +141,21 @@ - - 0 - 6
Re: [patch] pixmap cache goes rc
Abdelrazak Younes wrote: Juergen Spitzmueller wrote: The attached patch implements a pref option to enable the pixmap cache on Windows and the Mac (it is now disabled by default). I cannot really test, since I'm on Linux. Could someone do this and check that it works? -bool const usePixmapCache = USE_PIXMAP_CACHE; +bool const usePixmapCache = (lyxrc.use_pixmap_cache && USE_PIXMAP_CACHE); This will require a restart to take the change into account. A static member in QLPainter that you change in the prefs dialog should do the trick. Here is an updated patch that does that (untested). Abdel. Index: frontends/qt4/QLPainter.cpp === --- frontends/qt4/QLPainter.cpp (revision 21367) +++ frontends/qt4/QLPainter.cpp (working copy) @@ -23,6 +23,7 @@ #include "debug.h" #include "Language.h" #include "Color.h" +#include "LyXRC.h" #include "support/unicode.h" @@ -43,9 +44,10 @@ namespace lyx { namespace frontend { +QLPainter::use_pixmap_cache_ = USE_PIXMAP_CACHE; + namespace { -bool const usePixmapCache = USE_PIXMAP_CACHE; QString generateStringSignature(QString const & str, Font const & f) { @@ -63,6 +65,8 @@ QLPainter::QLPainter(QPaintDevice * device) : QPainter(device), Painter() { + use_pixmap_cache_ |= lyxrc.use_pixmap_cache; + // new QPainter has default QPen: current_color_ = Color::black; current_ls_ = line_solid; @@ -306,7 +310,7 @@ return textwidth; } - if (!usePixmapCache) { + if (!use_pixmap_cache_) { // don't use the pixmap cache, // draw directly onto the painting device setQPainterPen(f.realColor()); Index: frontends/qt4/QLPainter.h === --- frontends/qt4/QLPainter.h (revision 21367) +++ frontends/qt4/QLPainter.h (working copy) @@ -111,6 +111,8 @@ Color::color current_color_; Painter::line_style current_ls_; Painter::line_width current_lw_; + /// + static bool const use_pixmap_cache_; }; } // namespace frontend Index: frontends/qt4/QPrefs.cpp === --- frontends/qt4/QPrefs.cpp(revision 21367) +++ frontends/qt4/QPrefs.cpp(working copy) @@ -1813,6 +1813,8 @@ this, SIGNAL(changed())); connect(lastfilesSB, SIGNAL(valueChanged(int)), this, SIGNAL(changed())); + connect(pixmapCacheCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); lastfilesSB->setMaximum(maxlastfiles); } @@ -1835,6 +1837,7 @@ rc.autosave = autoSaveSB->value() * 60; rc.make_backup = autoSaveCB->isChecked(); rc.num_lastfiles = lastfilesSB->value(); + rc.use_pixmap_cache = pixmapCacheCB->isChecked(); } @@ -1859,6 +1862,10 @@ autoSaveSB->setValue(mins); autoSaveCB->setChecked(rc.make_backup); lastfilesSB->setValue(rc.num_lastfiles); + pixmapCacheCB->setChecked(rc.use_pixmap_cache); +#if (QT_VERSION < 0x040200) || defined(Q_WS_X11) + pixmapCacheGB->setEnabled(false); +#endif } Index: frontends/qt4/ui/PrefUi.ui === --- frontends/qt4/ui/PrefUi.ui (revision 21367) +++ frontends/qt4/ui/PrefUi.ui (working copy) @@ -5,14 +5,12 @@ 0 0 -459 -425 +464 +497 - -1 -1 + 0 0 @@ -21,70 +19,6 @@ - -9 - - -6 - - - - - Scrolling - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - 11 - - - 6 - - - - - Cursor follows &scrollbar - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - B&rowse... - - - @@ -95,6 +29,16 @@ + + + + + + + Bro&wse... + + + @@ -105,25 +49,20 @@ - - + + - - + + - Bro&wse... + B&rowse... - - - - - 5 - 5 + 0 0 @@ -132,12 +71,24 @@ Session - + 9 - + + 9 + + + 9 + + + 9 + + 6 + + 6 + @@ -190,12 +141,21 @@ - - 0 - 6 + + 0 + +
Re: [patch] pixmap cache goes rc
Abdelrazak Younes wrote: Juergen Spitzmueller wrote: It can be done easily, if needed. I think you should do it. Sorry, I mean you should implement the option in trunk first and then backport it to branch. Abdel.
Re: [patch] pixmap cache goes rc
Juergen Spitzmueller wrote: The attached patch implements a pref option to enable the pixmap cache on Windows and the Mac (it is now disabled by default). I cannot really test, since I'm on Linux. Could someone do this and check that it works? -bool const usePixmapCache = USE_PIXMAP_CACHE; +bool const usePixmapCache = (lyxrc.use_pixmap_cache && USE_PIXMAP_CACHE); This will require a restart to take the change into account. A static member in QLPainter that you change in the prefs dialog should do the trick. I do not plan to forwardport this to trunk ATM, since Abdel maybe has different plans. I think I've done enough metrics cleanup in trunk (and am a bit fad up with it). Someone else might do further cleanup to enable full Row or even full Paragraph pixmap caching. It can be done easily, if needed. I think you should do it. Abdel.
Re: trunk crashes after start
Juergen Spitzmueller wrote: Program received signal SIGSEGV, Segmentation fault. I see the crash in MSVC too. It happens when loading the Tutorial but not the introduction. The crash did not happen yesterday morning. Abdel. #3 0x085a12c3 in lyx::InsetCollapsable::dimensionCollapsed ( this=0x8ff29f0) at insets/InsetCollapsable.cpp:178 #4 0x085a3f19 in lyx::InsetCollapsable::draw (this=0x8ff29f0, [EMAIL PROTECTED], x=60, y=51) at insets/InsetCollapsable.cpp:259 #5 0x085b0d72 in lyx::InsetERT::draw (this=0x8ff29f0, [EMAIL PROTECTED], x=60, y=51) at insets/InsetERT.cpp:245 #6 0x0844fe2c in lyx::RowPainter::paintInset (this=0xbfbb2ffc, inset=0x8ff29f0, pos=0) at rowpainter.cpp:140 ---Type to continue, or q to quit--- #7 0x084522d2 in lyx::RowPainter::paintText (this=0xbfbb2ffc) at rowpainter.cpp:792 #8 0x0827abc9 in lyx::TextMetrics::drawParagraph ( this=0x8ff2b8c, [EMAIL PROTECTED], pit=0, x=0, y=51) at TextMetrics.cpp:2001 #9 0x0827b4cd in lyx::TextMetrics::draw (this=0x8ff2b8c, [EMAIL PROTECTED], x=0, y=51) at TextMetrics.cpp:1916 #10 0x0830a1e0 in lyx::BufferView::draw (this=0x8fe4fb8, [EMAIL PROTECTED]) at BufferView.cpp:2124 #11 0x088acac3 in lyx::frontend::GuiWorkArea::updateScreen ( this=0x8fe4538) at GuiWorkArea.cpp:503 #12 0x088acb48 in lyx::frontend::GuiWorkArea::expose ( this=0x8fe4538, x=0, y=0, w=666, h=334) at GuiWorkArea.cpp:494 #13 0x086bcd94 in lyx::frontend::WorkArea::redraw ( ---Type to continue, or q to quit--- this=0x8fe454c) at WorkArea.cpp:154 #14 0x086bd9e9 in lyx::frontend::WorkAreaManager::redrawAll ( this=0x8fbd500) at WorkAreaManager.cpp:42 #15 0x082bc8b3 in lyx::Buffer::changed (this=0x8f7e168) at Buffer.cpp:290 #16 0x0831043a in lyx::BufferView::processUpdateFlags ( this=0x8fe4fb8, flags=3) at BufferView.cpp:562 #17 0x08154218 in lyx::LyXFunc::dispatch (this=0x8d22ef0, [EMAIL PROTECTED]) at LyXFunc.cpp:2091 #18 0x081113e2 in lyx::dispatch ([EMAIL PROTECTED]) at LyX.cpp:1484 #19 0x086b9dfc in lyx::frontend::LyXView::dispatch ( this=0x8da98cc, [EMAIL PROTECTED]) at LyXView.cpp:296 #20 0x08917223 in lyx::frontend::Action::action (this=0x8e70078) at Action.cpp:70 ---Type to continue, or q to quit--- #21 0x08917298 in lyx::frontend::Action::qt_metacall ( this=0x8e70078, _c=QMetaObject::InvokeMetaMethod, _id=13, _a=0xbfbb5fec) at Action_moc.cpp:69 #22 0xb781b0c0 in QMetaObject::activate () from /usr/lib/libQtCore.so.4 #23 0xb781b3d0 in QMetaObject::activate () from /usr/lib/libQtCore.so.4 #24 0xb7a2cbd1 in QAction::triggered () from /usr/lib/libQtGui.so.4 #25 0xb7a2d70f in QAction::activate () from /usr/lib/libQtGui.so.4 #26 0xb7db05f2 in QToolButton::nextCheckState () from /usr/lib/libQtGui.so.4 #27 0xb7cf8c9f in QAbstractButtonPrivate::click () from /usr/lib/libQtGui.so.4 ---Type to continue, or q to quit--- #28 0xb7cf8efb in QAbstractButton::mouseReleaseEvent () from /usr/lib/libQtGui.so.4 #29 0xb7db06ec in QToolButton::mouseReleaseEvent () from /usr/lib/libQtGui.so.4 #30 0xb7a7784c in QWidget::event () from /usr/lib/libQtGui.so.4 #31 0xb7cf9adf in QAbstractButton::event () from /usr/lib/libQtGui.so.4 #32 0xb7db02c4 in QToolButton::event () from /usr/lib/libQtGui.so.4 #33 0xb7a32c1d in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4 #34 0xb7a3938d in QApplication::notify () from /usr/lib/libQtGui.so.4 #35 0x086cd242 in lyx::frontend::GuiApplication::notify ( this=0x8d26830, receiver=0x8e75920, event=0xbfbb64e4) ---Type to continue, or q to quit--- at GuiApplication.cpp:290 #36 0xb7809d5b in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4 #37 0xb7a89733 in QETWidget::translateMouseEvent () from /usr/lib/libQtGui.so.4 #38 0xb7a88d96 in QApplication::x11ProcessEvent () from /usr/lib/libQtGui.so.4 #39 0xb7aac17a in ?? () from /usr/lib/libQtGui.so.4 #40 0x08d26830 in ?? () #41 0xbfbb6948 in ?? () #42 0xbfbb68c8 in ?? () #43 0xb73fbff0 in _xcb_unlock_io () from /usr/lib/libxcb.so.1 #44 0xb767e446 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 #45 0xb76817e2 in ?? () from /usr/lib/libglib-2.0.so.0 ---Type to continue, or q to quit--- #46 0x08d2f0f8 in ?? () #47 0x in ?? ()
Re: docstring help needed
Hans Meine wrote: On Freitag 02 November 2007, Abdelrazak Younes wrote: @@ -77,10 +77,10 @@ OutputParams const & runparams) const { //FIXME: all strings in this routine should be docstrings - string url = to_utf8(getParam("target")); + docstring url = getParam("target"); What about the FIXME? I removed that after. Abdel.
Re: docstring help needed
On Freitag 02 November 2007, Abdelrazak Younes wrote: > @@ -77,10 +77,10 @@ > OutputParams const & runparams) const > { > //FIXME: all strings in this routine should be docstrings > - string url = to_utf8(getParam("target")); > + docstring url = getParam("target"); What about the FIXME? Greetings, hans signature.asc Description: This is a digitally signed message part.
Re: docstring help needed
Uwe Stöhr wrote: Enrico wrote today: > Now waiting for the next bug associated > to unsigned chars and docstreams. There's a potential problem in Hyperlink.cpp I'm not able to fix: http://www.lyx.org/trac/changeset/21352 Could anybody please help me here? I can't get it to work when I change to char_type, I get then countless compiler errors I don't understand. char_type is not really needed here because the characters in the list are ASCII and the list a const. But docstring wants char_type. That's because you used strings instead of characters. I've changed that and I corrected some missing whitespace at the same time. There are other things to clean up in there, it is not clear what the different 'for' loop are doing with the strings. At the moment the hyperlink stuff is stable, I can even use Vietnamese double-accent characters in the dialog and it works. But would like to have it correct and btw. learn how this is done. Here it is, nothing really complicated, you just have to know that mixing docstring with std::string is forbidden. Author: younes Date: Fri Nov 2 09:09:43 2007 New Revision: 21363 URL: http://www.lyx.org/trac/changeset/21363 Log: use docstring wherever it makes sense. Modified: lyx-devel/trunk/src/insets/InsetHyperlink.cpp Modified: lyx-devel/trunk/src/insets/InsetHyperlink.cpp URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetHyperlink.cpp?rev=21363 == --- lyx-devel/trunk/src/insets/InsetHyperlink.cpp (original) +++ lyx-devel/trunk/src/insets/InsetHyperlink.cpp Fri Nov 2 09:09:43 2007 @@ -33,10 +33,10 @@ using std::replace; //FIXME: these should be lists of char_type and not char -static char const * const chars_url[2] = {"%", "#"}; +static char_type const chars_url[2] = {'%', '#'}; -static char const * const chars_name[6] = { - "&", "_", "$", "%", "#", "^"}; +static char_type const chars_name[6] = { + '&', '_', '$', '%', '#', '^'}; InsetHyperlink::InsetHyperlink(InsetCommandParams const & p) @@ -77,10 +77,10 @@ OutputParams const & runparams) const { //FIXME: all strings in this routine should be docstrings - string url = to_utf8(getParam("target")); + docstring url = getParam("target"); - string backslash = "\\"; - string braces = "{}"; + docstring backslash = from_ascii("\\"); + docstring braces = from_ascii("{}"); // The characters in chars_url[] need to be changed to a command when // they are in the url field. @@ -90,12 +90,12 @@ for (size_t i = 0, pos; (pos = url.find(chars_url[k], i)) != string::npos; i = pos + 2) { - url.replace(pos,1,backslash + chars_url[k]); + url.replace(pos, 1, backslash + chars_url[k]); } } } // end if (!url.empty()) - string name = to_utf8(getParam("name")); + docstring name = getParam("name"); // The characters in chars_name[] need to be changed to a command when // they are in the name field. @@ -103,40 +103,42 @@ // handle the "\" character, but only when the following character // is not also a "\", because "\\" is valid code + docstring textbackslash = from_ascii("\\textbackslash{}"); for (size_t i = 0, pos; - (pos = name.find("\\", i)) != string::npos; + (pos = name.find('\\', i)) != string::npos; i = pos + 2) { - if (name[pos+1] != '\\') - name.replace(pos,1,"\\textbackslash{}"); + if (name[pos + 1] != '\\') + name.replace(pos, 1, textbackslash); } for (int k = 0; k < 6; k++) { for (size_t i = 0, pos; (pos = name.find(chars_name[k], i)) != string::npos; i = pos + 2) { - name.replace(pos,1,backslash + chars_name[k] + braces); + name.replace(pos, 1, backslash + chars_name[k] + braces); } } // replace the tilde by the \sim character as suggested in the LaTeX FAQ // for URLs + docstring sim = from_ascii("$\\sim$"); for (int i = 0, pos; - (pos = name.find("~", i)) != string::npos; + (pos = name.find('~', i)) != string::npos; i = pos + 1) - name.replace(pos,1,"$\\sim$"); + name.replace(pos, 1, sim); } // end if (!name.empty()) //for the case the