summaryrefslogtreecommitdiff
path: root/svx/source/form/filtnav.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/form/filtnav.cxx')
-rw-r--r--svx/source/form/filtnav.cxx25
1 files changed, 12 insertions, 13 deletions
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index d0812222e270..3d76bfdcb10d 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -38,6 +38,7 @@
#include <comphelper/string.hxx>
#include <comphelper/uno3.hxx>
#include <connectivity/dbtools.hxx>
+#include <connectivity/sqlnode.hxx>
#include <cppuhelper/implbase1.hxx>
#include <fmservs.hxx>
#include <fmshimp.hxx>
@@ -66,9 +67,8 @@
// das ist die Basis, mit der beide Angaben multipliziert werden (in ms)
using namespace ::svxform;
-using namespace ::connectivity::simple;
using namespace ::connectivity;
-
+using namespace ::dbtools;
namespace svxform
@@ -302,7 +302,7 @@ public:
void AddOrRemoveListener( const Reference< XIndexAccess >& _rxControllers, const bool _bAdd );
- void setText(sal_Int32 nPos,
+ static void setText(sal_Int32 nPos,
const FmFilterItem* pFilterItem,
const OUString& rText);
};
@@ -807,7 +807,7 @@ void FmFilterModel::Remove(FmFilterData* pData)
{
::std::vector< FmFilterData* >::iterator removePos = rChildren.end() - 1;
FmFilterItem* pFilterItem = PTR_CAST( FmFilterItem, *removePos );
- m_pAdapter->setText( nPos, pFilterItem, OUString() );
+ FmFilterAdapter::setText( nPos, pFilterItem, OUString() );
Remove( removePos );
}
}
@@ -837,7 +837,7 @@ void FmFilterModel::Remove(FmFilterData* pData)
sal_Int32 nParentPos = j - rParentParentItems.begin();
// EmptyText removes the filter
- m_pAdapter->setText(nParentPos, pFilterItem, OUString());
+ FmFilterAdapter::setText(nParentPos, pFilterItem, OUString());
Remove( i );
}
}
@@ -865,13 +865,12 @@ bool FmFilterModel::ValidateText(FmFilterItem* pItem, OUString& rText, OUString&
{
Reference< XFormController > xFormController( pFormItem->GetController() );
// obtain the connection of the form belonging to the controller
- OStaticDataAccessTools aStaticTools;
Reference< XRowSet > xRowSet( xFormController->getModel(), UNO_QUERY_THROW );
- Reference< XConnection > xConnection( aStaticTools.getRowSetConnection( xRowSet ) );
+ Reference< XConnection > xConnection( getConnection( xRowSet ) );
// obtain a number formatter for this connection
// TODO: shouldn't this be cached?
- Reference< XNumberFormatsSupplier > xFormatSupplier = aStaticTools.getNumberFormats( xConnection, true );
+ Reference< XNumberFormatsSupplier > xFormatSupplier = getNumberFormats( xConnection, true );
Reference< XNumberFormatter > xFormatter( NumberFormatter::create( comphelper::getProcessComponentContext() ), UNO_QUERY_THROW );
xFormatter->attachNumberFormatsSupplier( xFormatSupplier );
@@ -881,14 +880,14 @@ bool FmFilterModel::ValidateText(FmFilterItem* pItem, OUString& rText, OUString&
// parse the given text as filter predicate
OUString aErr, aTxt( rText );
- ::rtl::Reference< ISQLParseNode > xParseNode = predicateTree( aErr, aTxt, xFormatter, xField );
+ std::shared_ptr< OSQLParseNode > pParseNode = predicateTree( aErr, aTxt, xFormatter, xField );
rErrorMsg = aErr;
rText = aTxt;
- if ( xParseNode.is() )
+ if ( pParseNode != nullptr )
{
OUString aPreparedText;
Locale aAppLocale = Application::GetSettings().GetUILanguageTag().getLocale();
- xParseNode->parseNodeToPredicateStr(
+ pParseNode->parseNodeToPredicateStr(
aPreparedText, xConnection, xFormatter, xField, OUString(), aAppLocale, '.', getParseContext() );
rText = aPreparedText;
return true;
@@ -915,7 +914,7 @@ void FmFilterModel::SetTextForItem(FmFilterItem* pItem, const OUString& rText)
::std::vector<FmFilterData*>::iterator i = ::std::find(rItems.begin(), rItems.end(), pItem->GetParent());
sal_Int32 nParentPos = i - rItems.begin();
- m_pAdapter->setText(nParentPos, pItem, rText);
+ FmFilterAdapter::setText(nParentPos, pItem, rText);
if (rText.isEmpty())
Remove(pItem);
@@ -1142,7 +1141,7 @@ FmFilterNavigator::FmFilterNavigator( vcl::Window* pParent )
EnableInplaceEditing( true );
SetSelectionMode(MULTIPLE_SELECTION);
- SetDragDropMode(0xFFFF);
+ SetDragDropMode(DragDropMode::ALL);
m_aDropActionTimer.SetTimeoutHdl(LINK(this, FmFilterNavigator, OnDropActionTimer));
}