]> git.lyx.org Git - lyx.git/commitdiff
Angus patch + small insetfloat->Write-bug fix.
authorJürgen Vigna <jug@sad.it>
Wed, 19 Jul 2000 08:37:26 +0000 (08:37 +0000)
committerJürgen Vigna <jug@sad.it>
Wed, 19 Jul 2000 08:37:26 +0000 (08:37 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@898 a592a061-630c-0410-9148-cb99ea01b6c8

13 files changed:
ChangeLog
src/frontends/Dialogs.h
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormCitation.h
src/frontends/xforms/form_citation.C
src/frontends/xforms/form_citation.h
src/frontends/xforms/forms/form_citation.fd
src/insets/insetcite.C
src/insets/insetcite.h
src/insets/insetfloat.C
src/insets/insettabular.C
src/insets/insettabular.h
src/lyx_cb.C

index ce40cad40074fe6ed38cbec0934b7d8f2bde779f..315d18d69b3f121e445e9fc7e30a62f5513c7fa4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2000-07-19  Juergen Vigna  <jug@sad.it>
+
+       * src/insets/insetfloat.C (Write): small fix because we use the
+       insetname for the type now!
+
+2000-07-18  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * src/frontends/xforms/forms/form_citation.fd: object sizes are
+       now set here
+
+       * src/frontends/Dialogs.h: removed hideCitation signal
+
+       * src/insets/insetcite.h: added hide signal
+
+       * src/insets/insetcite.C (~InsetCitation): emits new signal
+       (getScreenLabel): "intelligent" label should now fit on the screen!
+
+       * src/frontends/xforms/FormCitation.[Ch] (hideInset): removed
+
+       * src/frontends/xforms/FormCitation.C (showInset): connects
+       hide() to the inset's hide signal
+       (show): modified to use fl_set_object_position rather than
+       fl_set_object_geometry wherever possible
+       
 2000-07-18  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * src/insets/lyxinset.h: add caption code
index 5fe2a6b392dc6c9202731a2d171597afe05c13dc..07bd1b480ca78acc8c4629991694898ef4693d39 100644 (file)
@@ -113,8 +113,6 @@ public:
        ///
        Signal1<void, string const &> createCitation;
        ///
-       Signal1<void, InsetCitation *> hideCitation;
-       ///
        Signal1<void, InsetBibtex *> showBibtex;
        ///
        Signal1<void, InsetInfo *> showInfo;
index fac2d3b8c032db54bbd144f071d1899901c51f50..941d5b4d5d0ca5485fb5c140853c387f17415b95 100644 (file)
@@ -48,7 +48,6 @@ FormCitation::FormCitation(LyXView * lv, Dialogs * d)
        // storing a copy because we won't be disconnecting.
        d->showCitation.connect(slot(this, &FormCitation::showInset));
        d->createCitation.connect(slot(this, &FormCitation::createInset));
-       d->hideCitation.connect(slot(this, &FormCitation::hideInset));
 }
 
 
@@ -69,6 +68,7 @@ void FormCitation::showInset( InsetCitation * inset )
        if( dialogIsOpen || inset == 0 ) return;
 
        inset_ = inset;
+       ih_ = inset_->hide.connect(slot(this, &FormCitation::hide));
 
        textAfter = inset->getOptions();
        updateCitekeys(inset->getContents());
@@ -94,15 +94,6 @@ void FormCitation::createInset( string const & arg )
 }
 
 
