[Libreoffice-commits] core.git: include/svtools svtools/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Oct 9 19:24:04 UTC 2020
include/svtools/stringtransfer.hxx | 15 +++++++--------
svtools/source/misc/stringtransfer.cxx | 17 +++--------------
2 files changed, 10 insertions(+), 22 deletions(-)
New commits:
commit 58ace895761c304020f92a2aded57cb6b9e83dd1
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Oct 9 16:28:51 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Oct 9 21:23:21 2020 +0200
inherit OStringTransferable from TransferDataContainer
so it can be used as an argument to
weld: :CustomWeld::SetDragDataTransferrable
Change-Id: Ibb58be6871a8719504d33d02bf7104213105be99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104126
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/svtools/stringtransfer.hxx b/include/svtools/stringtransfer.hxx
index dcb5bda5dec4..ab192f99f18d 100644
--- a/include/svtools/stringtransfer.hxx
+++ b/include/svtools/stringtransfer.hxx
@@ -27,14 +27,16 @@
namespace svt
{
-
-
//= OStringTransferable
-
- class UNLESS_MERGELIBS(SVT_DLLPUBLIC) OStringTransferable final : public TransferableHelper
+ class UNLESS_MERGELIBS(SVT_DLLPUBLIC) OStringTransferable final : public TransferDataContainer
{
public:
- OStringTransferable(const OUString& _rContent);
+ OStringTransferable(const OUString& rContent);
+
+ void UpdateData(const OUString& rContent)
+ {
+ m_sContent = rContent;
+ }
private:
// TransferableHelper overridables
@@ -46,7 +48,6 @@ namespace svt
//= OStringTransfer
-
class OStringTransfer
{
public:
@@ -66,10 +67,8 @@ namespace svt
SVT_DLLPUBLIC static void StartStringDrag( const OUString& _rContent, vcl::Window* _pWindow, sal_Int8 _nDragSourceActions );
};
-
} // namespace svt
-
#endif // INCLUDED_SVTOOLS_STRINGTRANSFER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/misc/stringtransfer.cxx b/svtools/source/misc/stringtransfer.cxx
index 14e805fc60c9..29273e495bbb 100644
--- a/svtools/source/misc/stringtransfer.cxx
+++ b/svtools/source/misc/stringtransfer.cxx
@@ -33,21 +33,17 @@ namespace svt
//= OStringTransferable
-
-
- OStringTransferable::OStringTransferable(const OUString& _rContent)
- :TransferableHelper()
- ,m_sContent( _rContent )
+ OStringTransferable::OStringTransferable(const OUString& rContent)
+ : TransferDataContainer()
+ , m_sContent(rContent)
{
}
-
void OStringTransferable::AddSupportedFormats()
{
AddFormat(SotClipboardFormatId::STRING);
}
-
bool OStringTransferable::GetData( const DataFlavor& _rFlavor, const OUString& /*rDestDoc*/ )
{
SotClipboardFormatId nFormat = SotExchange::GetFormat( _rFlavor );
@@ -57,17 +53,13 @@ namespace svt
return false;
}
-
//= OStringTransfer
-
-
void OStringTransfer::CopyString( const OUString& _rContent, vcl::Window* _pWindow )
{
rtl::Reference<OStringTransferable> pTransferable = new OStringTransferable( _rContent );
pTransferable->CopyToClipboard( _pWindow );
}
-
bool OStringTransfer::PasteString( OUString& _rContent, vcl::Window* _pWindow )
{
TransferableDataHelper aClipboardData = TransferableDataHelper::CreateFromSystemClipboard( _pWindow );
@@ -88,15 +80,12 @@ namespace svt
return false;
}
-
void OStringTransfer::StartStringDrag( const OUString& _rContent, vcl::Window* _pWindow, sal_Int8 _nDragSourceActions )
{
rtl::Reference<OStringTransferable> pTransferable = new OStringTransferable( _rContent );
pTransferable->StartDrag(_pWindow, _nDragSourceActions);
}
-
} // namespace svt
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list