[koffice] koffice-2.3.3 kexi: Error while inserting row when field has "Not null" atribute (kde#256311)
Rex Dieter
rdieter at fedoraproject.org
Fri Mar 4 15:35:47 UTC 2011
commit a20852a77a4f34fef90c06676cba6e19ad049232
Author: Rex Dieter <rdieter at fedoraproject.org>
Date: Fri Mar 4 09:35:39 2011 -0600
koffice-2.3.3
kexi: Error while inserting row when field has "Not null" atribute (kde#256311)
.gitignore | 1 +
fix-inserting-required-value-2.3.patch | 47 ++++++++++++++++++++++++++++++++
koffice-2.3.2-kde262941_typo.patch | 12 --------
koffice.spec | 18 ++++++------
sources | 2 +-
5 files changed, 58 insertions(+), 22 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index d4a7f14..d78e329 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/koffice-2.3.2.tar.bz2
+/koffice-2.3.3.tar.bz2
diff --git a/fix-inserting-required-value-2.3.patch b/fix-inserting-required-value-2.3.patch
new file mode 100644
index 0000000..036fceb
--- /dev/null
+++ b/fix-inserting-required-value-2.3.patch
@@ -0,0 +1,47 @@
+diff --git a/kexi/widget/tableview/kexitableviewdata.cpp b/kexi/widget/tableview/kexitableviewdata.cpp
+index 845c0aa..9dc89d7 100644
+--- kexi/widget/tableview/kexitableviewdata.cpp
++++ kexi/widget/tableview/kexitableviewdata.cpp
+@@ -565,12 +565,12 @@ bool KexiTableViewData::updateRowEditBufferRef(KexiDB::RecordData *record,
+
+ //get a new value (if present in the buffer), or the old one, otherwise
+ //(taken here for optimization)
+-#define GET_VALUE if (!val) { \
+- val = d->cursor \
++#define GET_VALUE if (!pval) { \
++ pval = d->cursor \
+ ? d->pRowEditBuffer->at( *(*it_f)->columnInfo(), (*it_r).isNull() /* useDefaultValueIfPossible */ ) \
+ : d->pRowEditBuffer->at( *f ); \
+- if (!val) \
+- val = &(*it_r); /* get old value */ \
++ val = pval ? *pval : *it_r; /* get old value */ \
++ /*kDebug() << col << (*it_f)->columnInfo()->debugString() << "val:" << val;*/ \
+ }
+
+ //! @todo if there're multiple views for this data, we need multiple buffers!
+@@ -584,13 +584,14 @@ bool KexiTableViewData::saveRow(KexiDB::RecordData& record, bool insert, bool re
+ KexiTableViewColumn::ListIterator it_f(m_columns.constBegin());
+ KexiDB::RecordData::ConstIterator it_r = record.constBegin();
+ int col = 0;
+- const QVariant *val = 0;
++ const QVariant *pval = 0;
++ QVariant val;
+ for (;it_f != m_columns.constEnd() && it_r != record.constEnd();++it_f, ++it_r, col++) {
+ KexiDB::Field *f = (*it_f)->field();
+ if (f->isNotNull()) {
+ GET_VALUE;
+ //check it
+- if (val->isNull() && !f->isAutoIncrement()) {
++ if (val.isNull() && !f->isAutoIncrement()) {
+ //NOT NULL violated
+ d->result.msg = i18n("\"%1\" column requires a value to be entered.",
+ f->captionOrName()) + "\n\n" + Kexi::msgYouCanImproveData();
+@@ -601,7 +602,7 @@ bool KexiTableViewData::saveRow(KexiDB::RecordData& record, bool insert, bool re
+ }
+ if (f->isNotEmpty()) {
+ GET_VALUE;
+- if (!f->isAutoIncrement() && (val->isNull() || KexiDB::isEmptyValue(f, *val))) {
++ if (!f->isAutoIncrement() && (val.isNull() || KexiDB::isEmptyValue(f, val))) {
+ //NOT EMPTY violated
+ d->result.msg = i18n("\"%1\" column requires a value to be entered.",
+ f->captionOrName()) + "\n\n" + Kexi::msgYouCanImproveData();
diff --git a/koffice.spec b/koffice.spec
index 7642e7d..d6ba6c4 100644
--- a/koffice.spec
+++ b/koffice.spec
@@ -20,8 +20,8 @@
Name: koffice
Epoch: 3
-Version: 2.3.2
-Release: 3%{?dist}
+Version: 2.3.3
+Release: 1%{?dist}
Summary: An integrated office suite
Group: Applications/Productivity
@@ -34,15 +34,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
## upstreamable patches
Patch50: koffice-2.3.2-gcc46.patch
## upstream patches
-
# backport support for libwpg 0.2 from Calligra master:
# http://gitweb.kde.org/calligra.git/commit/9cda7aed2ea103750172e61f5c800a474913fa59
Patch100: koffice-2.3.1-libwpg02.patch
-
-# This commit breaks opening any document
-# http://websvn.kde.org/?view=revision&revision=1218114
-# fix the backport typo
-Patch101: koffice-2.3.2-kde262941_typo.patch
+# https://bugs.kde.org/show_bug.cgi?id=267311
+Patch101: http://kexi-project.org/download/patches/2.3/fix-inserting-required-value-2.3.patch
#-- The following OPTIONAL packages could NOT be located on your system.
#-- Consider installing them to enable more features from this software.
@@ -509,7 +505,7 @@ Requires: libxml2-devel
%setup -q
%patch50 -p1 -b .gcc46
%patch100 -p1 -b .libwpg02
-%patch101 -p1 -b .kde262941_typo
+%patch101 -p0 -b .kexi_fix_inserting_required_value
## kdchart munging begin
pushd plugins/chartshape/kdchart
@@ -1217,6 +1213,10 @@ fi
%changelog
+* Fri Mar 04 2011 Rex Dieter <rdieter at fedoraproject.org> 3:2.3.3-1
+- koffice-2.3.3
+- kexi: Error while inserting row when field has "Not null" atribute (kde#256311)
+
* Tue Feb 22 2011 Rex Dieter <rdieter at fedoraproject.org> 3:2.3.2-3
- krita-libs: fix Obsoletes for proper (multilib) upgrade
diff --git a/sources b/sources
index 0da2b0c..bff727c 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-e22b9839e1ca4d0e2ce98cd8a970edd3 koffice-2.3.2.tar.bz2
+1ebb955d54b6d6032999cc92e4b13bfe koffice-2.3.3.tar.bz2
More information about the scm-commits
mailing list