22#include <com/sun/star/beans/XPropertySet.hpp>
23#include <com/sun/star/lang/XComponent.hpp>
24#include <com/sun/star/lang/XServiceInfo.hpp>
25#include <com/sun/star/sdbc/XCloseable.hpp>
26#include <com/sun/star/sdbc/XResultSet.hpp>
27#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
28#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
29#include <com/sun/star/sdbc/XRow.hpp>
30#include <com/sun/star/ucb/XContentAccess.hpp>
31#include <com/sun/star/ucb/NumberedSortingInfo.hpp>
32#include <com/sun/star/ucb/XAnyCompareFactory.hpp>
33#include <com/sun/star/ucb/ListAction.hpp>
51 std::deque < std::unique_ptr<SortListData> >
maData;
57 sal_uInt32
Count()
const {
return static_cast<sal_uInt32
>(
maData.size()); }
60 void Insert( std::unique_ptr<SortListData> pEntry, sal_Int32 nPos );
61 std::unique_ptr<SortListData>
Remove( sal_Int32 nPos );
63 void Move( sal_Int32 nOldPos, sal_Int32 nNewPos );
71 std::deque <css::ucb::ListAction >
maData;
76 sal_uInt32
Count()
const {
return static_cast<sal_uInt32
>(
maData.size()); }
78 void AddEvent( sal_IntPtr nType, sal_Int32 nPos );
79 void Insert(
const css::ucb::ListAction& rAction ) {
maData.push_back( rAction ); }
89 css::lang::XServiceInfo,
90 css::lang::XComponent,
91 css::ucb::XContentAccess,
92 css::sdbc::XResultSet,
94 css::sdbc::XCloseable,
95 css::sdbc::XResultSetMetaDataSupplier,
96 css::beans::XPropertySet >
103 css::uno::Reference < css::sdbc::XResultSet >
mxOther;
125 void BuildSortInfo(
const css::uno::Reference< css::sdbc::XResultSet >& aResult,
126 const css::uno::Sequence < css::ucb::NumberedSortingInfo > &xSortInfo,
127 const css::uno::Reference< css::ucb::XAnyCompareFactory > &xCompFac );
130 static sal_Int32
CompareImpl(
const css::uno::Reference < css::sdbc::XResultSet >& xResultOne,
131 const css::uno::Reference < css::sdbc::XResultSet >& xResultTwo,
132 sal_Int32 nIndexOne, sal_Int32 nIndexTwo,
136 sal_Int32
CompareImpl(
const css::uno::Reference < css::sdbc::XResultSet >& xResultOne,
137 const css::uno::Reference < css::sdbc::XResultSet >& xResultTwo,
138 sal_Int32 nIndexOne, sal_Int32 nIndexTwo );
142 SortedResultSet( css::uno::Reference< css::sdbc::XResultSet >
const & aResult );
148 void Initialize(
const css::uno::Sequence < css::ucb::NumberedSortingInfo > &xSortInfo,
149 const css::uno::Reference< css::ucb::XAnyCompareFactory > &xCompFac );
152 void InsertNew( sal_Int32 nPos, sal_Int32 nCount );
153 void SetChanged( sal_Int32 nPos, sal_Int32 nCount );
155 void Move( sal_Int32 nPos, sal_Int32 nCount, sal_Int32 nOffset );
166 virtual void SAL_CALL
169 virtual void SAL_CALL
170 addEventListener(
const css::uno::Reference< css::lang::XEventListener >& Listener )
override;
172 virtual void SAL_CALL
173 removeEventListener(
const css::uno::Reference< css::lang::XEventListener >& Listener )
override;
176 virtual OUString SAL_CALL
178 virtual css::uno::Reference<
179 css::ucb::XContentIdentifier > SAL_CALL
181 virtual css::uno::Reference<
182 css::ucb::XContent > SAL_CALL
196 virtual void SAL_CALL
198 virtual void SAL_CALL
204 virtual sal_Int32 SAL_CALL
209 relative( sal_Int32 rows )
override;
212 virtual void SAL_CALL
220 virtual css::uno::Reference<
221 css::uno::XInterface > SAL_CALL
228 virtual OUString SAL_CALL
229 getString( sal_Int32 columnIndex )
override;
235 getByte( sal_Int32 columnIndex )
override;
237 virtual sal_Int16 SAL_CALL
238 getShort( sal_Int32 columnIndex )
override;
240 virtual sal_Int32 SAL_CALL
241 getInt( sal_Int32 columnIndex )
override;
243 virtual sal_Int64 SAL_CALL
244 getLong( sal_Int32 columnIndex )
override;
246 virtual float SAL_CALL
247 getFloat( sal_Int32 columnIndex )
override;
249 virtual double SAL_CALL
250 getDouble( sal_Int32 columnIndex )
override;
252 virtual css::uno::Sequence< sal_Int8 > SAL_CALL
253 getBytes( sal_Int32 columnIndex )
override;
255 virtual css::util::Date SAL_CALL
256 getDate( sal_Int32 columnIndex )
override;
258 virtual css::util::Time SAL_CALL
259 getTime( sal_Int32 columnIndex )
override;
261 virtual css::util::DateTime SAL_CALL
264 virtual css::uno::Reference<
265 css::io::XInputStream > SAL_CALL
268 virtual css::uno::Reference<
269 css::io::XInputStream > SAL_CALL
272 virtual css::uno::Any SAL_CALL
274 const css::uno::Reference<
275 css::container::XNameAccess >& typeMap )
override;
276 virtual css::uno::Reference<
277 css::sdbc::XRef > SAL_CALL
278 getRef( sal_Int32 columnIndex )
override;
279 virtual css::uno::Reference<
280 css::sdbc::XBlob > SAL_CALL
281 getBlob( sal_Int32 columnIndex )
override;
282 virtual css::uno::Reference<
283 css::sdbc::XClob > SAL_CALL
284 getClob( sal_Int32 columnIndex )
override;
285 virtual css::uno::Reference<
286 css::sdbc::XArray > SAL_CALL
287 getArray( sal_Int32 columnIndex )
override;
290 virtual void SAL_CALL
294 virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL
299 virtual css::uno::Reference<
300 css::beans::XPropertySetInfo > SAL_CALL
303 virtual void SAL_CALL
305 const css::uno::Any& Value )
override;
307 virtual css::uno::Any SAL_CALL
310 virtual void SAL_CALL
312 const css::uno::Reference<
313 css::beans::XPropertyChangeListener >& Listener )
override;
315 virtual void SAL_CALL
317 const css::uno::Reference<
318 css::beans::XPropertyChangeListener >& Listener )
override;
320 virtual void SAL_CALL
322 const css::uno::Reference<
323 css::beans::XVetoableChangeListener >& Listener )
override;
325 virtual void SAL_CALL
327 const css::uno::Reference<
328 css::beans::XVetoableChangeListener >& aListener )
override;
css::ucb::ListAction & GetAction(sal_Int32 nIndex)
void AddEvent(sal_IntPtr nType, sal_Int32 nPos)
void Insert(const css::ucb::ListAction &rAction)
std::deque< css::ucb::ListAction > maData
std::unique_ptr< SortListData > Remove(sal_Int32 nPos)
std::deque< std::unique_ptr< SortListData > > maData
sal_Int32 operator[](sal_Int32 nPos) const
SortListData * GetData(sal_Int32 nPos)
void Move(sal_Int32 nOldPos, sal_Int32 nNewPos)
void Insert(std::unique_ptr< SortListData > pEntry, sal_Int32 nPos)
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement() override
std::deque< SortListData * > m_ModList
maps the original Entries to the sorted ones
virtual double SAL_CALL getDouble(sal_Int32 columnIndex) override
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob(sal_Int32 columnIndex) override
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream(sal_Int32 columnIndex) override
sal_Int32 FindPos(SortListData const *pEntry, sal_IntPtr nStart, sal_IntPtr nEnd)
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &Listener) override
virtual sal_Int16 SAL_CALL getShort(sal_Int32 columnIndex) override
virtual void SAL_CALL dispose() override
void ResortNew(EventList *pList)
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &Listener) override
virtual sal_Bool SAL_CALL next() override
virtual void SAL_CALL refreshRow() override
virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent() override
virtual sal_Bool SAL_CALL rowDeleted() override
virtual sal_Int8 SAL_CALL getByte(sal_Int32 columnIndex) override
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData() override
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef(sal_Int32 columnIndex) override
sal_Int32 CompareImpl(const css::uno::Reference< css::sdbc::XResultSet > &xResultOne, const css::uno::Reference< css::sdbc::XResultSet > &xResultTwo, sal_Int32 nIndexOne, sal_Int32 nIndexTwo)
void Remove(sal_Int32 nPos, sal_Int32 nCount, EventList *pList)
virtual sal_Bool SAL_CALL getBoolean(sal_Int32 columnIndex) override
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL rowInserted() override
virtual sal_Bool SAL_CALL relative(sal_Int32 rows) override
moves the cursor a relative number of rows, either positive or negative.
void ResortModified(EventList *pList)
void SetChanged(sal_Int32 nPos, sal_Int32 nCount)
virtual sal_Bool SAL_CALL absolute(sal_Int32 row) override
moves the cursor to the given row number in the result set.
virtual css::uno::Reference< css::ucb::XContentIdentifier > SAL_CALL queryContentIdentifier() override
void Move(sal_Int32 nPos, sal_Int32 nCount, sal_Int32 nOffset)
css::uno::Reference< css::sdbc::XResultSet > mxOther
virtual void SAL_CALL removePropertyChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &Listener) override
virtual ~SortedResultSet() override
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob(sal_Int32 columnIndex) override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual OUString SAL_CALL queryContentIdentifierString() override
virtual sal_Bool SAL_CALL last() override
virtual sal_Int32 SAL_CALL getInt(sal_Int32 columnIndex) override
sal_Int32 Compare(SortListData const *pOne, SortListData const *pTwo)
virtual css::util::Date SAL_CALL getDate(sal_Int32 columnIndex) override
static sal_Int32 CompareImpl(const css::uno::Reference< css::sdbc::XResultSet > &xResultOne, const css::uno::Reference< css::sdbc::XResultSet > &xResultTwo, sal_Int32 nIndexOne, sal_Int32 nIndexTwo, SortInfo const *pSortInfo)
virtual sal_Int64 SAL_CALL getLong(sal_Int32 columnIndex) override
virtual sal_Int32 SAL_CALL getRow() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
sal_Int32 mnLastSort
keeps track of modified entries
virtual sal_Bool SAL_CALL first() override
comphelper::OMultiTypeInterfaceContainerHelperVar4< OUString, css::beans::XPropertyChangeListener > maPropChangeListeners
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream(sal_Int32 columnIndex) override
void CopyData(SortedResultSet *pSource)
void PropertyChanged(const css::beans::PropertyChangeEvent &rEvt)
virtual css::util::Time SAL_CALL getTime(sal_Int32 columnIndex) override
virtual void SAL_CALL close() override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
void Initialize(const css::uno::Sequence< css::ucb::NumberedSortingInfo > &xSortInfo, const css::uno::Reference< css::ucb::XAnyCompareFactory > &xCompFac)
SortedResultSet(css::uno::Reference< css::sdbc::XResultSet > const &aResult)
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes(sal_Int32 columnIndex) override
sal_Int32 GetCount() const
virtual sal_Bool SAL_CALL previous() override
moves the cursor to the previous row in the result set.
void BuildSortInfo(const css::uno::Reference< css::sdbc::XResultSet > &aResult, const css::uno::Sequence< css::ucb::NumberedSortingInfo > &xSortInfo, const css::uno::Reference< css::ucb::XAnyCompareFactory > &xCompFac)
virtual sal_Bool SAL_CALL isAfterLast() override
css::uno::Reference< css::sdbc::XResultSet > mxOriginal
comphelper::OMultiTypeInterfaceContainerHelperVar4< OUString, css::beans::XVetoableChangeListener > maVetoChangeListeners
comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > maDisposeEventListeners
rtl::Reference< SRSPropertySetInfo > mpPropSetInfo
void CheckProperties(sal_Int32 nOldCount, bool bWasFinal)
virtual sal_Bool SAL_CALL rowUpdated() override
virtual void SAL_CALL afterLast() override
virtual sal_Bool SAL_CALL wasNull() override
virtual void SAL_CALL addPropertyChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &Listener) override
virtual void SAL_CALL beforeFirst() override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL setPropertyValue(const OUString &PropertyName, const css::uno::Any &Value) override
virtual sal_Bool SAL_CALL isBeforeFirst() override
std::deque< sal_IntPtr > m_O2S
virtual css::uno::Any SAL_CALL getObject(sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess > &typeMap) override
virtual OUString SAL_CALL getString(sal_Int32 columnIndex) override
void InsertNew(sal_Int32 nPos, sal_Int32 nCount)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &Listener) override
virtual sal_Bool SAL_CALL isFirst() override
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray(sal_Int32 columnIndex) override
virtual sal_Bool SAL_CALL isLast() override
virtual float SAL_CALL getFloat(sal_Int32 columnIndex) override
virtual css::util::DateTime SAL_CALL getTimestamp(sal_Int32 columnIndex) override
constexpr OUStringLiteral RESULTSET_SERVICE_NAME