r19442 by jghali - #12624: "Get Field Names" (JavaScript) crashes Scribus if there is none
scribus-commit
scribus-commit at lists.scribus.net
Wed Aug 20 23:27:24 UTC 2014
Author: jghali
Date: Wed Aug 20 23:27:24 2014
New Revision: 19442
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19442
Log:
#12624: "Get Field Names" (JavaScript) crashes Scribus if there is none
Modified:
trunk/Scribus/scribus/ui/editor.cpp
trunk/Scribus/scribus/ui/editor.h
trunk/Scribus/scribus/ui/selfield.cpp
Modified: trunk/Scribus/scribus/ui/editor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19442&path=/trunk/Scribus/scribus/ui/editor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/editor.cpp (original)
+++ trunk/Scribus/scribus/ui/editor.cpp Wed Aug 20 23:27:24 2014
@@ -65,7 +65,7 @@
clearAct = new QAction(QIcon(loadIcon("16/edit-delete.png")), tr("C&lear"), this);
connect(clearAct, SIGNAL(triggered()), this, SLOT(del()));
getFieldAct = new QAction( tr("&Get Field Names"), this);
- connect(getFieldAct, SIGNAL(triggered()), this, SLOT(GetFieldN()));
+ connect(getFieldAct, SIGNAL(triggered()), this, SLOT(GetFieldNames()));
fmenu = new QMenu( tr("&File"));
fmenu->addAction(newAct);
fmenu->addAction(openAct);
@@ -116,7 +116,7 @@
EditTex->setTextCursor(curs);
}
-void Editor::GetFieldN()
+void Editor::GetFieldNames()
{
if (view != 0)
{
Modified: trunk/Scribus/scribus/ui/editor.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19442&path=/trunk/Scribus/scribus/ui/editor.h
==============================================================================
--- trunk/Scribus/scribus/ui/editor.h (original)
+++ trunk/Scribus/scribus/ui/editor.h Wed Aug 20 23:27:24 2014
@@ -56,7 +56,7 @@
void del();
void OpenScript();
void SaveAs();
- void GetFieldN();
+ void GetFieldNames();
protected:
QVBoxLayout* EditorLayout;
Modified: trunk/Scribus/scribus/ui/selfield.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19442&path=/trunk/Scribus/scribus/ui/selfield.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/selfield.cpp (original)
+++ trunk/Scribus/scribus/ui/selfield.cpp Wed Aug 20 23:27:24 2014
@@ -127,7 +127,7 @@
void SelectFields::SetRetVal()
{
- S_Fields = "";
+ S_Fields = QString();
if (FTyp > 1)
{
if (SelFields->count() > 0)
@@ -135,8 +135,16 @@
for (int r = 1; r < SelFields->count(); ++r)
S_Fields += ", "+SelFields->item(r)->text();
}
- else
+ else if (AvailFields->currentItem())
+ {
S_Fields = AvailFields->currentItem()->text();
+ }
+
+ if (S_Fields.isEmpty())
+ {
+ reject();
+ return;
+ }
accept();
}
More information about the scribus-commit
mailing list