-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>
|
||||
|
||||
class CDTransObjFactory
|
||||
namespace CDTransObjFactory
|
||||
{
|
||||
public:
|
||||
virtual IDataObjectPtr SAL_CALL createDataObjFromTransferable( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
|
||||
IDataObjectPtr createDataObjFromTransferable( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
|
||||
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
|
||||
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include <systools/win32/comtools.hxx>
|
||||
#include "../../inc/DtObjFactory.hxx"
|
||||
#include "../dtobj/APNDataObject.hxx"
|
||||
#include "../dtobj/DOTransferable.hxx"
|
||||
#include "WinClipboard.hxx"
|
||||
#include <com/sun/star/datatransfer/clipboard/RenderingCapabilities.hpp>
|
||||
#include "../dtobj/XNotifyingDataObject.hxx"
|
||||
@@ -103,10 +104,8 @@ Reference< XTransferable > SAL_CALL CWinClipbImpl::getContents( ) throw( Runtime
|
||||
// com smart pointer to the IDataObject from clipboard
|
||||
IDataObjectPtr pIDo( new CAPNDataObject( pIDataObject ) );
|
||||
|
||||
CDTransObjFactory objFactory;
|
||||
|
||||
// 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;
|
||||
@@ -119,7 +118,6 @@ void SAL_CALL CWinClipbImpl::setContents(
|
||||
const Reference< XClipboardOwner >& xClipboardOwner )
|
||||
throw( RuntimeException )
|
||||
{
|
||||
CDTransObjFactory objFactory;
|
||||
IDataObjectPtr pIDataObj;
|
||||
|
||||
if ( xTransferable.is( ) )
|
||||
@@ -127,7 +125,7 @@ void SAL_CALL CWinClipbImpl::setContents(
|
||||
ClearableMutexGuard aGuard( m_ClipContentMutex );
|
||||
|
||||
m_pCurrentClipContent = new CXNotifyingDataObject(
|
||||
objFactory.createDataObjFromTransferable( m_pWinClipboard->m_xContext , xTransferable ),
|
||||
CDTransObjFactory::createDataObjFromTransferable( m_pWinClipboard->m_xContext , xTransferable ),
|
||||
xTransferable,
|
||||
xClipboardOwner,
|
||||
this );
|
||||
|
@@ -112,7 +112,7 @@ void DragSource::StartDragImpl(
|
||||
g_XTransferable = trans;
|
||||
//<-- TRA
|
||||
|
||||
m_spDataObject= m_aDataConverter.createDataObjFromTransferable(
|
||||
m_spDataObject= CDTransObjFactory::createDataObjFromTransferable(
|
||||
m_xContext, trans);
|
||||
|
||||
// Obtain the id of the thread that created the window
|
||||
|
@@ -26,12 +26,15 @@
|
||||
#include <osl/mutex.hxx>
|
||||
#include <cppuhelper/compbase.hxx>
|
||||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||
#include "../../inc/DtObjFactory.hxx"
|
||||
#include "globals.hxx"
|
||||
#include <oleidl.h>
|
||||
|
||||
#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::uno;
|
||||
using namespace cppu;
|
||||
@@ -53,8 +56,6 @@ class DragSource:
|
||||
|
||||
// The mouse button that set off the drag and drop operation
|
||||
short m_MouseButton;
|
||||
// Converts XTransferable objects to IDataObject objects.
|
||||
CDTransObjFactory m_aDataConverter;
|
||||
|
||||
DragSource();
|
||||
DragSource(const DragSource&);
|
||||
|
@@ -29,6 +29,8 @@
|
||||
#include <rtl/ustring.h>
|
||||
#include <osl/thread.h>
|
||||
|
||||
#include "../dtobj/DOTransferable.hxx"
|
||||
|
||||
using namespace cppu;
|
||||
using namespace osl;
|
||||
using namespace com::sun::star::datatransfer;
|
||||
@@ -323,7 +325,7 @@ HRESULT DropTarget::DragEnter( IDataObject *pDataObj,
|
||||
else
|
||||
{
|
||||
// Convert the IDataObject to a XTransferable
|
||||
m_currentData= m_aDataConverter.createTransferableFromDataObj(
|
||||
m_currentData= CDOTransferable::create(
|
||||
m_xContext, IDataObjectPtr(pDataObj));
|
||||
}
|
||||
|
||||
|
@@ -36,7 +36,10 @@
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
#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::uno;
|
||||
@@ -100,8 +103,6 @@ private:
|
||||
// sal_Int8 m_userAction;
|
||||
// Set by listeners when they call XDropTargetDropContext::dropComplete
|
||||
sal_Bool m_bDropComplete;
|
||||
// converts IDataObject objects to XTransferable objects.
|
||||
CDTransObjFactory m_aDataConverter;
|
||||
Reference<XDropTargetDragContext> m_currentDragContext;
|
||||
Reference<XDropTargetDropContext> m_currentDropContext;
|
||||
|
||||
|
@@ -58,7 +58,18 @@ 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(
|
||||
const Reference< XComponentContext >& rxContext, IDataObjectPtr rDataObject ) :
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#include <systools/win32/comtools.hxx>
|
||||
|
||||
// forward
|
||||
class CDTransObjFactory;
|
||||
class CFormatEtc;
|
||||
|
||||
class CDOTransferable : public ::cppu::WeakImplHelper<
|
||||
@@ -41,6 +40,9 @@ class CDOTransferable : public ::cppu::WeakImplHelper<
|
||||
public:
|
||||
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
|
||||
|
||||
virtual css::uno::Any SAL_CALL getTransferData( const css::datatransfer::DataFlavor& aFlavor )
|
||||
@@ -58,7 +60,6 @@ public:
|
||||
(css::uno::RuntimeException);
|
||||
|
||||
private:
|
||||
// should be created only by CDTransObjFactory
|
||||
explicit CDOTransferable(
|
||||
const css::uno::Reference< css::uno::XComponentContext >& rxContext,
|
||||
IDataObjectPtr rDataObject );
|
||||
@@ -103,8 +104,6 @@ private:
|
||||
private:
|
||||
CDOTransferable( const CDOTransferable& );
|
||||
CDOTransferable& operator=( const CDOTransferable& );
|
||||
|
||||
friend class CDTransObjFactory;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -21,8 +21,6 @@
|
||||
|
||||
#include "XTDataObject.hxx"
|
||||
|
||||
#include "DOTransferable.hxx"
|
||||
|
||||
// namespace directives
|
||||
|
||||
using namespace com::sun::star::uno;
|
||||
@@ -37,17 +35,4 @@ IDataObjectPtr SAL_CALL CDTransObjFactory::createDataObjFromTransferable(const R
|
||||
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: */
|
||||
|
@@ -21,7 +21,6 @@
|
||||
#include "XNotifyingDataObject.hxx"
|
||||
#include "../clipb/WinClipbImpl.hxx"
|
||||
#include "../clipb/WinClipboard.hxx"
|
||||
#include "../../inc/DtObjFactory.hxx"
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#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
|
||||
|
||||
Reference<XTransferable> xTrans= m_aDataConverter.createTransferableFromDataObj(
|
||||
Reference<XTransferable> xTrans= CDOTransferable::create(
|
||||
MultiServiceFactory, pData);
|
||||
|
||||
// call XDragSource::executeDrag from an MTA
|
||||
|
@@ -49,8 +49,6 @@ class AWindow: public CWindowImpl<AWindow, CWindow,
|
||||
|
||||
HWND m_hwndEdit;
|
||||
|
||||
CDTransObjFactory m_aDataConverter;
|
||||
|
||||
public:
|
||||
explicit AWindow(LPCTSTR strName)
|
||||
{
|
||||
|
Reference in New Issue
Block a user