git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4062 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2002-04-24 21:45:29 +00:00
parent 4f5eb5566b
commit 7bfe746bab
2 changed files with 12 additions and 12 deletions

View File

@ -1,3 +1,9 @@
2002-04-24 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* CutAndPaste.C (SwitchLayoutsBetweenClasses): when converting a
non-existing layout, do not complain if it was the default layout
of the original class (bug #342)
2002-04-24 Juergen Vigna <jug@sad.it>
* BufferView_pimpl.C (workAreaButtonPress): fix handling of mouse-wheel

View File

@ -408,24 +408,18 @@ int CutAndPaste::SwitchLayoutsBetweenClasses(textclass_type c1,
if (!par || c1 == c2)
return ret;
LyXTextClass const & tclass1 = textclasslist[c1];
LyXTextClass const & tclass2 = textclasslist[c2];
ParIterator end = ParIterator();
for (ParIterator it = ParIterator(par); it != end; ++it) {
par = *it;
string const name = par->layout();
LyXTextClass const & tclass = textclasslist[c2];
bool hasLayout = tclass2.hasLayout(name);
bool hasLayout = tclass.hasLayout(name);
if (!hasLayout)
par->layout(tclass2.defaultLayoutName());
string lay = tclass.defaultLayoutName();
if (hasLayout) {
lay = name;
} else {
// not found: use default layout
lay = tclass.defaultLayoutName();
}
par->layout(lay);
if (name != par->layout()) {
if (!hasLayout && name != tclass1.defaultLayoutName()) {
++ret;
string const s = _("Layout had to be changed from\n")
+ name + _(" to ")