summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-03-23 14:23:01 +0200
committerNoel Grandin <noel@peralex.com>2015-03-24 09:36:57 +0200
commit23e0b0ba4b67a402a89b3752ae5aede1c5249cc8 (patch)
tree2046f70f5d2f47141267d47c192998228e8d41c2 /sw/source
parentffcfcd76d12a54e8a65a2b8d0ba7432d4c57f6ea (diff)
convert sfxlink to enum class
Change-Id: I4466af8d40e7860b20a26c5ccf2265ee40c5a9ab
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/docnode/section.cxx4
-rw-r--r--sw/source/core/fields/ddefld.cxx12
-rw-r--r--sw/source/core/graphic/ndgrf.cxx2
-rw-r--r--sw/source/core/ole/ndole.cxx2
-rw-r--r--sw/source/core/unocore/unofield.cxx3
-rw-r--r--sw/source/core/unocore/unosect.cxx11
-rw-r--r--sw/source/filter/xml/xmltble.cxx2
-rw-r--r--sw/source/filter/xml/xmltbli.cxx7
-rw-r--r--sw/source/ui/fldui/fldvar.cxx6
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx4
-rw-r--r--sw/source/uibase/fldui/fldmgr.cxx6
11 files changed, 28 insertions, 31 deletions
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 14a2beee10ae..f9d708c5da10 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -72,7 +72,7 @@ class SwIntrnlSectRefLink : public SwBaseLink
{
SwSectionFmt& rSectFmt;
public:
- SwIntrnlSectRefLink( SwSectionFmt& rFmt, sal_uInt16 nUpdateType, SotClipboardFormatId nFmt )
+ SwIntrnlSectRefLink( SwSectionFmt& rFmt, SfxLinkUpdateMode nUpdateType, SotClipboardFormatId nFmt )
: SwBaseLink( nUpdateType, nFmt ),
rSectFmt( rFmt )
{}
@@ -1506,7 +1506,7 @@ void SwSection::CreateLink( LinkCreateType eCreateType )
if (!pFmt || (CONTENT_SECTION == m_Data.GetType()))
return ;
- sal_uInt16 nUpdateType = sfx2::LINKUPDATE_ALWAYS;
+ SfxLinkUpdateMode nUpdateType = SfxLinkUpdateMode::ALWAYS;
if (!m_RefLink.Is())
{
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index d43a2b352e5d..9a2e0b315618 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -43,7 +43,7 @@ class SwIntrnlRefLink : public SwBaseLink
{
SwDDEFieldType& rFldType;
public:
- SwIntrnlRefLink( SwDDEFieldType& rType, sal_uInt16 nUpdateType, SotClipboardFormatId nFmt )
+ SwIntrnlRefLink( SwDDEFieldType& rType, SfxLinkUpdateMode nUpdateType, SotClipboardFormatId nFmt )
: SwBaseLink( nUpdateType, nFmt ),
rFldType( rType )
{}
@@ -228,7 +228,7 @@ bool SwIntrnlRefLink::IsInRange( sal_uLong nSttNd, sal_uLong nEndNd,
}
SwDDEFieldType::SwDDEFieldType(const OUString& rName,
- const OUString& rCmd, sal_uInt16 nUpdateType )
+ const OUString& rCmd, SfxLinkUpdateMode nUpdateType )
: SwFieldType( RES_DDEFLD ),
aName( rName ), pDoc( 0 ), nRefCnt( 0 )
{
@@ -319,7 +319,7 @@ bool SwDDEFieldType::QueryValue( uno::Any& rVal, sal_uInt16 nWhichId ) const
case FIELD_PROP_PAR4: nPart = 1; break;
case FIELD_PROP_SUBTYPE: nPart = 0; break;
case FIELD_PROP_BOOL1:
- rVal <<= GetType() == sfx2::LINKUPDATE_ALWAYS;
+ rVal <<= GetType() == SfxLinkUpdateMode::ALWAYS;
break;
case FIELD_PROP_PAR5:
rVal <<= aExpansion;
@@ -341,9 +341,9 @@ bool SwDDEFieldType::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
case FIELD_PROP_PAR4: nPart = 1; break;
case FIELD_PROP_SUBTYPE: nPart = 0; break;
case FIELD_PROP_BOOL1:
- SetType( static_cast<sal_uInt16>(*(sal_Bool*)rVal.getValue() ?
- sfx2::LINKUPDATE_ALWAYS :
- sfx2::LINKUPDATE_ONCALL ) );
+ SetType( *(sal_Bool*)rVal.getValue() ?
+ SfxLinkUpdateMode::ALWAYS :
+ SfxLinkUpdateMode::ONCALL );
break;
case FIELD_PROP_PAR5:
rVal >>= aExpansion;
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 19f27a4f86a5..1693add78fc7 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -697,7 +697,7 @@ bool SwGrfNode::RestorePersistentData()
void SwGrfNode::InsertLink( const OUString& rGrfName, const OUString& rFltName )
{
- refLink = new SwBaseLink( sfx2::LINKUPDATE_ONCALL, SotClipboardFormatId::GDIMETAFILE, this );
+ refLink = new SwBaseLink( SfxLinkUpdateMode::ONCALL, SotClipboardFormatId::GDIMETAFILE, this );
IDocumentLinksAdministration* pIDLA = getIDocumentLinksAdministration();
if( GetNodes().IsDocNodes() )
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index b6898e549028..e5680be458f8 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -159,7 +159,7 @@ public:
};
SwEmbedObjectLink::SwEmbedObjectLink(SwOLENode* pNode):
- ::sfx2::SvBaseLink( ::sfx2::LINKUPDATE_ONCALL, SotClipboardFormatId::SVXB ),
+ ::sfx2::SvBaseLink( ::SfxLinkUpdateMode::ONCALL, SotClipboardFormatId::SVXB ),
pOleNode(pNode)
{
SetSynchron( false );
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 92de98615fba..1d38d50779db 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -666,8 +666,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
case RES_DDEFLD :
{
SwDDEFieldType aType(sTypeName, m_pImpl->m_sParam1,
- sal::static_int_cast<sal_uInt16>((m_pImpl->m_bParam1)
- ? sfx2::LINKUPDATE_ALWAYS : sfx2::LINKUPDATE_ONCALL));
+ m_pImpl->m_bParam1 ? SfxLinkUpdateMode::ALWAYS : SfxLinkUpdateMode::ONCALL);
pType2 = m_pImpl->m_pDoc->getIDocumentFieldsAccess().InsertFldType(aType);
}
break;
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index 0eb5aa53fe50..a55cd809fd18 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -421,9 +421,8 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
{
pRet->CreateLink(CREATE_CONNECT);
}
- pRet->SetUpdateType( static_cast< sal_uInt16 >(
- (m_pImpl->m_pProps->m_bUpdateType) ?
- sfx2::LINKUPDATE_ALWAYS : sfx2::LINKUPDATE_ONCALL) );
+ pRet->SetUpdateType( m_pImpl->m_pProps->m_bUpdateType ?
+ SfxLinkUpdateMode::ALWAYS : SfxLinkUpdateMode::ONCALL );
}
// Undo-Klammerung hier beenden
@@ -506,8 +505,8 @@ lcl_UpdateLinkType(SwSection & rSection, bool const bLinkUpdateAlways = true)
{
rSection.CreateLink(CREATE_CONNECT);
}
- rSection.SetUpdateType( static_cast< sal_uInt16 >((bLinkUpdateAlways)
- ? sfx2::LINKUPDATE_ALWAYS : sfx2::LINKUPDATE_ONCALL) );
+ rSection.SetUpdateType( bLinkUpdateAlways
+ ? SfxLinkUpdateMode::ALWAYS : SfxLinkUpdateMode::ONCALL );
}
}
@@ -1010,7 +1009,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
if (pSect && pSect->IsLinkType() && pSect->IsConnected()) // #i73247#
{
const bool bTemp =
- (pSect->GetUpdateType() == sfx2::LINKUPDATE_ALWAYS);
+ (pSect->GetUpdateType() == SfxLinkUpdateMode::ALWAYS);
pRet[nProperty] <<= bTemp;
}
}
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index 27eb9c49534f..605a7c78ae90 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -1099,7 +1099,7 @@ void SwXMLExport::ExportTable( const SwTableNode& rTblNd )
sCmd.getToken(2, sfx2::cTokenSeparator) );
// auto update
- if (pDDEFldType->GetType() == sfx2::LINKUPDATE_ALWAYS)
+ if (pDDEFldType->GetType() == SfxLinkUpdateMode::ALWAYS)
{
AddAttribute( XML_NAMESPACE_OFFICE,
XML_AUTOMATIC_UPDATE, XML_TRUE );
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 0d27fb4bda8e..46b098be870c 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -1176,10 +1176,9 @@ static SwDDEFieldType* lcl_GetDDEFieldType(SwXMLDDETableContext_Impl* pContext,
+ OUString(sfx2::cTokenSeparator)
+ pContext->GetDDETopic());
- const sal_uInt16 nType = static_cast< sal_uInt16 >(
- pContext->GetIsAutomaticUpdate()
- ? sfx2::LINKUPDATE_ALWAYS
- : sfx2::LINKUPDATE_ONCALL);
+ const SfxLinkUpdateMode nType = pContext->GetIsAutomaticUpdate()
+ ? SfxLinkUpdateMode::ALWAYS
+ : SfxLinkUpdateMode::ONCALL;
OUString sName(pContext->GetConnectionName());
diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx
index e0b3dd614975..a72e4c99662e 100644
--- a/sw/source/ui/fldui/fldvar.cxx
+++ b/sw/source/ui/fldui/fldvar.cxx
@@ -451,7 +451,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
sCmd = sCmd.replaceFirst( OUString(sfx2::cTokenSeparator), " ", &nTmpPos );
m_pValueED->SetText( sCmd );
- m_pFormatLB->SelectEntryPos(pType->GetType());
+ m_pFormatLB->SelectEntryPos(static_cast<int>(pType->GetType()));
}
}
}
@@ -1023,7 +1023,7 @@ IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox )
sValue = sValue.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nTmpPos );
sValue = sValue.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nTmpPos );
static_cast<SwDDEFieldType*>(pType)->SetCmd(sValue);
- static_cast<SwDDEFieldType*>(pType)->SetType((sal_uInt16)nFormat);
+ static_cast<SwDDEFieldType*>(pType)->SetType(static_cast<SfxLinkUpdateMode>(nFormat));
}
}
pType->UpdateFlds();
@@ -1062,7 +1062,7 @@ IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox )
sValue = sValue.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nTmpPos );
sValue = sValue.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nTmpPos );
- SwDDEFieldType aType(sName, sValue, (sal_uInt16)nFormat);
+ SwDDEFieldType aType(sName, sValue, static_cast<SfxLinkUpdateMode>(nFormat));
m_pSelectionLB->InsertEntry(sName);
m_pSelectionLB->SelectEntry(sName);
GetFldMgr().InsertFldType(aType); // DDE-Field new
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 51f89520af34..a1d1ad7d49a1 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -2123,7 +2123,7 @@ bool SwTransferable::_PasteDDE( TransferableDataHelper& rData,
{
OUString sTmp( static_cast<SwDDEFieldType*>(pTyp)->GetCmd() );
if( rColl.isEqual( sTmp, aCmd ) &&
- sfx2::LINKUPDATE_ALWAYS == static_cast<SwDDEFieldType*>(pTyp)->GetType() )
+ SfxLinkUpdateMode::ALWAYS == static_cast<SwDDEFieldType*>(pTyp)->GetType() )
{
aName = pTyp->GetName();
bDoublePaste = true;
@@ -2145,7 +2145,7 @@ bool SwTransferable::_PasteDDE( TransferableDataHelper& rData,
if( !bDoublePaste )
{
- SwDDEFieldType aType( aName, aCmd, sfx2::LINKUPDATE_ALWAYS );
+ SwDDEFieldType aType( aName, aCmd, SfxLinkUpdateMode::ALWAYS );
pTyp = rWrtShell.InsertFldType( aType );
}
diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx
index cfbdeae88759..18483c6fb05a 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -701,8 +701,8 @@ sal_uInt16 SwFldMgr::GetFormatId(sal_uInt16 nTypeId, sal_uLong nFormatId) const
case TYP_DDEFLD:
switch ( aSwFlds[ GetPos( nTypeId ) ].nFmtBegin + nFormatId )
{
- case FMT_DDE_NORMAL: nId = sfx2::LINKUPDATE_ONCALL; break;
- case FMT_DDE_HOT: nId = sfx2::LINKUPDATE_ALWAYS; break;
+ case FMT_DDE_NORMAL: nId = static_cast<sal_uInt16>(SfxLinkUpdateMode::ONCALL); break;
+ case FMT_DDE_HOT: nId = static_cast<sal_uInt16>(SfxLinkUpdateMode::ALWAYS); break;
}
break;
}
@@ -958,7 +958,7 @@ bool SwFldMgr::InsertFld(
sCmd = sCmd.replaceFirst(OUString(' '), OUString(sfx2::cTokenSeparator), &nIndex);
}
- SwDDEFieldType aType( rData.sPar1, sCmd, (sal_uInt16) nFormatId );
+ SwDDEFieldType aType( rData.sPar1, sCmd, static_cast<SfxLinkUpdateMode>(nFormatId) );
SwDDEFieldType* pTyp = static_cast<SwDDEFieldType*>( pCurShell->InsertFldType( aType ) );
pFld = new SwDDEField( pTyp );
break;