-void FormCitation::hideInset(InsetCitation * ti)
-{
-       if (inset_ == ti) {
-               inset_ = 0;
-               hide();
-       }
-}
-
-
 void FormCitation::show()
 {
        if (!dialog_) {
@@ -277,13 +268,14 @@ void FormCitation::setSize( int brsrHeight, bool bibPresent ) const
        ypos += 30;
        fl_set_object_geometry( dialog_->citeBrsr, 10,  ypos, 180, brsrHeight );
        fl_set_object_geometry( dialog_->bibBrsr,  240, ypos, 180, brsrHeight );
-       fl_set_object_geometry( dialog_->addBtn,   200, ypos,  30, 30 );
+
+       fl_set_object_position( dialog_->addBtn,  200, ypos );
        ypos += 35;
-       fl_set_object_geometry( dialog_->delBtn,   200, ypos,  30, 30 );
+       fl_set_object_position( dialog_->delBtn,  200, ypos );
        ypos += 35;
-       fl_set_object_geometry( dialog_->upBtn,    200, ypos,  30, 30 );
+       fl_set_object_position( dialog_->upBtn,   200, ypos );
        ypos += 35;
-       fl_set_object_geometry( dialog_->downBtn,  200, ypos,  30, 30 );
+       fl_set_object_position( dialog_->downBtn, 200, ypos );
 
        ypos = brsrHeight+30; // base of Citation/Bibliography browsers
 
@@ -292,7 +284,7 @@ void FormCitation::setSize( int brsrHeight, bool bibPresent ) const
 
        if( bibPresent ) {
                ypos += 30;
-               fl_set_object_geometry( dialog_->infoBrsr, 10, ypos, 410, infoHeight );
+               fl_set_object_position( dialog_->infoBrsr, 10, ypos );
                fl_show_object( dialog_->infoBrsr );
                ypos += infoHeight;
        }
@@ -303,10 +295,9 @@ void FormCitation::setSize( int brsrHeight, bool bibPresent ) const
        // awaiting natbib support
        fl_hide_object( dialog_->textBefore );
 
-       fl_set_object_position(dialog_->textAftr, 100, ypos);
-//     fl_set_object_geometry( dialog_->textAftr, 100, ypos,   250, 30 );
-       fl_set_object_geometry( dialog_->ok,       230, ypos+50, 90, 30 );
-       fl_set_object_geometry( dialog_->cancel,   330, ypos+50, 90, 30 );
+       fl_set_object_position( dialog_->textAftr, 100, ypos );
+       fl_set_object_position( dialog_->ok,       230, ypos+50 );
+       fl_set_object_position( dialog_->cancel,   330, ypos+50 );
 }
 
 
@@ -490,6 +481,7 @@ void FormCitation::hide()
 
        // free up the dialog for another inset
        inset_ = 0;
+       ih_.disconnect();
        dialogIsOpen = false;
 }
 
index 57ea8a85c55ba6e7dfbb15389e35e70750c51055..f230d20febcdc7244561b7b6e0c61c672865d200 100644 (file)
@@ -64,8 +64,6 @@ private:
        /// 
        void showInset( InsetCitation * );
        /// 
-       void hideInset( InsetCitation * );
-       /// 
        void show();
        /// Hide the dialog.
        void hide();
@@ -114,6 +112,8 @@ private:
        Connection u_;
        /// Hide connection.
        Connection h_;
+       /// inset::hide connection.
+       Connection ih_;
        ///
        InsetCitation * inset_;
        ///
index 84c5ecc17bbeb44485f74b763b801a710982a1fe..691317faa2602ea6ddc947bf9375dcf89239eea5 100644 (file)
@@ -17,29 +17,29 @@ FD_form_citation * FormCitation::build_citation()
 
   fdui->form_citation = fl_bgn_form(FL_NO_BOX, 450, 780);
   fdui->form_citation->u_vdata = this;
-  fdui->box = obj = fl_add_box(FL_UP_BOX, 0, 0, 450, 780, "");
+  fdui->box = obj = fl_add_box(FL_UP_BOX, 0, 0, 430, 780, "");
     fl_set_object_resize(obj, FL_RESIZE_X);
-  fdui->citeBrsr = obj = fl_add_browser(FL_HOLD_BROWSER, 20, 40, 170, 370, _("Inset keys"));
+  fdui->citeBrsr = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 30, 180, 370, _("Inset keys"));
     fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
     fl_set_object_resize(obj, FL_RESIZE_X);
     fl_set_object_callback(obj, C_FormCitationInputCB, CITEBRSR);
