summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/imap.hxx6
-rw-r--r--include/vcl/imapobj.hxx11
-rw-r--r--svx/source/dialog/imapdlg.cxx10
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx2
-rw-r--r--vcl/source/treelist/imap2.cxx26
5 files changed, 29 insertions, 26 deletions
diff --git a/include/vcl/imap.hxx b/include/vcl/imap.hxx
index 5cf03071b22a..02d8f2ddf96b 100644
--- a/include/vcl/imap.hxx
+++ b/include/vcl/imap.hxx
@@ -58,7 +58,7 @@ private:
static OUString ImpReadNCSAURL( const char** ppStr );
static Point ImpReadNCSACoords( const char** ppStr );
- static sal_uLong ImpDetectFormat( SvStream& rIStm );
+ static IMapFormat ImpDetectFormat( SvStream& rIStm );
public:
@@ -113,8 +113,8 @@ public:
void Write ( SvStream& rOStm ) const;
void Read( SvStream& rIStm );
- void Write( SvStream& rOStm, sal_uLong nFormat ) const;
- sal_uLong Read( SvStream& rIStm, sal_uLong nFormat );
+ void Write( SvStream& rOStm, IMapFormat nFormat ) const;
+ sal_uLong Read( SvStream& rIStm, IMapFormat nFormat );
};
class IMapCompat
diff --git a/include/vcl/imapobj.hxx b/include/vcl/imapobj.hxx
index 902b5f908cdf..982e350547e2 100644
--- a/include/vcl/imapobj.hxx
+++ b/include/vcl/imapobj.hxx
@@ -38,10 +38,13 @@ class SvStream;
#define IMAP_MIRROR_HORZ 0x00000001L
#define IMAP_MIRROR_VERT 0x00000002L
-#define IMAP_FORMAT_BIN 0x00000001L
-#define IMAP_FORMAT_CERN 0x00000002L
-#define IMAP_FORMAT_NCSA 0x00000004L
-#define IMAP_FORMAT_DETECT 0xffffffffL
+enum class IMapFormat
+{
+ Binary = 1,
+ CERN = 2,
+ NCSA = 3,
+ Detect = 15,
+};
#define IMAP_ERR_OK 0x00000000L
#define IMAP_ERR_FORMAT 0x00000001L
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index 8c01116825bd..0a16d670002c 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -383,7 +383,7 @@ void SvxIMapDlg::DoOpen()
if( pIStm )
{
- aLoadIMap.Read( *pIStm, IMAP_FORMAT_DETECT );
+ aLoadIMap.Read( *pIStm, IMapFormat::Detect );
if( pIStm->GetError() )
{
@@ -421,21 +421,21 @@ bool SvxIMapDlg::DoSave()
{
const OUString aFilter( aDlg.GetCurrentFilter() );
OUString aExt;
- sal_uLong nFormat;
+ IMapFormat nFormat;
if ( aFilter == aBinFilter )
{
- nFormat = IMAP_FORMAT_BIN;
+ nFormat = IMapFormat::Binary;
aExt = "sip";
}
else if ( aFilter == aCERNFilter )
{
- nFormat = IMAP_FORMAT_CERN;
+ nFormat = IMapFormat::CERN;
aExt = "map";
}
else if ( aFilter == aNCSAFilter )
{
- nFormat = IMAP_FORMAT_NCSA;
+ nFormat = IMapFormat::NCSA;
aExt = "map";
}
else
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 264f34c6d660..52c6b47d469f 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -2884,7 +2884,7 @@ bool SwTransferable::PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh,
if( pStream != nullptr &&
!pStream->GetError() &&
// mba: no BaseURL for clipboard functionality
- aMap.Read( *pStream, IMAP_FORMAT_DETECT ) == IMAP_ERR_OK &&
+ aMap.Read( *pStream, IMapFormat::Detect ) == IMAP_ERR_OK &&
aMap.GetIMapObjectCount() )
{
SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} );
diff --git a/vcl/source/treelist/imap2.cxx b/vcl/source/treelist/imap2.cxx
index 382a76c04822..5f8e8bb22531 100644
--- a/vcl/source/treelist/imap2.cxx
+++ b/vcl/source/treelist/imap2.cxx
@@ -139,13 +139,13 @@ void IMapPolygonObject::WriteNCSA( SvStream& rOStm ) const
rOStm.WriteLine(aStrBuf.makeStringAndClear());
}
-void ImageMap::Write( SvStream& rOStm, sal_uLong nFormat ) const
+void ImageMap::Write( SvStream& rOStm, IMapFormat nFormat ) const
{
switch( nFormat )
{
- case IMAP_FORMAT_BIN : Write( rOStm ); break;
- case IMAP_FORMAT_CERN : ImpWriteCERN( rOStm ); break;
- case IMAP_FORMAT_NCSA : ImpWriteNCSA( rOStm ); break;
+ case IMapFormat::Binary : Write( rOStm ); break;
+ case IMapFormat::CERN : ImpWriteCERN( rOStm ); break;
+ case IMapFormat::NCSA : ImpWriteNCSA( rOStm ); break;
default:
break;
@@ -208,18 +208,18 @@ void ImageMap::ImpWriteNCSA( SvStream& rOStm ) const
}
}
-sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat )
+sal_uLong ImageMap::Read( SvStream& rIStm, IMapFormat nFormat )
{
sal_uLong nRet = IMAP_ERR_FORMAT;
- if ( nFormat == IMAP_FORMAT_DETECT )
+ if ( nFormat == IMapFormat::Detect )
nFormat = ImpDetectFormat( rIStm );
switch ( nFormat )
{
- case IMAP_FORMAT_BIN : Read( rIStm ); break;
- case IMAP_FORMAT_CERN : ImpReadCERN( rIStm ); break;
- case IMAP_FORMAT_NCSA : ImpReadNCSA( rIStm ); break;
+ case IMapFormat::Binary : Read( rIStm ); break;
+ case IMapFormat::CERN : ImpReadCERN( rIStm ); break;
+ case IMapFormat::NCSA : ImpReadNCSA( rIStm ); break;
default:
break;
@@ -486,10 +486,10 @@ Point ImageMap::ImpReadNCSACoords( const char** ppStr )
return aPt;
}
-sal_uLong ImageMap::ImpDetectFormat( SvStream& rIStm )
+IMapFormat ImageMap::ImpDetectFormat( SvStream& rIStm )
{
sal_uInt64 nPos = rIStm.Tell();
- sal_uLong nRet = IMAP_FORMAT_BIN;
+ IMapFormat nRet = IMapFormat::Binary;
char cMagic[6];
rIStm.ReadBytes(cMagic, sizeof(cMagic));
@@ -513,10 +513,10 @@ sal_uLong ImageMap::ImpDetectFormat( SvStream& rIStm )
if ( ( aStr.indexOf('(') != -1 ) &&
( aStr.indexOf(')') != -1 ) )
{
- nRet = IMAP_FORMAT_CERN;
+ nRet = IMapFormat::CERN;
}
else
- nRet = IMAP_FORMAT_NCSA;
+ nRet = IMapFormat::NCSA;
break;
}