-Werror,-Wnon-virtual-dtor
Why was CDTransObjFactory a class with virtual functions in the first place? Change-Id: I315243a2268be67e03feb923ca7f64fd37818337
This commit is contained in:
@@ -25,14 +25,11 @@
|
|||||||
|
|
||||||
#include <systools/win32/comtools.hxx>
|
#include <systools/win32/comtools.hxx>
|
||||||
|
|
||||||
class CDTransObjFactory
|
namespace CDTransObjFactory
|
||||||
{
|
{
|
||||||
public:
|
IDataObjectPtr createDataObjFromTransferable( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
|
||||||
virtual IDataObjectPtr SAL_CALL createDataObjFromTransferable( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
|
|
||||||
const css::uno::Reference< css::datatransfer::XTransferable >& refXTransferable );
|
const css::uno::Reference< css::datatransfer::XTransferable >& refXTransferable );
|
||||||
virtual css::uno::Reference< css::datatransfer::XTransferable > SAL_CALL createTransferableFromDataObj(
|
}
|
||||||
const css::uno::Reference< css::uno::XComponentContext >& rxContext, IDataObjectPtr pIDataObject );
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include <systools/win32/comtools.hxx>
|
#include <systools/win32/comtools.hxx>
|
||||||
#include "../../inc/DtObjFactory.hxx"
|
#include "../../inc/DtObjFactory.hxx"
|
||||||
#include "../dtobj/APNDataObject.hxx"
|
#include "../dtobj/APNDataObject.hxx"
|
||||||
|
#include "../dtobj/DOTransferable.hxx"
|
||||||
#include "WinClipboard.hxx"
|
#include "WinClipboard.hxx"
|
||||||
#include <com/sun/star/datatransfer/clipboard/RenderingCapabilities.hpp>
|
#include <com/sun/star/datatransfer/clipboard/RenderingCapabilities.hpp>
|
||||||
#include "../dtobj/XNotifyingDataObject.hxx"
|
#include "../dtobj/XNotifyingDataObject.hxx"
|
||||||
@@ -103,10 +104,8 @@ Reference< XTransferable > SAL_CALL CWinClipbImpl::getContents( ) throw( Runtime
|
|||||||
// com smart pointer to the IDataObject from clipboard
|
// com smart pointer to the IDataObject from clipboard
|
||||||
IDataObjectPtr pIDo( new CAPNDataObject( pIDataObject ) );
|
IDataObjectPtr pIDo( new CAPNDataObject( pIDataObject ) );
|
||||||
|
|
||||||
CDTransObjFactory objFactory;
|
|
||||||
|
|
||||||
// remember pIDo destroys itself due to the smart pointer
|
// remember pIDo destroys itself due to the smart pointer
|
||||||
rClipContent = objFactory.createTransferableFromDataObj( m_pWinClipboard->m_xContext, pIDo );
|
rClipContent = CDOTransferable::create( m_pWinClipboard->m_xContext, pIDo );
|
||||||
}
|
}
|
||||||
|
|
||||||
return rClipContent;
|
return rClipContent;
|
||||||
@@ -119,7 +118,6 @@ void SAL_CALL CWinClipbImpl::setContents(
|
|||||||
const Reference< XClipboardOwner >& xClipboardOwner )
|
const Reference< XClipboardOwner >& xClipboardOwner )
|
||||||
throw( RuntimeException )
|
throw( RuntimeException )
|
||||||
{
|
{
|
||||||
CDTransObjFactory objFactory;
|
|
||||||
IDataObjectPtr pIDataObj;
|
IDataObjectPtr pIDataObj;
|
||||||
|
|
||||||
if ( xTransferable.is( ) )
|
if ( xTransferable.is( ) )
|
||||||
@@ -127,7 +125,7 @@ void SAL_CALL CWinClipbImpl::setContents(
|
|||||||
ClearableMutexGuard aGuard( m_ClipContentMutex );
|
ClearableMutexGuard aGuard( m_ClipContentMutex );
|
||||||
|
|
||||||
m_pCurrentClipContent = new CXNotifyingDataObject(
|
m_pCurrentClipContent = new CXNotifyingDataObject(
|
||||||
objFactory.createDataObjFromTransferable( m_pWinClipboard->m_xContext , xTransferable ),
|
CDTransObjFactory::createDataObjFromTransferable( m_pWinClipboard->m_xContext , xTransferable ),
|
||||||
xTransferable,
|
xTransferable,
|
||||||
xClipboardOwner,
|
xClipboardOwner,
|
||||||
this );
|
this );
|
||||||
|
@@ -112,7 +112,7 @@ void DragSource::StartDragImpl(
|
|||||||
g_XTransferable = trans;
|
g_XTransferable = trans;
|
||||||
//<-- TRA
|
//<-- TRA
|
||||||
|
|
||||||
m_spDataObject= m_aDataConverter.createDataObjFromTransferable(
|
m_spDataObject= CDTransObjFactory::createDataObjFromTransferable(
|
||||||
m_xContext, trans);
|
m_xContext, trans);
|
||||||
|
|
||||||
// Obtain the id of the thread that created the window
|
// Obtain the id of the thread that created the window
|
||||||
|
@@ -26,12 +26,15 @@
|
|||||||
#include <osl/mutex.hxx>
|
#include <osl/mutex.hxx>
|
||||||
#include <cppuhelper/compbase.hxx>
|
#include <cppuhelper/compbase.hxx>
|
||||||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||||
#include "../../inc/DtObjFactory.hxx"
|
|
||||||
#include "globals.hxx"
|
#include "globals.hxx"
|
||||||
#include <oleidl.h>
|
#include <oleidl.h>
|
||||||
|
|
||||||
#include <systools/win32/comtools.hxx>
|
#include <systools/win32/comtools.hxx>
|
||||||
|
|
||||||
|
namespace com { namespace sun { namespace star { namespace uno {
|
||||||
|
class XComponentContext;
|
||||||
|
} } } }
|
||||||
|
|
||||||
using namespace ::com::sun::star::lang;
|
using namespace ::com::sun::star::lang;
|
||||||
using namespace ::com::sun::star::uno;
|
using namespace ::com::sun::star::uno;
|
||||||
using namespace cppu;
|
using namespace cppu;
|
||||||
@@ -53,8 +56,6 @@ class DragSource:
|
|||||||
|
|
||||||
// The mouse button that set off the drag and drop operation
|
// The mouse button that set off the drag and drop operation
|
||||||
short m_MouseButton;
|
short m_MouseButton;
|
||||||
// Converts XTransferable objects to IDataObject objects.
|
|
||||||
CDTransObjFactory m_aDataConverter;
|
|
||||||
|
|
||||||
DragSource();
|
DragSource();
|
||||||
DragSource(const DragSource&);
|
DragSource(const DragSource&);
|
||||||
|
@@ -29,6 +29,8 @@
|
|||||||
#include <rtl/ustring.h>
|
#include <rtl/ustring.h>
|
||||||
#include <osl/thread.h>
|
#include <osl/thread.h>
|
||||||
|
|
||||||
|
#include "../dtobj/DOTransferable.hxx"
|
||||||
|
|
||||||
using namespace cppu;
|
using namespace cppu;
|
||||||
using namespace osl;
|
using namespace osl;
|
||||||
using namespace com::sun::star::datatransfer;
|
using namespace com::sun::star::datatransfer;
|
||||||
@@ -323,7 +325,7 @@ HRESULT DropTarget::DragEnter( IDataObject *pDataObj,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Convert the IDataObject to a XTransferable
|
// Convert the IDataObject to a XTransferable
|
||||||
m_currentData= m_aDataConverter.createTransferableFromDataObj(
|
m_currentData= CDOTransferable::create(
|
||||||
m_xContext, IDataObjectPtr(pDataObj));
|
m_xContext, IDataObjectPtr(pDataObj));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -36,7 +36,10 @@
|
|||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
#endif
|
#endif
|
||||||
#include "globals.hxx"
|
#include "globals.hxx"
|
||||||
#include "../../inc/DtObjFactory.hxx"
|
|
||||||
|
namespace com { namespace sun { namespace star { namespace uno {
|
||||||
|
class XComponentContext;
|
||||||
|
} } } }
|
||||||
|
|
||||||
using namespace ::com::sun::star::lang;
|
using namespace ::com::sun::star::lang;
|
||||||
using namespace ::com::sun::star::uno;
|
using namespace ::com::sun::star::uno;
|
||||||
@@ -100,8 +103,6 @@ private:
|
|||||||
// sal_Int8 m_userAction;
|
// sal_Int8 m_userAction;
|
||||||
// Set by listeners when they call XDropTargetDropContext::dropComplete
|
// Set by listeners when they call XDropTargetDropContext::dropComplete
|
||||||
sal_Bool m_bDropComplete;
|
sal_Bool m_bDropComplete;
|
||||||
// converts IDataObject objects to XTransferable objects.
|
|
||||||
CDTransObjFactory m_aDataConverter;
|
|
||||||
Reference<XDropTargetDragContext> m_currentDragContext;
|
Reference<XDropTargetDragContext> m_currentDragContext;
|
||||||
Reference<XDropTargetDropContext> m_currentDropContext;
|
Reference<XDropTargetDropContext> m_currentDropContext;
|
||||||
|
|
||||||
|
@@ -58,7 +58,18 @@ namespace
|
|||||||
|
|
||||||
} // end namespace
|
} // end namespace
|
||||||
|
|
||||||
// ctor
|
Reference< XTransferable > SAL_CALL CDOTransferable::create( const Reference< XComponentContext >& rxContext,
|
||||||
|
IDataObjectPtr pIDataObject )
|
||||||
|
{
|
||||||
|
CDOTransferable* pTransf = new CDOTransferable(rxContext, pIDataObject);
|
||||||
|
Reference<XTransferable> refDOTransf(pTransf);
|
||||||
|
|
||||||
|
pTransf->acquire();
|
||||||
|
pTransf->initFlavorList();
|
||||||
|
pTransf->release();
|
||||||
|
|
||||||
|
return refDOTransf;
|
||||||
|
}
|
||||||
|
|
||||||
CDOTransferable::CDOTransferable(
|
CDOTransferable::CDOTransferable(
|
||||||
const Reference< XComponentContext >& rxContext, IDataObjectPtr rDataObject ) :
|
const Reference< XComponentContext >& rxContext, IDataObjectPtr rDataObject ) :
|
||||||
|
@@ -31,7 +31,6 @@
|
|||||||
#include <systools/win32/comtools.hxx>
|
#include <systools/win32/comtools.hxx>
|
||||||
|
|
||||||
// forward
|
// forward
|
||||||
class CDTransObjFactory;
|
|
||||||
class CFormatEtc;
|
class CFormatEtc;
|
||||||
|
|
||||||
class CDOTransferable : public ::cppu::WeakImplHelper<
|
class CDOTransferable : public ::cppu::WeakImplHelper<
|
||||||
@@ -41,6 +40,9 @@ class CDOTransferable : public ::cppu::WeakImplHelper<
|
|||||||
public:
|
public:
|
||||||
typedef css::uno::Sequence< sal_Int8 > ByteSequence_t;
|
typedef css::uno::Sequence< sal_Int8 > ByteSequence_t;
|
||||||
|
|
||||||
|
static css::uno::Reference< css::datatransfer::XTransferable > create(
|
||||||
|
const css::uno::Reference< css::uno::XComponentContext >& rxContext, IDataObjectPtr pIDataObject );
|
||||||
|
|
||||||
// XTransferable
|
// XTransferable
|
||||||
|
|
||||||
virtual css::uno::Any SAL_CALL getTransferData( const css::datatransfer::DataFlavor& aFlavor )
|
virtual css::uno::Any SAL_CALL getTransferData( const css::datatransfer::DataFlavor& aFlavor )
|
||||||
@@ -58,7 +60,6 @@ public:
|
|||||||
(css::uno::RuntimeException);
|
(css::uno::RuntimeException);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// should be created only by CDTransObjFactory
|
|
||||||
explicit CDOTransferable(
|
explicit CDOTransferable(
|
||||||
const css::uno::Reference< css::uno::XComponentContext >& rxContext,
|
const css::uno::Reference< css::uno::XComponentContext >& rxContext,
|
||||||
IDataObjectPtr rDataObject );
|
IDataObjectPtr rDataObject );
|
||||||
@@ -103,8 +104,6 @@ private:
|
|||||||
private:
|
private:
|
||||||
CDOTransferable( const CDOTransferable& );
|
CDOTransferable( const CDOTransferable& );
|
||||||
CDOTransferable& operator=( const CDOTransferable& );
|
CDOTransferable& operator=( const CDOTransferable& );
|
||||||
|
|
||||||
friend class CDTransObjFactory;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -21,8 +21,6 @@
|
|||||||
|
|
||||||
#include "XTDataObject.hxx"
|
#include "XTDataObject.hxx"
|
||||||
|
|
||||||
#include "DOTransferable.hxx"
|
|
||||||
|
|
||||||
// namespace directives
|
// namespace directives
|
||||||
|
|
||||||
using namespace com::sun::star::uno;
|
using namespace com::sun::star::uno;
|
||||||
@@ -37,17 +35,4 @@ IDataObjectPtr SAL_CALL CDTransObjFactory::createDataObjFromTransferable(const R
|
|||||||
return (IDataObjectPtr(new CXTDataObject(rxContext, refXTransferable)));
|
return (IDataObjectPtr(new CXTDataObject(rxContext, refXTransferable)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference< XTransferable > SAL_CALL CDTransObjFactory::createTransferableFromDataObj( const Reference< XComponentContext >& rxContext,
|
|
||||||
IDataObjectPtr pIDataObject )
|
|
||||||
{
|
|
||||||
CDOTransferable* pTransf = new CDOTransferable(rxContext, pIDataObject);
|
|
||||||
Reference<XTransferable> refDOTransf(pTransf);
|
|
||||||
|
|
||||||
pTransf->acquire();
|
|
||||||
pTransf->initFlavorList();
|
|
||||||
pTransf->release();
|
|
||||||
|
|
||||||
return refDOTransf;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -21,7 +21,6 @@
|
|||||||
#include "XNotifyingDataObject.hxx"
|
#include "XNotifyingDataObject.hxx"
|
||||||
#include "../clipb/WinClipbImpl.hxx"
|
#include "../clipb/WinClipbImpl.hxx"
|
||||||
#include "../clipb/WinClipboard.hxx"
|
#include "../clipb/WinClipboard.hxx"
|
||||||
#include "../../inc/DtObjFactory.hxx"
|
|
||||||
|
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
#if defined __uuidof
|
#if defined __uuidof
|
||||||
|
@@ -168,7 +168,7 @@ LRESULT AWindow::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled
|
|||||||
|
|
||||||
pData->SetData( &format, &medium, TRUE); // releases HGLOBAL eventually
|
pData->SetData( &format, &medium, TRUE); // releases HGLOBAL eventually
|
||||||
|
|
||||||
Reference<XTransferable> xTrans= m_aDataConverter.createTransferableFromDataObj(
|
Reference<XTransferable> xTrans= CDOTransferable::create(
|
||||||
MultiServiceFactory, pData);
|
MultiServiceFactory, pData);
|
||||||
|
|
||||||
// call XDragSource::executeDrag from an MTA
|
// call XDragSource::executeDrag from an MTA
|
||||||
|
@@ -49,8 +49,6 @@ class AWindow: public CWindowImpl<AWindow, CWindow,
|
|||||||
|
|
||||||
HWND m_hwndEdit;
|
HWND m_hwndEdit;
|
||||||
|
|
||||||
CDTransObjFactory m_aDataConverter;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AWindow(LPCTSTR strName)
|
explicit AWindow(LPCTSTR strName)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user