diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-12 14:53:28 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-03-18 14:23:50 +0200 |
commit | fb14be5f8f74f83ba89e15f891ddf1f753dcc62f (patch) | |
tree | beaa4af08b0c3d75bf6e40b21b96c55e0ac1c60a /vcl | |
parent | b8ce52aab9459773544f1696cfe6b7b6f171a389 (diff) |
create new 'enum class' SotClipboardFormatId to unify types
of which there are several.
There are some issues here I am unsure of
- the SW and SC and CHART2 modules essentially ignore the enum values and assign their own ids
Perhaps I should change them to use the common values and create new enum values where necessary?
- the sc/qa/ and sq/qa/ and starmath/qa/ code was doing some dodgy stuff. I translated the code to pass down the stuff
numeric values to the underlying code, but perhaps further fixing is necessary?
Change-Id: Ic06d723e404481e3f1bca67c43b70321b764d923
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qa/cppunit/graphicfilter/filters-test.cxx | 4 | ||||
-rw-r--r-- | vcl/source/app/unohelp2.cxx | 10 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 6 | ||||
-rw-r--r-- | vcl/source/edit/textview.cxx | 18 |
4 files changed, 19 insertions, 19 deletions
diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx index 128010854289..ae7a205e09bc 100644 --- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx +++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx @@ -32,7 +32,7 @@ public: virtual bool load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) SAL_OVERRIDE; + unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE; void checkExportImport(const OUString& aFilterShortName); @@ -53,7 +53,7 @@ public: bool VclFiltersTest::load(const OUString &, const OUString &rURL, const OUString &, - unsigned int, unsigned int, unsigned int) + unsigned int, SotClipboardFormatId, unsigned int) { SvFileStream aFileStream(rURL, StreamMode::READ); Graphic aGraphic; diff --git a/vcl/source/app/unohelp2.cxx b/vcl/source/app/unohelp2.cxx index ff34ed41621b..2f2e3d66124f 100644 --- a/vcl/source/app/unohelp2.cxx +++ b/vcl/source/app/unohelp2.cxx @@ -74,8 +74,8 @@ namespace vcl { namespace unohelper { { uno::Any aAny; - sal_uLong nT = SotExchange::GetFormat( rFlavor ); - if ( nT == SOT_FORMAT_STRING ) + SotClipboardFormatId nT = SotExchange::GetFormat( rFlavor ); + if ( nT == SotClipboardFormatId::STRING ) { aAny <<= GetString(); } @@ -89,14 +89,14 @@ namespace vcl { namespace unohelper { uno::Sequence< datatransfer::DataFlavor > TextDataObject::getTransferDataFlavors( ) throw(uno::RuntimeException, std::exception) { uno::Sequence< datatransfer::DataFlavor > aDataFlavors(1); - SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aDataFlavors.getArray()[0] ); + SotExchange::GetFormatDataFlavor( SotClipboardFormatId::STRING, aDataFlavors.getArray()[0] ); return aDataFlavors; } sal_Bool TextDataObject::isDataFlavorSupported( const datatransfer::DataFlavor& rFlavor ) throw(uno::RuntimeException, std::exception) { - sal_uLong nT = SotExchange::GetFormat( rFlavor ); - return ( nT == SOT_FORMAT_STRING ); + SotClipboardFormatId nT = SotExchange::GetFormat( rFlavor ); + return ( nT == SotClipboardFormatId::STRING ); } }} // namespace vcl::unohelper diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 1bd807c777d9..fb6dde7d307d 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -1300,7 +1300,7 @@ void Edit::ImplPaste( uno::Reference< datatransfer::clipboard::XClipboard >& rxC if ( xDataObj.is() ) { datatransfer::DataFlavor aFlavor; - SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aFlavor ); + SotExchange::GetFormatDataFlavor( SotClipboardFormatId::STRING, aFlavor ); try { uno::Any aData = xDataObj->getTransferData( aFlavor ); @@ -1991,7 +1991,7 @@ void Edit::Command( const CommandEvent& rCEvt ) if ( xDataObj.is() ) { datatransfer::DataFlavor aFlavor; - SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aFlavor ); + SotExchange::GetFormatDataFlavor( SotClipboardFormatId::STRING, aFlavor ); bData = xDataObj->isDataFlavorSupported( aFlavor ); } } @@ -2933,7 +2933,7 @@ void Edit::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& if ( xDataObj.is() ) { datatransfer::DataFlavor aFlavor; - SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aFlavor ); + SotExchange::GetFormatDataFlavor( SotClipboardFormatId::STRING, aFlavor ); if ( xDataObj->isDataFlavorSupported( aFlavor ) ) { uno::Any aData = xDataObj->getTransferData( aFlavor ); diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index 0aa78887278e..5fc04a71313a 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -104,12 +104,12 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla { uno::Any aAny; - sal_uLong nT = SotExchange::GetFormat( rFlavor ); - if ( nT == SOT_FORMAT_STRING ) + SotClipboardFormatId nT = SotExchange::GetFormat( rFlavor ); + if ( nT == SotClipboardFormatId::STRING ) { aAny <<= GetText(); } - else if ( nT == SOT_FORMATSTR_ID_HTML ) + else if ( nT == SotClipboardFormatId::HTML ) { GetHTMLStream().Seek( STREAM_SEEK_TO_END ); sal_uLong nLen = GetHTMLStream().Tell(); @@ -131,16 +131,16 @@ uno::Sequence< datatransfer::DataFlavor > TETextDataObject::getTransferDataFlavo GetHTMLStream().Seek( STREAM_SEEK_TO_END ); bool bHTML = GetHTMLStream().Tell() > 0; uno::Sequence< datatransfer::DataFlavor > aDataFlavors( bHTML ? 2 : 1 ); - SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aDataFlavors.getArray()[0] ); + SotExchange::GetFormatDataFlavor( SotClipboardFormatId::STRING, aDataFlavors.getArray()[0] ); if ( bHTML ) - SotExchange::GetFormatDataFlavor( SOT_FORMATSTR_ID_HTML, aDataFlavors.getArray()[1] ); + SotExchange::GetFormatDataFlavor( SotClipboardFormatId::HTML, aDataFlavors.getArray()[1] ); return aDataFlavors; } sal_Bool TETextDataObject::isDataFlavorSupported( const datatransfer::DataFlavor& rFlavor ) throw(uno::RuntimeException, std::exception) { - sal_uLong nT = SotExchange::GetFormat( rFlavor ); - return ( nT == SOT_FORMAT_STRING ); + SotClipboardFormatId nT = SotExchange::GetFormat( rFlavor ); + return ( nT == SotClipboardFormatId::STRING ); } struct ImpTextView @@ -1179,7 +1179,7 @@ void TextView::Paste( uno::Reference< datatransfer::clipboard::XClipboard >& rxC if ( xDataObj.is() ) { datatransfer::DataFlavor aFlavor; - SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aFlavor ); + SotExchange::GetFormatDataFlavor( SotClipboardFormatId::STRING, aFlavor ); if ( xDataObj->isDataFlavorSupported( aFlavor ) ) { try @@ -2062,7 +2062,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv if ( xDataObj.is() ) { datatransfer::DataFlavor aFlavor; - SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aFlavor ); + SotExchange::GetFormatDataFlavor( SotClipboardFormatId::STRING, aFlavor ); if ( xDataObj->isDataFlavorSupported( aFlavor ) ) { uno::Any aData = xDataObj->getTransferData( aFlavor ); |