-/* This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
- *
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-2001 The LyX Team.
+/**
+ * \file paragraph_funcs.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
// this is an idea for a more userfriendly layout handling, I will
// see what the users say
// this is an idea for a more userfriendly layout handling, I will
// see what the users say
// layout stays the same with latex-environments
if (flag) {
tmp->layout(par->layout());
tmp->setLabelWidthString(par->params().labelWidthString());
}
// layout stays the same with latex-environments
if (flag) {
tmp->layout(par->layout());
tmp->setLabelWidthString(par->params().labelWidthString());
}
if (!isempty && (par->size() > pos || par->empty() || flag == 2)) {
tmp->layout(par->layout());
tmp->params().align(par->params().align());
tmp->setLabelWidthString(par->params().labelWidthString());
if (!isempty && (par->size() > pos || par->empty() || flag == 2)) {
tmp->layout(par->layout());
tmp->params().align(par->params().align());
tmp->setLabelWidthString(par->params().labelWidthString());
tmp->params().lineBottom(par->params().lineBottom());
par->params().lineBottom(false);
tmp->params().pagebreakBottom(par->params().pagebreakBottom());
par->params().pagebreakBottom(false);
tmp->params().spaceBottom(par->params().spaceBottom());
par->params().spaceBottom(VSpace(VSpace::NONE));
tmp->params().lineBottom(par->params().lineBottom());
par->params().lineBottom(false);
tmp->params().pagebreakBottom(par->params().pagebreakBottom());
par->params().pagebreakBottom(false);
tmp->params().spaceBottom(par->params().spaceBottom());
par->params().spaceBottom(VSpace(VSpace::NONE));
+
+#ifdef WITH_WARNINGS
+#warning this seems wrong
+#endif
+ /* FIXME: if !keepempty, empty() == true, then we reach
+ * here with size() == 0. So pos_end becomes - 1. Why
+ * doesn't this cause problems ???
+ */
-
- // just an idea of me
- if (!pos) {
- tmp->params().lineTop(par->params().lineTop());
- tmp->params().pagebreakTop(par->params().pagebreakTop());
- tmp->params().spaceTop(par->params().spaceTop());
- tmp->bibkey = par->bibkey;
-
- par->bibkey = 0;
- par->params().clear();
-
- par->layout(bparams.getLyXTextClass().defaultLayout());
-
- // layout stays the same with latex-environments
- if (flag) {
- par->layout(tmp->layout());
- par->setLabelWidthString(tmp->params().labelWidthString());
- par->params().depth(tmp->params().depth());
- }
+
+ if (pos)
+ return;
+
+ tmp->params().lineTop(par->params().lineTop());
+ tmp->params().pagebreakTop(par->params().pagebreakTop());
+ tmp->params().spaceTop(par->params().spaceTop());
+ tmp->bibkey = par->bibkey;
+
+ par->bibkey = 0;
+ par->params().clear();
+
+ par->layout(bparams.getLyXTextClass().defaultLayout());
+
+ // layout stays the same with latex-environments
+ if (flag) {
+ par->layout(tmp->layout());
+ par->setLabelWidthString(tmp->params().labelWidthString());
+ par->params().depth(tmp->params().depth());
-#if 0
-// Be carefull, this does not make any check at all.
-// This method has wrong name, it combined this par with the next par.
-// In that sense it is the reverse of break paragraph. (Lgb)
-void pasteParagraph(BufferParams const & bparams,
- Paragraph * par)
+void mergeParagraph(BufferParams const & bparams, Paragraph * par)
Paragraph * depthHook(Paragraph * par, Paragraph::depth_type depth)
{
Paragraph * newpar = par;
Paragraph * depthHook(Paragraph * par, Paragraph::depth_type depth)
{
Paragraph * newpar = par;