summaryrefslogtreecommitdiff
path: root/starmath
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 /starmath
parentb8ce52aab9459773544f1696cfe6b7b6f171a389 (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 'starmath')
-rw-r--r--starmath/inc/document.hxx2
-rw-r--r--starmath/qa/extras/mmlimport-test.cxx2
-rw-r--r--starmath/source/document.cxx6
-rw-r--r--starmath/source/mathtype.cxx2
-rw-r--r--starmath/source/view.cxx18
5 files changed, 15 insertions, 15 deletions
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index 19012e1204d1..0976c863fbc4 100644
--- a/starmath/inc/document.hxx
+++ b/starmath/inc/document.hxx
@@ -117,7 +117,7 @@ class SM_DLLPUBLIC SmDocShell : public SfxObjectShell, public SfxListener
sal_uInt16 nAspect = ASPECT_CONTENT) SAL_OVERRIDE;
virtual void FillClass(SvGlobalName* pClassName,
- sal_uInt32* pFormat,
+ SotClipboardFormatId* pFormat,
OUString* pAppName,
OUString* pFullTypeName,
OUString* pShortTypeName,
diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx
index adf80aabf7b2..293d94d4e5cf 100644
--- a/starmath/qa/extras/mmlimport-test.cxx
+++ b/starmath/qa/extras/mmlimport-test.cxx
@@ -45,7 +45,7 @@ private:
SfxFilter* pFilter = new SfxFilter(MATHML_XML,
OUString(),
SFX_FILTER_IMPORT | SFX_FILTER_EXPORT | SFX_FILTER_TEMPLATE,
- SFX_FILTER_IMPORT | SFX_FILTER_USESOPTIONS,
+ SotClipboardFormatId::STARCALC_8,
"MathML 1.01",
0,
OUString(),
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index e958b43f8e92..e61da8fa5356 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -1308,7 +1308,7 @@ void SmDocShell::SetVisArea(const Rectangle & rVisArea)
void SmDocShell::FillClass(SvGlobalName* pClassName,
- sal_uInt32* pFormat,
+ SotClipboardFormatId* pFormat,
OUString* /*pAppName*/,
OUString* pFullTypeName,
OUString* pShortTypeName,
@@ -1318,14 +1318,14 @@ void SmDocShell::FillClass(SvGlobalName* pClassName,
if (nFileFormat == SOFFICE_FILEFORMAT_60 )
{
*pClassName = SvGlobalName(SO3_SM_CLASSID_60);
- *pFormat = SOT_FORMATSTR_ID_STARMATH_60;
+ *pFormat = SotClipboardFormatId::STARMATH_60;
*pFullTypeName = SM_RESSTR(STR_MATH_DOCUMENT_FULLTYPE_CURRENT);
*pShortTypeName = SM_RESSTR(RID_DOCUMENTSTR);
}
else if (nFileFormat == SOFFICE_FILEFORMAT_8 )
{
*pClassName = SvGlobalName(SO3_SM_CLASSID_60);
- *pFormat = bTemplate ? SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE : SOT_FORMATSTR_ID_STARMATH_8;
+ *pFormat = bTemplate ? SotClipboardFormatId::STARMATH_8_TEMPLATE : SotClipboardFormatId::STARMATH_8;
*pFullTypeName = SM_RESSTR(STR_MATH_DOCUMENT_FULLTYPE_CURRENT);
*pShortTypeName = SM_RESSTR(RID_DOCUMENTSTR);
}
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index 875019098970..2d24750181cd 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -1889,7 +1889,7 @@ int MathType::ConvertFromStarMath( SfxMedium& rMedium )
SvGlobalName aGName(0x0002ce02L, 0x0000, 0x0000,0xc0,0x00,
0x00,0x00,0x00,0x00,0x00,0x46 );
- pStor->SetClass( aGName, 0, OUString("Microsoft Equation 3.0"));
+ pStor->SetClass( aGName, SotClipboardFormatId::NONE, OUString("Microsoft Equation 3.0"));
static sal_uInt8 const aCompObj[] = {
0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 6b1f2cf56b57..f0c497fd5bf3 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1554,11 +1554,11 @@ void SmViewShell::Execute(SfxRequest& rReq)
{
TransferableDataHelper aData( TransferableDataHelper::CreateFromSystemClipboard(GetEditWindow()) );
uno::Reference < io::XInputStream > xStrm;
- SotFormatStringId nId;
+ SotClipboardFormatId nId;
if( aData.GetTransferable().is() &&
- ( aData.HasFormat( nId = SOT_FORMATSTR_ID_EMBEDDED_OBJ ) ||
- (aData.HasFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ) &&
- aData.HasFormat( nId = SOT_FORMATSTR_ID_EMBED_SOURCE ))))
+ ( aData.HasFormat( nId = SotClipboardFormatId::EMBEDDED_OBJ ) ||
+ (aData.HasFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ) &&
+ aData.HasFormat( nId = SotClipboardFormatId::EMBED_SOURCE ))))
xStrm = aData.GetInputStream(nId, OUString());
if (xStrm.is())
@@ -1610,7 +1610,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
GetEditWindow()) );
if( aDataHelper.GetTransferable().is() &&
- aDataHelper.HasFormat( FORMAT_STRING ))
+ aDataHelper.HasFormat( SotClipboardFormatId::STRING ))
pWin->Paste();
else
bCallExec = true;
@@ -1861,10 +1861,10 @@ void SmViewShell::GetState(SfxItemSet &rSet)
pEditWin) );
bPasteState = aDataHelper.GetTransferable().is() &&
- ( aDataHelper.HasFormat( FORMAT_STRING ) ||
- aDataHelper.HasFormat( SOT_FORMATSTR_ID_EMBEDDED_OBJ ) ||
- (aDataHelper.HasFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR )
- && aDataHelper.HasFormat( SOT_FORMATSTR_ID_EMBED_SOURCE )));
+ ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) ||
+ aDataHelper.HasFormat( SotClipboardFormatId::EMBEDDED_OBJ ) ||
+ (aDataHelper.HasFormat( SotClipboardFormatId::OBJECTDESCRIPTOR )
+ && aDataHelper.HasFormat( SotClipboardFormatId::EMBED_SOURCE )));
}
if( !bPasteState )
rSet.DisableItem( nWh );