summaryrefslogtreecommitdiffstats
path: root/sc/source/ui/view/editsh.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-03-12 14:53:28 +0200
committerNoel Grandin <noel@peralex.com>2015-03-18 14:23:50 +0200
commitfb14be5f8f74f83ba89e15f891ddf1f753dcc62f (patch)
treebeaa4af08b0c3d75bf6e40b21b96c55e0ac1c60a /sc/source/ui/view/editsh.cxx
parentconvert AccessibleStates to enum class (diff)
downloadcore-fb14be5f8f74f83ba89e15f891ddf1f753dcc62f.tar.gz
core-fb14be5f8f74f83ba89e15f891ddf1f753dcc62f.zip
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 'sc/source/ui/view/editsh.cxx')
-rw-r--r--sc/source/ui/view/editsh.cxx30
1 files changed, 15 insertions, 15 deletions
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index cb4c17a14fe1..bceac51de6a2 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -247,18 +247,18 @@ void ScEditShell::Execute( SfxRequest& rReq )
case SID_CLIPBOARD_FORMAT_ITEMS:
{
- sal_uLong nFormat = 0;
+ SotClipboardFormatId nFormat = SotClipboardFormatId::NONE;
const SfxPoolItem* pItem;
if ( pReqArgs &&
pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET &&
pItem->ISA(SfxUInt32Item) )
{
- nFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
+ nFormat = static_cast<SotClipboardFormatId>(static_cast<const SfxUInt32Item*>(pItem)->GetValue());
}
- if ( nFormat )
+ if ( nFormat != SotClipboardFormatId::NONE )
{
- if (SOT_FORMAT_STRING == nFormat)
+ if (SotClipboardFormatId::STRING == nFormat)
pTableView->Paste();
else
pTableView->PasteSpecial();
@@ -273,11 +273,11 @@ void ScEditShell::Execute( SfxRequest& rReq )
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
boost::scoped_ptr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( pViewData->GetDialogParent() ));
- sal_uLong nFormat = 0;
+ SotClipboardFormatId nFormat = SotClipboardFormatId::NONE;
if ( pDlg )
{
- pDlg->Insert( SOT_FORMAT_STRING, EMPTY_OUSTRING );
- pDlg->Insert( SOT_FORMAT_RTF, EMPTY_OUSTRING );
+ pDlg->Insert( SotClipboardFormatId::STRING, EMPTY_OUSTRING );
+ pDlg->Insert( SotClipboardFormatId::RTF, EMPTY_OUSTRING );
TransferableDataHelper aDataHelper(
TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) );
@@ -290,9 +290,9 @@ void ScEditShell::Execute( SfxRequest& rReq )
if (!SC_MOD()->IsInputMode())
return;
- if (nFormat > 0)
+ if (nFormat != SotClipboardFormatId::NONE)
{
- if (SOT_FORMAT_STRING == nFormat)
+ if (SotClipboardFormatId::STRING == nFormat)
pTableView->Paste();
else
pTableView->PasteSpecial();
@@ -762,7 +762,7 @@ IMPL_LINK( ScEditShell, ClipboardChanged, TransferableDataHelper*, pDataHelper )
{
if ( pDataHelper )
{
- bPastePossible = ( pDataHelper->HasFormat( SOT_FORMAT_STRING ) || pDataHelper->HasFormat( SOT_FORMAT_RTF ) );
+ bPastePossible = ( pDataHelper->HasFormat( SotClipboardFormatId::STRING ) || pDataHelper->HasFormat( SotClipboardFormatId::RTF ) );
SfxBindings& rBindings = pViewData->GetBindings();
rBindings.Invalidate( SID_PASTE );
@@ -784,7 +784,7 @@ void ScEditShell::GetClipState( SfxItemSet& rSet )
// get initial state
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) );
- bPastePossible = ( aDataHelper.HasFormat( SOT_FORMAT_STRING ) || aDataHelper.HasFormat( SOT_FORMAT_RTF ) );
+ bPastePossible = ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) || aDataHelper.HasFormat( SotClipboardFormatId::RTF ) );
}
SfxWhichIter aIter( rSet );
@@ -805,10 +805,10 @@ void ScEditShell::GetClipState( SfxItemSet& rSet )
TransferableDataHelper aDataHelper(
TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) );
- if ( aDataHelper.HasFormat( SOT_FORMAT_STRING ) )
- aFormats.AddClipbrdFormat( SOT_FORMAT_STRING );
- if ( aDataHelper.HasFormat( SOT_FORMAT_RTF ) )
- aFormats.AddClipbrdFormat( SOT_FORMAT_RTF );
+ if ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) )
+ aFormats.AddClipbrdFormat( SotClipboardFormatId::STRING );
+ if ( aDataHelper.HasFormat( SotClipboardFormatId::RTF ) )
+ aFormats.AddClipbrdFormat( SotClipboardFormatId::RTF );
rSet.Put( aFormats );
}