]> git.lyx.org Git - lyx.git/blobdiff - src/factory.cpp
Kornel's gcc compile fix.
[lyx.git] / src / factory.cpp
index 641d96cfb6f4b992160d361619861ab63ab09dce..e03daaa1ad43ce4047779e89b84457e51950e7fd 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "insets/InsetBibitem.h"
 #include "insets/InsetBibtex.h"
+#include "insets/InsetBox.h"
+#include "insets/InsetBranch.h"
 #include "insets/InsetCaption.h"
 #include "insets/InsetCitation.h"
 #include "insets/InsetFlex.h"
 #include "insets/InsetFloatList.h"
 #include "insets/InsetFoot.h"
 #include "insets/InsetGraphics.h"
+#include "insets/InsetHyperlink.h"
 #include "insets/InsetInclude.h"
 #include "insets/InsetIndex.h"
 #include "insets/InsetInfo.h"
-#include "insets/InsetNomencl.h"
 #include "insets/InsetLabel.h"
 #include "insets/InsetLine.h"
 #include "insets/InsetMarginal.h"
 #include "insets/InsetNewline.h"
 #include "insets/InsetNewpage.h"
+#include "insets/InsetNomencl.h"
 #include "insets/InsetNote.h"
-#include "insets/InsetBox.h"
-#include "insets/InsetBranch.h"
-#include "insets/InsetPhantom.h"
 #include "insets/InsetOptArg.h"
-#include "insets/InsetNewpage.h"
+#include "insets/InsetPhantom.h"
 #include "insets/InsetRef.h"
 #include "insets/InsetSpace.h"
 #include "insets/InsetTabular.h"
 #include "insets/InsetTOC.h"
-#include "insets/InsetHyperlink.h"
 #include "insets/InsetVSpace.h"
 #include "insets/InsetWrap.h"
 
@@ -162,7 +161,7 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
                        string const argument = to_utf8(cmd.argument());
                        if (params.documentClass().floats().typeExist(argument)) {
                                auto_ptr<InsetFloat> p(new InsetFloat(buf, argument));
-                               p->setWide(true, params);
+                               p->setWide(true);
                                return p.release();
                        }
                        lyxerr << "Non-existent float type: " << argument << endl;
@@ -210,8 +209,11 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
                        return new InsetPrintIndex(icp);
                }
 
-               case LFUN_NOMENCL_PRINT:
-                       return new InsetPrintNomencl(InsetCommandParams(NOMENCL_PRINT_CODE));
+               case LFUN_NOMENCL_PRINT: {
+                       InsetCommandParams icp(NOMENCL_PRINT_CODE);
+                       icp["set_width"] = from_ascii("auto");
+                       return new InsetPrintNomencl(icp);
+               }
 
                case LFUN_TOC_INSERT:
                        return new InsetTOC(InsetCommandParams(TOC_CODE));
@@ -301,7 +303,7 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
                        
                        case NOMENCL_CODE: {
                                InsetCommandParams icp(code);
-                               InsetCommand::string2params(name, lyx::to_utf8(cmd.argument()), icp);
+                               InsetCommand::string2params(name, to_utf8(cmd.argument()), icp);
                                return new InsetNomencl(icp);
                        }
                        
@@ -385,22 +387,22 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
                        else if (name == "hrulefill")
                                isp.kind = InsetSpaceParams::HRULEFILL;
                        else if (name == "hspace") {
-                               if (len.empty() || !isValidLength(len)) {
+                               if (len.empty() || !isValidGlueLength(len)) {
                                        lyxerr << "LyX function 'space-insert hspace' "
                                               << "needs a valid length argument." << endl;
                                        break;
                                }
                                isp.kind = InsetSpaceParams::CUSTOM;
-                               isp.length = Length(len);
+                               isp.length = GlueLength(len);
                        }
                        else if (name == "hspace*") {
-                               if (len.empty() || !isValidLength(len)) {
+                               if (len.empty() || !isValidGlueLength(len)) {
                                        lyxerr << "LyX function 'space-insert hspace*' "
                                               << "needs a valid length argument." << endl;
                                        break;
                                }
                                isp.kind = InsetSpaceParams::CUSTOM_PROTECTED;
-                               isp.length = Length(len);
+                               isp.length = GlueLength(len);
                        }
                        else {
                                lyxerr << "Wrong argument for LyX function 'space-insert'." << endl;