-  fdui->bibBrsr = obj = fl_add_browser(FL_HOLD_BROWSER, 250, 40, 170, 370, _("Bibliography keys"));
+  fdui->bibBrsr = obj = fl_add_browser(FL_HOLD_BROWSER, 240, 30, 180, 370, _("Bibliography keys"));
     fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
     fl_set_object_resize(obj, FL_RESIZE_X);
     fl_set_object_callback(obj, C_FormCitationInputCB, BIBBRSR);
-  fdui->addBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 40, 40, 40, _("@4->"));
+  fdui->addBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 30, 30, 30, _("@4->"));
     fl_set_object_resize(obj, FL_RESIZE_NONE);
     fl_set_object_callback(obj, C_FormCitationInputCB, ADD);
-  fdui->delBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 90, 40, 40, _("@9+"));
+  fdui->delBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 65, 30, 30, _("@9+"));
     fl_set_object_resize(obj, FL_RESIZE_NONE);
     fl_set_object_callback(obj, C_FormCitationInputCB, DELETE);
-  fdui->upBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 140, 40, 40, _("@8->"));
+  fdui->upBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 100, 30, 30, _("@8->"));
     fl_set_object_resize(obj, FL_RESIZE_NONE);
     fl_set_object_callback(obj, C_FormCitationInputCB, UP);
-  fdui->downBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 190, 40, 40, _("@2->"));
+  fdui->downBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 135, 30, 30, _("@2->"));
     fl_set_object_resize(obj, FL_RESIZE_NONE);
     fl_set_object_callback(obj, C_FormCitationInputCB, DOWN);
-  fdui->infoBrsr = obj = fl_add_browser(FL_NORMAL_BROWSER, 20, 440, 400, 110, _("Info"));
+  fdui->infoBrsr = obj = fl_add_browser(FL_NORMAL_BROWSER, 10, 440, 430, 110, _("Info"));
     fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
     fl_set_object_resize(obj, FL_RESIZE_X);
   fdui->style = obj = fl_add_choice(FL_NORMAL_CHOICE, 160, 570, 130, 30, _("Citation style"));
@@ -49,10 +49,10 @@ FD_form_citation * FormCitation::build_citation()
     fl_set_object_resize(obj, FL_RESIZE_X);
   fdui->textAftr = obj = fl_add_input(FL_NORMAL_INPUT, 100, 660, 250, 30, _("Text after"));
     fl_set_object_resize(obj, FL_RESIZE_X);
-  fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON, 190, 730, 110, 40, _("OK"));
+  fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON, 230, 730, 90, 30, _("OK"));
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
     fl_set_object_callback(obj, C_FormCitationOKCB, 0);
-  fdui->cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 310, 730, 110, 40, _("Cancel"));
+  fdui->cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 330, 730, 90, 30, _("Cancel"));
     fl_set_button_shortcut(obj, _("^["), 1);
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
     fl_set_object_callback(obj, C_FormCitationCancelCB, 0);
index 3176997c668ee40c51ef130e1e73a313253ff92a..3c0138433037ca74b2bb194d55e9dd290d97683b 100644 (file)
@@ -1,4 +1,4 @@
-/** Header file generated with fdesign on Fri Jul 14 09:35:06 2000.**/
+/** Header file generated with fdesign on Wed Jul 19 09:20:42 2000.**/
 
 #ifndef FD_form_citation_h_
 #define FD_form_citation_h_
index 9da651b4e4e26992094886ecfcc00ac5c081ce17..04abb62c328152d8559537c4585a72357ae2ff8b 100644 (file)
@@ -15,7 +15,7 @@ Number of Objects: 13
 --------------------
 class: FL_BOX
 type: UP_BOX
-box: 0 0 450 780
+box: 0 0 430 780
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -33,7 +33,7 @@ argument:
 --------------------
 class: FL_BROWSER
 type: HOLD_BROWSER
-box: 20 40 170 370
+box: 10 30 180 370
 boxtype: FL_DOWN_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_TOP_LEFT
@@ -51,7 +51,7 @@ argument: CITEBRSR
 --------------------
 class: FL_BROWSER
 type: HOLD_BROWSER
