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
92656d5d
Kaydet (Commit)
92656d5d
authored
Agu 30, 2012
tarafından
Lionel Elie Mamane
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make impl_doActionInSQLContext_throw more typesafe
Change-Id: I19be63f1cfa57386dd661ab8f98dc21b5ff8d22c
üst
3655f254
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
49 deletions
+42
-49
formoperations.cxx
forms/source/runtime/formoperations.cxx
+7
-32
formoperations.hxx
forms/source/runtime/formoperations.hxx
+35
-17
No files found.
forms/source/runtime/formoperations.cxx
Dosyayı görüntüle @
92656d5d
...
@@ -46,7 +46,6 @@
...
@@ -46,7 +46,6 @@
#include <com/sun/star/form/XConfirmDeleteListener.hpp>
#include <com/sun/star/form/XConfirmDeleteListener.hpp>
#include <com/sun/star/sdb/RowChangeEvent.hpp>
#include <com/sun/star/sdb/RowChangeEvent.hpp>
#include <com/sun/star/sdb/RowChangeAction.hpp>
#include <com/sun/star/sdb/RowChangeAction.hpp>
#include <com/sun/star/sdb/SQLFilterOperator.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/form/XReset.hpp>
#include <com/sun/star/form/XReset.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
...
@@ -1497,14 +1496,8 @@ namespace frm
...
@@ -1497,14 +1496,8 @@ namespace frm
// automatic sort by field is expected to always resets the previous sort order
// automatic sort by field is expected to always resets the previous sort order
m_xParser
->
setOrder
(
::
rtl
::
OUString
()
);
m_xParser
->
setOrder
(
::
rtl
::
OUString
()
);
param_appendOrderByColumn
aParam
;
impl_appendOrderByColumn_throw
aAction
(
this
,
xBoundField
,
_bUp
);
aParam
.
xField
=
xBoundField
;
impl_doActionInSQLContext_throw
(
aAction
,
RID_STR_COULD_NOT_SET_ORDER
);
aParam
.
bUp
=
_bUp
;
impl_doActionInSQLContext_throw
(
(
Action
)
&
FormOperations
::
impl_appendOrderByColumn_throw
,
static_cast
<
const
void
*
>
(
&
aParam
),
(
sal_uInt16
)
RID_STR_COULD_NOT_SET_ORDER
);
WaitObject
aWO
(
NULL
);
WaitObject
aWO
(
NULL
);
try
try
...
@@ -1569,13 +1562,8 @@ namespace frm
...
@@ -1569,13 +1562,8 @@ namespace frm
if
(
!
bApplied
)
if
(
!
bApplied
)
m_xParser
->
setFilter
(
::
rtl
::
OUString
()
);
m_xParser
->
setFilter
(
::
rtl
::
OUString
()
);
param_appendFilterByColumn
aParam
;
impl_appendFilterByColumn_throw
aAction
(
this
,
xBoundField
);
aParam
.
xField
=
xBoundField
;
impl_doActionInSQLContext_throw
(
aAction
,
RID_STR_COULD_NOT_SET_FILTER
);
impl_doActionInSQLContext_throw
(
(
Action
)
&
FormOperations
::
impl_appendFilterByColumn_throw
,
static_cast
<
const
void
*
>
(
&
aParam
),
(
sal_uInt16
)
RID_STR_COULD_NOT_SET_FILTER
);
WaitObject
aWO
(
NULL
);
WaitObject
aWO
(
NULL
);
try
try
...
@@ -1675,25 +1663,12 @@ namespace frm
...
@@ -1675,25 +1663,12 @@ namespace frm
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
FormOperations
::
impl_appendOrderByColumn_throw
(
const
void
*
_pActionParam
)
const
template
<
typename
FunctObj
>
{
void
FormOperations
::
impl_doActionInSQLContext_throw
(
FunctObj
Action
,
sal_uInt16
_nErrorResourceId
)
const
const
param_appendOrderByColumn
*
pParam
=
static_cast
<
const
param_appendOrderByColumn
*
>
(
_pActionParam
);
m_xParser
->
appendOrderByColumn
(
pParam
->
xField
,
pParam
->
bUp
);
}
//------------------------------------------------------------------------------
void
FormOperations
::
impl_appendFilterByColumn_throw
(
const
void
*
_pActionParam
)
const
{
const
param_appendFilterByColumn
*
pParam
=
static_cast
<
const
param_appendFilterByColumn
*
>
(
_pActionParam
);
m_xParser
->
appendFilterByColumn
(
pParam
->
xField
,
sal_True
,
SQLFilterOperator
::
EQUAL
);
}
//------------------------------------------------------------------------------
void
FormOperations
::
impl_doActionInSQLContext_throw
(
Action
_pAction
,
const
void
*
_pParam
,
sal_uInt16
_nErrorResourceId
)
const
{
{
try
try
{
{
(
this
->*
_pAction
)(
_pParam
);
Action
(
);
}
}
catch
(
const
SQLException
&
e
)
catch
(
const
SQLException
&
e
)
{
{
...
...
forms/source/runtime/formoperations.hxx
Dosyayı görüntüle @
92656d5d
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include <com/sun/star/util/XModifyListener.hpp>
#include <com/sun/star/util/XModifyListener.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/sdb/SQLFilterOperator.hpp>
#include <comphelper/componentcontext.hxx>
#include <comphelper/componentcontext.hxx>
...
@@ -300,34 +301,51 @@ namespace frm
...
@@ -300,34 +301,51 @@ namespace frm
/// typedef for member method of this class
/// typedef for member method of this class
typedef
void
(
FormOperations
::*
Action
)(
const
void
*
)
const
;
typedef
void
(
FormOperations
::*
Action
)(
const
void
*
)
const
;
/** calls a
member
function, catches SQLExceptions, extends them with additional context information,
/** calls a
(member)
function, catches SQLExceptions, extends them with additional context information,
and rethrows them
and rethrows them
@param _pAction
@param Action
the member function to call
a fuctionoid with no arguments to do the work
@param _pParam
the parameters to pass to the member function
@param _nErrorResourceId
@param _nErrorResourceId
the id of the resources string to use as error message
the id of the resources string to use as error message
*/
*/
void
impl_doActionInSQLContext_throw
(
Action
_pAction
,
const
void
*
_pParam
,
sal_uInt16
_nErrorResourceId
)
const
;
template
<
typename
FunctObj
>
void
impl_doActionInSQLContext_throw
(
FunctObj
Action
,
sal_uInt16
_nErrorResourceId
)
const
;
//
parameter structure for
appendOrderByColumn
//
functionoid to call
appendOrderByColumn
struct
param_appendOrderByColumn
class
impl_appendOrderByColumn_throw
{
{
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertySet
>
public
:
xField
;
impl_appendOrderByColumn_throw
(
const
FormOperations
*
pFO
,
bool
bUp
;
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertySet
>
xField
,
bool
bUp
)
:
m_pFO
(
pFO
)
,
m_xField
(
xField
)
,
m_bUp
(
bUp
)
{};
void
operator
()()
{
m_pFO
->
m_xParser
->
appendOrderByColumn
(
m_xField
,
m_bUp
);
}
private
:
const
FormOperations
*
m_pFO
;
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertySet
>
m_xField
;
bool
m_bUp
;
};
};
void
impl_appendOrderByColumn_throw
(
const
void
*
_pActionParam
)
const
;
//
parameter structure for
appendFilterByColumn
//
functionoid to call
appendFilterByColumn
struct
param_appendFilterByColumn
class
impl_appendFilterByColumn_throw
{
{
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertySet
>
public
:
xField
;
impl_appendFilterByColumn_throw
(
const
FormOperations
*
pFO
,
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertySet
>
xField
)
:
m_pFO
(
pFO
)
,
m_xField
(
xField
)
{};
void
operator
()()
{
m_pFO
->
m_xParser
->
appendFilterByColumn
(
m_xField
,
sal_True
,
::
com
::
sun
::
star
::
sdb
::
SQLFilterOperator
::
EQUAL
);
}
private
:
const
FormOperations
*
m_pFO
;
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertySet
>
m_xField
;
};
};
void
impl_appendFilterByColumn_throw
(
const
void
*
_pActionParam
)
const
;
private
:
private
:
FormOperations
();
// never implemented
FormOperations
();
// never implemented
...
...
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