]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiExternal.cpp
Fix dangling inset pointers after buffer reload
[lyx.git] / src / frontends / qt4 / GuiExternal.cpp
index a7c84bef7a7350bc2d8db74afbff9a4aa8b3999d..e031f53eb1760fbbfc68e3ba8aa8bbc4fb0150d9 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "GuiExternal.h"
 
+#include "Buffer.h"
 #include "FuncRequest.h"
 #include "support/gettext.h"
 #include "Length.h"
@@ -220,6 +221,18 @@ GuiExternal::GuiExternal(GuiView & lv)
 
        // add scale item
        widthUnitCO->insertItem(0, qt_("Scale%"), "scale");
+
+       // remove all units from bb that depend on font or other dimensions
+       // we cannot use these, since we need to compare against absolute
+       // values from the image file.
+       xlUnitCO->noPercents();
+       xlUnitCO->removeFontDependent();
+       xrUnitCO->noPercents();
+       xrUnitCO->removeFontDependent();
+       ytUnitCO->noPercents();
+       ytUnitCO->removeFontDependent();
+       ybUnitCO->noPercents();
+       ybUnitCO->removeFontDependent();
 }
 
 
@@ -527,7 +540,7 @@ void GuiExternal::updateContents()
 void GuiExternal::updateTemplate()
 {
        external::Template templ = getTemplate(externalCO->currentIndex());
-       externalTB->setPlainText(qt_(templ.helpText));
+       externalTB->setPlainText(toqstr(translateIfPossible(templ.helpText)));
 
        // Ascertain which (if any) transformations the template supports
        // and disable tabs and Group Boxes hosting unsupported transforms.