-box: 250 40 170 370
+box: 240 30 180 370
 boxtype: FL_DOWN_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_TOP_LEFT
@@ -69,7 +69,7 @@ argument: BIBBRSR
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 200 40 40 40
+box: 200 30 30 30
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -87,7 +87,7 @@ argument: ADD
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 200 90 40 40
+box: 200 65 30 30
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -105,7 +105,7 @@ argument: DELETE
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 200 140 40 40
+box: 200 100 30 30
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -123,7 +123,7 @@ argument: UP
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 200 190 40 40
+box: 200 135 30 30
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -141,7 +141,7 @@ argument: DOWN
 --------------------
 class: FL_BROWSER
 type: NORMAL_BROWSER
-box: 20 440 400 110
+box: 10 440 430 110
 boxtype: FL_DOWN_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_TOP_LEFT
@@ -213,7 +213,7 @@ argument:
 --------------------
 class: FL_BUTTON
 type: RETURN_BUTTON
-box: 190 730 110 40
+box: 230 730 90 30
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -231,7 +231,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 310 730 110 40
+box: 330 730 90 30
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
index 3c31e29335087b4a528b174feea690231d07e7f5..9433e9764c7f342fe0f58ff22b711c3d6ab07b19 100644 (file)
 #include "LyXView.h"
 #include "BufferView.h"
 #include "frontends/Dialogs.h"
-
+#include "support/lstrings.h"
 
 InsetCitation::InsetCitation(string const & key, string const & note)
-               : InsetCommand("cite", key, note), dialogs_(0)
+               : InsetCommand("cite", key, note)
 {}
 
