Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
ffff4745
Kaydet (Commit)
ffff4745
authored
Eki 14, 2013
tarafından
Lionel Elie Mamane
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
respect reference values in checkboxes
Change-Id: Ifd0953f779f530af6b190425794f009a891f0afb
üst
d9eac2ce
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
5 deletions
+37
-5
FValue.cxx
connectivity/source/commontools/FValue.cxx
+2
-0
dbtools.cxx
connectivity/source/commontools/dbtools.cxx
+1
-1
CheckBox.cxx
forms/source/component/CheckBox.cxx
+33
-4
CheckBox.hxx
forms/source/component/CheckBox.hxx
+1
-0
No files found.
connectivity/source/commontools/FValue.cxx
Dosyayı görüntüle @
ffff4745
...
...
@@ -26,6 +26,8 @@
#include <comphelper/extract.hxx>
#include <com/sun/star/io/XInputStream.hpp>
#include <rtl/ustrbuf.hxx>
#include <boost/type_traits.hpp>
#include <boost/static_assert.hpp>
using
namespace
::
dbtools
;
using
namespace
::
com
::
sun
::
star
::
sdbc
;
...
...
connectivity/source/commontools/dbtools.cxx
Dosyayı görüntüle @
ffff4745
...
...
@@ -1905,7 +1905,7 @@ void setObjectWithInfo(const Reference<XParameters>& _xParams,
break
;
case
DataType
:
:
BIT
:
case
DataType
:
:
BOOLEAN
:
_xParams
->
setBoolean
(
parameterIndex
,
_rValue
);
_xParams
->
setBoolean
(
parameterIndex
,
static_cast
<
bool
>
(
_rValue
)
);
break
;
case
DataType
:
:
TINYINT
:
if
(
_rValue
.
isSigned
()
)
...
...
forms/source/component/CheckBox.cxx
Dosyayı görüntüle @
ffff4745
...
...
@@ -203,6 +203,13 @@ void SAL_CALL OCheckBoxModel::read(const Reference<stario::XObjectInputStream>&
resetNoBroadcast
();
}
bool
OCheckBoxModel
::
DbUseBool
()
{
if
(
!
(
getReferenceValue
().
isEmpty
()
&&
getNoCheckReferenceValue
().
isEmpty
())
)
return
false
;
return
true
;
}
//------------------------------------------------------------------------------
Any
OCheckBoxModel
::
translateDbColumnToControlValue
()
{
...
...
@@ -210,7 +217,21 @@ Any OCheckBoxModel::translateDbColumnToControlValue()
//////////////////////////////////////////////////////////////////
// Set value in ControlModel
sal_Bool
bValue
=
m_xColumn
->
getBoolean
();
bool
bValue
;
if
(
DbUseBool
())
{
bValue
=
m_xColumn
->
getBoolean
();
}
else
{
const
OUString
sVal
(
m_xColumn
->
getString
());
if
(
sVal
==
getReferenceValue
())
bValue
=
true
;
else
if
(
sVal
==
getNoCheckReferenceValue
())
bValue
=
false
;
else
aValue
<<=
static_cast
<
sal_Int16
>
(
getDefaultChecked
());
}
if
(
m_xColumn
->
wasNull
()
)
{
sal_Bool
bTriState
=
sal_True
;
...
...
@@ -218,8 +239,10 @@ Any OCheckBoxModel::translateDbColumnToControlValue()
m_xAggregateSet
->
getPropertyValue
(
PROPERTY_TRISTATE
)
>>=
bTriState
;
aValue
<<=
(
sal_Int16
)(
bTriState
?
STATE_DONTKNOW
:
getDefaultChecked
()
);
}
else
else
if
(
!
aValue
.
hasValue
()
)
{
aValue
<<=
(
sal_Int16
)(
bValue
?
STATE_CHECK
:
STATE_NOCHECK
);
}
return
aValue
;
}
...
...
@@ -241,10 +264,16 @@ sal_Bool OCheckBoxModel::commitControlValueToDbColumn( bool /*_bPostReset*/ )
m_xColumnUpdate
->
updateNull
();
break
;
case
STATE_CHECK
:
m_xColumnUpdate
->
updateBoolean
(
sal_True
);
if
(
DbUseBool
())
m_xColumnUpdate
->
updateBoolean
(
sal_True
);
else
m_xColumnUpdate
->
updateString
(
getReferenceValue
()
);
break
;
case
STATE_NOCHECK
:
m_xColumnUpdate
->
updateBoolean
(
sal_False
);
if
(
DbUseBool
())
m_xColumnUpdate
->
updateBoolean
(
sal_False
);
else
m_xColumnUpdate
->
updateString
(
getNoCheckReferenceValue
()
);
break
;
default
:
OSL_FAIL
(
"OCheckBoxModel::commitControlValueToDbColumn: invalid value !"
);
...
...
forms/source/component/CheckBox.hxx
Dosyayı görüntüle @
ffff4745
...
...
@@ -33,6 +33,7 @@ class OCheckBoxModel :public OReferenceValueComponent
{
protected
:
sal_Int16
getState
(
const
::
com
::
sun
::
star
::
uno
::
Any
&
rValue
);
bool
DbUseBool
();
public
:
DECLARE_DEFAULT_LEAF_XTOR
(
OCheckBoxModel
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment