summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-04-10 14:28:43 +0200
committerNoel Grandin <noel@peralex.com>2015-04-13 09:34:53 +0200
commit5651f2d9f64c213b4106e2d5a433f4c525d41bbf (patch)
tree2b82422a0d7299fac8261f57527dad3ee3d99883
parentccfa9fa13db230cc66207bc42d528b773c4cf4f6 (diff)
convert HIDDENINFORMATION_ constants into scoped enum
Change-Id: I94136c926fc8fa69ce2ce2b97fa34dc984dbe095
-rw-r--r--include/sfx2/objsh.hxx16
-rw-r--r--sc/source/ui/docshell/docsh.cxx14
-rw-r--r--sc/source/ui/inc/docsh.hxx2
-rw-r--r--sfx2/source/doc/objstor.cxx20
-rw-r--r--sw/inc/docsh.hxx2
-rw-r--r--sw/source/uibase/app/docsh.cxx14
6 files changed, 38 insertions, 30 deletions
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 40a18f435796..3da1ad309888 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -147,9 +147,17 @@ namespace o3tl
template<> struct typed_flags<SfxLoadedFlags> : is_typed_flags<SfxLoadedFlags, 0x03> {};
}
-#define HIDDENINFORMATION_RECORDEDCHANGES 0x0001
-#define HIDDENINFORMATION_NOTES 0x0002
-#define HIDDENINFORMATION_DOCUMENTVERSIONS 0x0004
+enum class HiddenInformation
+{
+ NONE = 0x0000,
+ RECORDEDCHANGES = 0x0001,
+ NOTES = 0x0002,
+ DOCUMENTVERSIONS = 0x0004
+};
+namespace o3tl
+{
+ template<> struct typed_flags<HiddenInformation> : is_typed_flags<HiddenInformation, 0x07> {};
+}
enum HiddenWarningFact
{
@@ -419,7 +427,7 @@ public:
virtual bool PrepareClose(bool bUI = true);
virtual bool IsInformationLost();
- virtual sal_uInt16 GetHiddenInformationState( sal_uInt16 nStates );
+ virtual HiddenInformation GetHiddenInformationState( HiddenInformation nStates );
sal_Int16 QueryHiddenInformation( HiddenWarningFact eFact, vcl::Window* pParent );
bool IsSecurityOptOpenReadOnly() const;
void SetSecurityOptOpenReadOnly( bool bOpenReadOnly = true );
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 0ab97e119818..1261dab65c72 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -230,17 +230,17 @@ SCTAB ScDocShell::GetSaveTab()
return nTab;
}
-sal_uInt16 ScDocShell::GetHiddenInformationState( sal_uInt16 nStates )
+HiddenInformation ScDocShell::GetHiddenInformationState( HiddenInformation nStates )
{
- // get global state like HIDDENINFORMATION_DOCUMENTVERSIONS
- sal_uInt16 nState = SfxObjectShell::GetHiddenInformationState( nStates );
+ // get global state like HiddenInformation::DOCUMENTVERSIONS
+ HiddenInformation nState = SfxObjectShell::GetHiddenInformationState( nStates );
- if ( nStates & HIDDENINFORMATION_RECORDEDCHANGES )
+ if ( nStates & HiddenInformation::RECORDEDCHANGES )
{
if ( aDocument.GetChangeTrack() && aDocument.GetChangeTrack()->GetFirst() )
- nState |= HIDDENINFORMATION_RECORDEDCHANGES;
+ nState |= HiddenInformation::RECORDEDCHANGES;
}
- if ( nStates & HIDDENINFORMATION_NOTES )
+ if ( nStates & HiddenInformation::NOTES )
{
SCTAB nTableCount = aDocument.GetTableCount();
bool bFound = false;
@@ -251,7 +251,7 @@ sal_uInt16 ScDocShell::GetHiddenInformationState( sal_uInt16 nStates )
}
if (bFound)
- nState |= HIDDENINFORMATION_NOTES;
+ nState |= HiddenInformation::NOTES;
}
return nState;
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index e0576a598669..340508c1601c 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -413,7 +413,7 @@ public:
void BeforeXMLLoading();
void AfterXMLLoading(bool bRet);
- virtual sal_uInt16 GetHiddenInformationState( sal_uInt16 nStates ) SAL_OVERRIDE;
+ virtual HiddenInformation GetHiddenInformationState( HiddenInformation nStates ) SAL_OVERRIDE;
const ScOptSolverSave* GetSolverSaveData() const { return pSolverSaveData; } // may be null
void SetSolverSaveData( const ScOptSolverSave& rData );
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index cfd7bfc31297..062ac57746c5 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2939,13 +2939,13 @@ bool SfxObjectShell::CanReload_Impl()
-sal_uInt16 SfxObjectShell::GetHiddenInformationState( sal_uInt16 nStates )
+HiddenInformation SfxObjectShell::GetHiddenInformationState( HiddenInformation nStates )
{
- sal_uInt16 nState = 0;
- if ( nStates & HIDDENINFORMATION_DOCUMENTVERSIONS )
+ HiddenInformation nState = HiddenInformation::NONE;
+ if ( nStates & HiddenInformation::DOCUMENTVERSIONS )
{
if ( GetMedium()->GetVersionList().getLength() )
- nState |= HIDDENINFORMATION_DOCUMENTVERSIONS;
+ nState |= HiddenInformation::DOCUMENTVERSIONS;
}
return nState;
@@ -2990,25 +2990,25 @@ sal_Int16 SfxObjectShell::QueryHiddenInformation( HiddenWarningFact eFact, vcl::
if ( SvtSecurityOptions().IsOptionSet( eOption ) )
{
OUString sMessage( SfxResId(STR_HIDDENINFO_CONTAINS).toString() );
- sal_uInt16 nWantedStates = HIDDENINFORMATION_RECORDEDCHANGES | HIDDENINFORMATION_NOTES;
+ HiddenInformation nWantedStates = HiddenInformation::RECORDEDCHANGES | HiddenInformation::NOTES;
if ( eFact != WhenPrinting )
- nWantedStates |= HIDDENINFORMATION_DOCUMENTVERSIONS;
- sal_uInt16 nStates = GetHiddenInformationState( nWantedStates );
+ nWantedStates |= HiddenInformation::DOCUMENTVERSIONS;
+ HiddenInformation nStates = GetHiddenInformationState( nWantedStates );
bool bWarning = false;
- if ( ( nStates & HIDDENINFORMATION_RECORDEDCHANGES ) == HIDDENINFORMATION_RECORDEDCHANGES )
+ if ( nStates & HiddenInformation::RECORDEDCHANGES )
{
sMessage += SfxResId(STR_HIDDENINFO_RECORDCHANGES).toString();
sMessage += "\n";
bWarning = true;
}
- if ( ( nStates & HIDDENINFORMATION_NOTES ) == HIDDENINFORMATION_NOTES )
+ if ( nStates & HiddenInformation::NOTES )
{
sMessage += SfxResId(STR_HIDDENINFO_NOTES).toString();
sMessage += "\n";
bWarning = true;
}
- if ( ( nStates & HIDDENINFORMATION_DOCUMENTVERSIONS ) == HIDDENINFORMATION_DOCUMENTVERSIONS )
+ if ( nStates & HiddenInformation::DOCUMENTVERSIONS )
{
sMessage += SfxResId(STR_HIDDENINFO_DOCVERSIONS).toString();
sMessage += "\n";
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 9fbb8741ed32..fa2f5478e7b5 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -288,7 +288,7 @@ public:
virtual ::com::sun::star::uno::Sequence< OUString > GetEventNames() SAL_OVERRIDE;
/// #i20883# Digital Signatures and Encryption
- virtual sal_uInt16 GetHiddenInformationState( sal_uInt16 nStates ) SAL_OVERRIDE;
+ virtual HiddenInformation GetHiddenInformationState( HiddenInformation nStates ) SAL_OVERRIDE;
/** #i42634# Overwrites SfxObjectShell::UpdateLinks
This new function is necessary to trigger update of links in docs
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 4f755975de6e..71e825104479 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -878,17 +878,17 @@ sal_uLong SwDocShell::GetMiscStatus() const
}
// #i20883# Digital Signatures and Encryption
-sal_uInt16 SwDocShell::GetHiddenInformationState( sal_uInt16 nStates )
+HiddenInformation SwDocShell::GetHiddenInformationState( HiddenInformation nStates )
{
- // get global state like HIDDENINFORMATION_DOCUMENTVERSIONS
- sal_uInt16 nState = SfxObjectShell::GetHiddenInformationState( nStates );
+ // get global state like HiddenInformation::DOCUMENTVERSIONS
+ HiddenInformation nState = SfxObjectShell::GetHiddenInformationState( nStates );
- if ( nStates & HIDDENINFORMATION_RECORDEDCHANGES )
+ if ( nStates & HiddenInformation::RECORDEDCHANGES )
{
if ( !GetDoc()->getIDocumentRedlineAccess().GetRedlineTbl().empty() )
- nState |= HIDDENINFORMATION_RECORDEDCHANGES;
+ nState |= HiddenInformation::RECORDEDCHANGES;
}
- if ( nStates & HIDDENINFORMATION_NOTES )
+ if ( nStates & HiddenInformation::NOTES )
{
OSL_ENSURE( GetWrtShell(), "No SwWrtShell, no information" );
if ( GetWrtShell() )
@@ -900,7 +900,7 @@ sal_uInt16 SwDocShell::GetHiddenInformationState( sal_uInt16 nStates )
{
if( pFirst->GetTxtFld() && pFirst->IsFldInDoc() )
{
- nState |= HIDDENINFORMATION_NOTES;
+ nState |= HiddenInformation::NOTES;
break;
}
pFirst = aIter.Next();