-
 InsetCitation::~InsetCitation()
 {
-       if( dialogs_ != 0 )
-               dialogs_->hideCitation( this );
+       hide();
 }
 
 string InsetCitation::getScreenLabel() const
 {
-       string temp("[");
-       temp += getContents();
+       string keys(getContents());
+
+       // If keys is "too long" then only print out the first few tokens
+       string label;
+       if( contains( keys, "," ) ) {
+               // Final comma allows while loop to cover all keys
+               keys = frontStrip( split( keys, label, ',' ) ) + ",";
 
-       if( !getOptions().empty() ) {
-               temp += ", " + getOptions();
+               const int maxSize( 40 );
+               while( contains( keys, "," ) ) {
+                       string key;
+                       keys = frontStrip( split( keys, key, ',' ) );
+
+                       int size = label.size() + 2 + key.size();
+                       if( size >= maxSize ) {
+                               label += ", ...";
+                               break;
+                       }
+                       label += ", " + key;
+               }
+       } else {
+               label = keys;
        }
 
-       return temp + ']';
+       if( !getOptions().empty() )
+               label += ", " + getOptions();
+
+       return '[' + label + ']';
 }
 
 void InsetCitation::Edit(BufferView * bv, int, int, unsigned int)
 {
-       dialogs_ = bv->owner()->getDialogs();
-       dialogs_->showCitation( this );
+       bv->owner()->getDialogs()->showCitation( this );
 }
 
index e3faef157923865d620dd0620d16e6699574e9f9..1c87a452f6c70042960944fd9136e5aebd2788f3 100644 (file)
@@ -16,6 +16,8 @@
 #endif
 
 #include "insetcommand.h"
+#include <sigc++/signal_system.h>
+
 class Dialogs;
 
 /** Used to insert citations  
@@ -37,11 +39,8 @@ public:
        EDITABLE Editable() const { return IS_EDITABLE; }
         ///
        void Edit(BufferView *, int, int, unsigned int);
-private:
-       ///
-       //InsetCitation() : InsetCommand("cite"), dialogs_(0) {}
        ///
-       Dialogs * dialogs_;
+       SigC::Signal0<void> hide;
 };
 
 #endif // INSET_CITE_H
index 827e73ad2f75651414f02ad2ebc3d157ade5475f..dd482beefd9112440382899cf2f61edc37721577 100644 (file)
@@ -90,7 +90,7 @@ InsetFloat::InsetFloat(string const & type)
        font.setColor(LColor::footnote);
        setLabelFont(font);
        setAutoCollapse(false);
-       setInsetName("Float");
+//     setInsetName("Float");
        floatType = type;
        setInsetName(type.c_str());
        //floatPlacement = "H";
@@ -99,8 +99,8 @@ InsetFloat::InsetFloat(string const & type)
 
 void InsetFloat::Write(Buffer const * buf, ostream & os) const
 {
-       os << getInsetName()
-          << " " << floatType << '\n';
+       os << "Float " // getInsetName()
+          << floatType << '\n';
 
        if (floatPlacement.empty()) {
                os << "placement "
index 3a582d63ff40918d8407436f5f297a9df3b519ce..9916a5fa5c34e76090b2f9f3bfdb32ea17d35a30 100644 (file)
@@ -1425,3 +1425,10 @@ void InsetTabular::resizeLyXText(BufferView *) const
 {
     need_update = FULL;
 }
+
+LyXText * InsetTabular::getLyXText(BufferView * bv) const
+{
+    if (the_locking_inset)
+       return the_locking_inset->getLyXText(bv);
+    return Inset::getLyXText(bv);
+}
index ab4cbb06ccb7c6027c317381c3e7af09445e5304..334e62d6e0e8698eb0ef3105992d080e5af4b3c1 100644 (file)
@@ -158,6 +158,7 @@ public:
     ///
     Buffer * BufferOwner() const { return buffer; }
     ///
+    LyXText * getLyXText(BufferView *) const;
     void resizeLyXText(BufferView *) const;
 
     ///
index 013b8b02da7323946b9031715ef54d789f30beac..b787833a86e07eb43e2d0ee31a1e53bcb693a9eb 100644 (file)
@@ -1404,18 +1404,23 @@ bool UpdateLayoutParagraph()
        }
 
        Buffer * buf = current_view->buffer();
+       LyXText * text = 0;
+       if (current_view->the_locking_inset)
+           text = current_view->the_locking_inset->getLyXText(current_view);
+       if (!text)
+           text = current_view->text;
 
        fl_set_input(fd_form_paragraph->input_labelwidth,
-                    current_view->text->cursor.par()->GetLabelWidthString().c_str());
+                    text->cursor.par()->GetLabelWidthString().c_str());
        fl_set_button(fd_form_paragraph->radio_align_right, 0);
        fl_set_button(fd_form_paragraph->radio_align_left, 0);
        fl_set_button(fd_form_paragraph->radio_align_center, 0);
        fl_set_button(fd_form_paragraph->radio_align_block, 0);
 
-       int align = current_view->text->cursor.par()->GetAlign();
+       int align = text->cursor.par()->GetAlign();
        if (align == LYX_ALIGN_LAYOUT)
                align = textclasslist.Style(buf->params.textclass,
-                                           current_view->text->cursor.par()->GetLayout()).align;
+                                           text->cursor.par()->GetLayout()).align;
         
        switch (align) {
        case LYX_ALIGN_RIGHT:
@@ -1433,18 +1438,18 @@ bool UpdateLayoutParagraph()
        }
         
        fl_set_button(fd_form_paragraph->check_lines_top,
-                     current_view->text->cursor.par()->FirstPhysicalPar()->line_top);
+                     text->cursor.par()->FirstPhysicalPar()->line_top);
        fl_set_button(fd_form_paragraph->check_lines_bottom,
-                     current_view->text->cursor.par()->FirstPhysicalPar()->line_bottom);
+                     text->cursor.par()->FirstPhysicalPar()->line_bottom);
        fl_set_button(fd_form_paragraph->check_pagebreaks_top,
-                     current_view->text->cursor.par()->FirstPhysicalPar()->pagebreak_top);
+                     text->cursor.par()->FirstPhysicalPar()->pagebreak_top);
        fl_set_button(fd_form_paragraph->check_pagebreaks_bottom,
-                     current_view->text->cursor.par()->FirstPhysicalPar()->pagebreak_bottom);
+                     text->cursor.par()->FirstPhysicalPar()->pagebreak_bottom);
        fl_set_button(fd_form_paragraph->check_noindent,
-                     current_view->text->cursor.par()->FirstPhysicalPar()->noindent);
+                     text->cursor.par()->FirstPhysicalPar()->noindent);
        fl_set_input (fd_form_paragraph->input_space_above, "");
        
-       switch (current_view->text->cursor.par()->FirstPhysicalPar()->added_space_top.kind()) {
+       switch (text->cursor.par()->FirstPhysicalPar()->added_space_top.kind()) {
        case VSpace::NONE:
                fl_set_choice (fd_form_paragraph->choice_space_above, 1);
                break;
@@ -1466,13 +1471,13 @@ bool UpdateLayoutParagraph()
        case VSpace::LENGTH:
                fl_set_choice (fd_form_paragraph->choice_space_above, 7); 
                fl_set_input  (fd_form_paragraph->input_space_above, 
-                              current_view->text->cursor.par()->FirstPhysicalPar()->added_space_top.length().asString().c_str());
+                              text->cursor.par()->FirstPhysicalPar()->added_space_top.length().asString().c_str());
                break;
        }
        fl_set_button (fd_form_paragraph->check_space_above,
-                      current_view->text->cursor.par()->FirstPhysicalPar()->added_space_top.keep());
+                      text->cursor.par()->FirstPhysicalPar()->added_space_top.keep());
        fl_set_input (fd_form_paragraph->input_space_below, "");
-       switch (current_view->text->cursor.par()->FirstPhysicalPar()->added_space_bottom.kind()) {
+       switch (text->cursor.par()->FirstPhysicalPar()->added_space_bottom.kind()) {
        case VSpace::NONE:
                fl_set_choice (fd_form_paragraph->choice_space_below,
                               1);
@@ -1501,14 +1506,14 @@ bool UpdateLayoutParagraph()
                fl_set_choice (fd_form_paragraph->choice_space_below,
                               7); 
                fl_set_input  (fd_form_paragraph->input_space_below, 
-                              current_view->text->cursor.par()->FirstPhysicalPar()->added_space_bottom.length().asString().c_str());
+                              text->cursor.par()->FirstPhysicalPar()->added_space_bottom.length().asString().c_str());
                break;
        }
        fl_set_button (fd_form_paragraph->check_space_below,
-                      current_view->text->cursor.par()->FirstPhysicalPar()->added_space_bottom.keep());
+                      text->cursor.par()->FirstPhysicalPar()->added_space_bottom.keep());
 
        fl_set_button(fd_form_paragraph->check_noindent,
-                     current_view->text->cursor.par()->FirstPhysicalPar()->noindent);
+                     text->cursor.par()->FirstPhysicalPar()->noindent);
 
        if (current_view->buffer()->isReadonly()) {
                DisableParagraphLayout();
@@ -2130,16 +2135,21 @@ extern "C" void ParagraphApplyCB(FL_OBJECT *, long)
        labelwidthstring = fl_get_input(fd_form_paragraph->input_labelwidth);
        noindent = fl_get_button(fd_form_paragraph->check_noindent);
 
-       current_view->text->SetParagraph(current_view,
-                                        line_top,
-                                        line_bottom,
-                                        pagebreak_top,
-                                        pagebreak_bottom,
-                                        space_top,
-                                        space_bottom,
-                                        align, 
-                                        labelwidthstring,
-                                        noindent);
+       LyXText * text = 0;
+       if (current_view->the_locking_inset)
+           text = current_view->the_locking_inset->getLyXText(current_view);
+       if (!text)
+           text = current_view->text;
+       text->SetParagraph(current_view,
+                          line_top,
+                          line_bottom,
+                          pagebreak_top,
+                          pagebreak_bottom,
+                          space_top,
+                          space_bottom,
+                          align, 
+                          labelwidthstring,
+                          noindent);
        current_view->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
        current_view->owner()->getMiniBuffer()->Set(_("Paragraph layout set"));
 }