summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-09-06 22:04:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-09-07 11:42:04 +0200
commit87d03edf08cda2f9f6a9d4ef9e5b7fe71964c71f (patch)
treef24aaab1db63564a7b3a4eb1f27c9efc39aade94 /dbaccess
parent8fe31ee550bd6f127b4c1ea335ef8177ccafa747 (diff)
convert ElementOpenMode to scoped enum
Change-Id: Ib1b714c377ce0d4935ba5ead68163d69fa091cfd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139545 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/app/AppController.cxx24
-rw-r--r--dbaccess/source/ui/app/AppControllerGen.cxx8
-rw-r--r--dbaccess/source/ui/app/subcomponentmanager.cxx2
-rw-r--r--dbaccess/source/ui/inc/AppElementType.hxx8
-rw-r--r--dbaccess/source/ui/misc/linkeddocuments.cxx6
5 files changed, 24 insertions, 24 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 52106a2fd099..2e30cf1fce38 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -1211,7 +1211,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
const Reference< XDataSource > xDataSource( m_xDataSource, UNO_QUERY );
const Reference< XComponent > xComponent = aDesigner.createNew( xDataSource, aCreationArgs );
- onDocumentOpened( OUString(), E_QUERY, E_OPEN_DESIGN, xComponent, nullptr );
+ onDocumentOpened( OUString(), E_QUERY, ElementOpenMode::Design, xComponent, nullptr );
}
}
break;
@@ -1235,17 +1235,17 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
case SID_DB_APP_QUERY_EDIT:
case SID_DB_APP_FORM_EDIT:
case SID_DB_APP_REPORT_EDIT:
- doAction( _nId, E_OPEN_DESIGN );
+ doAction( _nId, ElementOpenMode::Design );
break;
case SID_DB_APP_OPEN:
case SID_DB_APP_TABLE_OPEN:
case SID_DB_APP_QUERY_OPEN:
case SID_DB_APP_FORM_OPEN:
case SID_DB_APP_REPORT_OPEN:
- doAction( _nId, E_OPEN_NORMAL );
+ doAction( _nId, ElementOpenMode::Normal );
break;
case SID_DB_APP_CONVERTTOVIEW:
- doAction( _nId, E_OPEN_NORMAL );
+ doAction( _nId, ElementOpenMode::Normal );
break;
case SID_SELECTALL:
getContainer()->selectAll();
@@ -1254,7 +1254,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
case SID_DB_APP_DSRELDESIGN:
{
Reference< XComponent > xRelationDesigner;
- if ( !m_pSubComponentManager->activateSubFrame( OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN, xRelationDesigner ) )
+ if ( !m_pSubComponentManager->activateSubFrame( OUString(), SID_DB_APP_DSRELDESIGN, ElementOpenMode::Design, xRelationDesigner ) )
{
SharedConnection xConnection( ensureConnection() );
if ( xConnection.is() )
@@ -1263,7 +1263,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
const Reference< XDataSource > xDataSource( m_xDataSource, UNO_QUERY );
const Reference< XComponent > xComponent = aDesigner.createNew( xDataSource );
- onDocumentOpened( OUString(), SID_DB_APP_DSRELDESIGN, E_OPEN_DESIGN, xComponent, nullptr );
+ onDocumentOpened( OUString(), SID_DB_APP_DSRELDESIGN, ElementOpenMode::Design, xComponent, nullptr );
}
}
}
@@ -1336,7 +1336,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
}
break;
case SID_DB_APP_SENDREPORTASMAIL:
- doAction( _nId, E_OPEN_FOR_MAIL );
+ doAction( _nId, ElementOpenMode::Mail );
break;
}
}
@@ -1701,7 +1701,7 @@ bool OApplicationController::onEntryDoubleClick(const weld::TreeView& rTreeView)
openElementWithArguments(
getContainer()->getQualifiedName(xHdlEntry.get()),
getContainer()->getElementType(),
- E_OPEN_NORMAL,
+ ElementOpenMode::Normal,
0,
::comphelper::NamedValueCollection() );
return true; // handled
@@ -1747,7 +1747,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const
return nullptr;
Reference< XComponent > xRet;
- if ( _eOpenMode == E_OPEN_DESIGN )
+ if ( _eOpenMode == ElementOpenMode::Design )
{
// https://bz.apache.org/ooo/show_bug.cgi?id=30382
getContainer()->showPreview(nullptr);
@@ -1757,7 +1757,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const
switch ( _eType )
{
case E_REPORT:
- if ( _eOpenMode != E_OPEN_DESIGN )
+ if ( _eOpenMode != ElementOpenMode::Design )
{
// reports which are opened in a mode other than design are no sub components of our application
// component, but standalone documents.
@@ -1794,7 +1794,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const
::comphelper::NamedValueCollection aArguments( _rAdditionalArguments );
Any aDataSource;
- if ( _eOpenMode == E_OPEN_DESIGN )
+ if ( _eOpenMode == ElementOpenMode::Design )
{
bool bAddViewTypeArg = false;
@@ -1954,7 +1954,7 @@ Reference< XComponent > OApplicationController::newElement( ElementType _eType,
}
if ( xComponent.is() )
- onDocumentOpened( OUString(), _eType, E_OPEN_DESIGN, xComponent, o_rDocumentDefinition );
+ onDocumentOpened( OUString(), _eType, ElementOpenMode::Design, xComponent, o_rDocumentDefinition );
return xComponent;
}
diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx
index e9ba046d1655..b14b9c891540 100644
--- a/dbaccess/source/ui/app/AppControllerGen.cxx
+++ b/dbaccess/source/ui/app/AppControllerGen.cxx
@@ -433,7 +433,7 @@ Reference< XComponent > SAL_CALL OApplicationController::loadComponentWithArgume
Reference< XComponent > xComponent( openElementWithArguments(
ObjectName,
lcl_objectType2ElementType( ObjectType ),
- ForEditing ? E_OPEN_DESIGN : E_OPEN_NORMAL,
+ ForEditing ? ElementOpenMode::Design : ElementOpenMode::Normal,
ForEditing ? SID_DB_APP_EDIT : SID_DB_APP_OPEN,
::comphelper::NamedValueCollection( Arguments )
) );
@@ -667,10 +667,10 @@ void OApplicationController::doAction(sal_uInt16 _nId, const ElementOpenMode _eO
ElementType eType = getContainer()->getElementType();
::comphelper::NamedValueCollection aArguments;
ElementOpenMode eOpenMode = _eOpenMode;
- if ( eType == E_REPORT && E_OPEN_FOR_MAIL == _eOpenMode )
+ if ( eType == E_REPORT && ElementOpenMode::Mail == _eOpenMode )
{
aArguments.put("Hidden",true);
- eOpenMode = E_OPEN_NORMAL;
+ eOpenMode = ElementOpenMode::Normal;
}
std::vector< std::pair< OUString ,Reference< XModel > > > aComponents;
@@ -686,7 +686,7 @@ void OApplicationController::doAction(sal_uInt16 _nId, const ElementOpenMode _eO
}
// special handling for mail, if more than one document is selected attach them all
- if ( _eOpenMode != E_OPEN_FOR_MAIL )
+ if ( _eOpenMode != ElementOpenMode::Mail )
return;
diff --git a/dbaccess/source/ui/app/subcomponentmanager.cxx b/dbaccess/source/ui/app/subcomponentmanager.cxx
index d8de89b56773..712996e093be 100644
--- a/dbaccess/source/ui/app/subcomponentmanager.cxx
+++ b/dbaccess/source/ui/app/subcomponentmanager.cxx
@@ -90,7 +90,7 @@ namespace dbaui
SubComponentDescriptor()
:nComponentType( -1 )
- ,eOpenMode( E_OPEN_NORMAL )
+ ,eOpenMode( ElementOpenMode::Normal )
{
}
diff --git a/dbaccess/source/ui/inc/AppElementType.hxx b/dbaccess/source/ui/inc/AppElementType.hxx
index 59105cf225f7..a8e106933e3a 100644
--- a/dbaccess/source/ui/inc/AppElementType.hxx
+++ b/dbaccess/source/ui/inc/AppElementType.hxx
@@ -41,11 +41,11 @@ namespace dbaui
E_DOCUMENTINFO = 2
};
- enum ElementOpenMode
+ enum class ElementOpenMode
{
- E_OPEN_NORMAL,
- E_OPEN_DESIGN,
- E_OPEN_FOR_MAIL
+ Normal,
+ Design,
+ Mail
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx
index fc20da667019..a08f90cc3425 100644
--- a/dbaccess/source/ui/misc/linkeddocuments.cxx
+++ b/dbaccess/source/ui/misc/linkeddocuments.cxx
@@ -118,15 +118,15 @@ namespace dbaui
OUString sOpenMode;
switch ( _eOpenMode )
{
- case E_OPEN_NORMAL:
+ case ElementOpenMode::Normal:
sOpenMode = "open";
break;
- case E_OPEN_FOR_MAIL:
+ case ElementOpenMode::Mail:
aArguments.put( "Hidden", true );
[[fallthrough]];
- case E_OPEN_DESIGN:
+ case ElementOpenMode::Design:
sOpenMode = "openDesign";
break;