use SAL_N_ELEMENTS in for loops
for with git grep -n 'for.*sizeof' Change-Id: I6211024385e03ac5eeeb38690d2c1c699e015c2f Reviewed-on: https://gerrit.libreoffice.org/23569 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
@@ -1564,7 +1564,7 @@ void ModulWindowLayout::SyntaxColors::NewConfig (bool bFirst)
|
||||
};
|
||||
|
||||
bool bChanged = false;
|
||||
for (unsigned i = 0; i != sizeof vIds / sizeof vIds[0]; ++i)
|
||||
for (unsigned i = 0; i != SAL_N_ELEMENTS(vIds); ++i)
|
||||
{
|
||||
Color const aColor = aConfig.GetColorValue(vIds[i].eEntry).nColor;
|
||||
Color& rMyColor = aColors[vIds[i].eTokenType];
|
||||
|
||||
@@ -330,7 +330,7 @@ OpenGLRender::OpenGLRender()
|
||||
, m_SymbolShapeID(0)
|
||||
{
|
||||
//TODO: moggi: use STL
|
||||
for (size_t i = 0; i < sizeof(m_BackgroundColor) / sizeof(float); i++)
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(m_BackgroundColor); i++)
|
||||
{
|
||||
m_BackgroundColor[i] = 1.0;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaDataBase::getTypeInfo( ) throw(SQ
|
||||
::connectivity::ODatabaseMetaDataResultSet::ORow aRow;
|
||||
aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
|
||||
const sal_Int32* pType = pTypes;
|
||||
for (sal_Int32 i = 1; i <= sal_Int32(sizeof(pTypes)/sizeof(pTypes[0])); ++i,++pType)
|
||||
for (sal_Int32 i = 1; i <= sal_Int32(SAL_N_ELEMENTS(pTypes)); ++i,++pType)
|
||||
{
|
||||
ORowSetValue aValue;
|
||||
aValue.fill(i,*pType,xRow);
|
||||
|
||||
@@ -446,7 +446,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTablePrivileges(
|
||||
for (sal_Int32 i = 1 ; i <= nCount ; ++i)
|
||||
{
|
||||
sColumnName = xMeta->getColumnName(i);
|
||||
for (sal_uInt32 j = 0 ; j < sizeof(sPrivs)/sizeof(sPrivs[0]); ++j)
|
||||
for (sal_uInt32 j = 0 ; j < SAL_N_ELEMENTS(sPrivs); ++j)
|
||||
{
|
||||
if ( sPrivs[j] == sColumnName )
|
||||
{
|
||||
|
||||
@@ -75,7 +75,7 @@ OColumnAlias::OColumnAlias( const ::com::sun::star::uno::Reference< ::com::sun::
|
||||
"Notes",
|
||||
};
|
||||
|
||||
for ( size_t i = 0; i < sizeof( s_pProgrammaticNames ) / sizeof( s_pProgrammaticNames[0] ); ++i )
|
||||
for ( size_t i = 0; i < SAL_N_ELEMENTS( s_pProgrammaticNames ); ++i )
|
||||
m_aAliasMap[ OUString::createFromAscii( s_pProgrammaticNames[i] ) ] = AliasEntry( s_pProgrammaticNames[i], i );
|
||||
|
||||
initialize( _rxORB );
|
||||
|
||||
@@ -1747,7 +1747,7 @@ void ORowSet::impl_initializeColumnSettings_nothrow( const Reference< XPropertyS
|
||||
OUString(PROPERTY_ALIGN), OUString(PROPERTY_RELATIVEPOSITION), OUString(PROPERTY_WIDTH), OUString(PROPERTY_HIDDEN), OUString(PROPERTY_CONTROLMODEL),
|
||||
OUString(PROPERTY_HELPTEXT), OUString(PROPERTY_CONTROLDEFAULT)
|
||||
};
|
||||
for ( size_t i=0; i<sizeof( aPropertyNames ) / sizeof( aPropertyNames[0] ); ++i )
|
||||
for ( size_t i=0; i<SAL_N_ELEMENTS( aPropertyNames ); ++i )
|
||||
{
|
||||
if ( xInfo->hasPropertyByName( aPropertyNames[i] ) )
|
||||
{
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace dbaccess
|
||||
OUString sName;
|
||||
sal_Int32 nHandle;
|
||||
};
|
||||
PropertyDescriptor aProps[] =
|
||||
const PropertyDescriptor aProps[] =
|
||||
{
|
||||
{ OUString(PROPERTY_ALIGN), PROPERTY_ID_ALIGN },
|
||||
{ OUString(PROPERTY_NUMBERFORMAT), PROPERTY_ID_NUMBERFORMAT },
|
||||
@@ -138,7 +138,7 @@ namespace dbaccess
|
||||
{ OUString(PROPERTY_HIDDEN), PROPERTY_ID_HIDDEN }
|
||||
};
|
||||
|
||||
for ( size_t i=0; i < sizeof( aProps ) / sizeof( aProps[0] ); ++i )
|
||||
for ( size_t i=0; i < SAL_N_ELEMENTS( aProps ); ++i )
|
||||
{
|
||||
if ( xPSI->hasPropertyByName( aProps[i].sName ) )
|
||||
if ( !isDefaulted( aProps[i].nHandle, _rxColumn->getPropertyValue( aProps[i].sName ) ) )
|
||||
|
||||
@@ -193,14 +193,14 @@ OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, co
|
||||
OUString sName;
|
||||
sal_Int32 nHandle;
|
||||
};
|
||||
PropertyDescriptor aProps[] =
|
||||
const PropertyDescriptor aProps[] =
|
||||
{
|
||||
{ OUString(PROPERTY_CATALOGNAME), PROPERTY_ID_CATALOGNAME },
|
||||
{ OUString(PROPERTY_SCHEMANAME), PROPERTY_ID_SCHEMANAME },
|
||||
{ OUString(PROPERTY_TABLENAME), PROPERTY_ID_TABLENAME },
|
||||
{ OUString(PROPERTY_REALNAME), PROPERTY_ID_REALNAME }
|
||||
};
|
||||
for ( size_t i=0; i < sizeof( aProps ) / sizeof( aProps[0] ); ++i )
|
||||
for ( size_t i=0; i < SAL_N_ELEMENTS( aProps ); ++i )
|
||||
{
|
||||
if ( xPSI->hasPropertyByName( aProps[i].sName ) )
|
||||
setFastPropertyValue_NoBroadcast( aProps[i].nHandle, _rxParserColumn->getPropertyValue( aProps[i].sName ) );
|
||||
|
||||
@@ -1472,11 +1472,11 @@ void ODocumentDefinition::separateOpenCommandArguments( const Sequence< Property
|
||||
{
|
||||
::comphelper::NamedValueCollection aOpenCommandArguments( i_rOpenCommandArguments );
|
||||
|
||||
const sal_Char* pObjectDescriptorArgs[] =
|
||||
const char* pObjectDescriptorArgs[] =
|
||||
{
|
||||
"RecoveryStorage"
|
||||
};
|
||||
for ( size_t i=0; i < sizeof( pObjectDescriptorArgs ) / sizeof( pObjectDescriptorArgs[0] ); ++i )
|
||||
for ( size_t i=0; i < SAL_N_ELEMENTS( pObjectDescriptorArgs ); ++i )
|
||||
{
|
||||
if ( aOpenCommandArguments.has( pObjectDescriptorArgs[i] ) )
|
||||
{
|
||||
|
||||
@@ -377,7 +377,7 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(const OUString& _rDsn) const
|
||||
{
|
||||
}
|
||||
|
||||
bool match( const OUString &url)
|
||||
bool match( const OUString &url) const
|
||||
{
|
||||
if(bMatchComplete)
|
||||
{
|
||||
@@ -389,7 +389,7 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(const OUString& _rDsn) const
|
||||
}
|
||||
}
|
||||
};
|
||||
KnownPrefix aKnowPrefixes[] =
|
||||
const KnownPrefix aKnowPrefixes[] =
|
||||
{
|
||||
KnownPrefix( "sdbc:calc:", DST_CALC, false ),
|
||||
KnownPrefix( "sdbc:flat:", DST_FLAT, false ),
|
||||
@@ -414,7 +414,7 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(const OUString& _rDsn) const
|
||||
KnownPrefix( "sdbc:address:macab", DST_MACAB, true )
|
||||
};
|
||||
|
||||
for ( size_t i=0; i < sizeof( aKnowPrefixes ) / sizeof( aKnowPrefixes[0] ); ++i )
|
||||
for ( size_t i=0; i < SAL_N_ELEMENTS( aKnowPrefixes ); ++i )
|
||||
{
|
||||
if( aKnowPrefixes[i].match(sDsn) )
|
||||
{
|
||||
|
||||
@@ -307,8 +307,8 @@ namespace dbaccess
|
||||
|
||||
// read the map from sub storages to object names
|
||||
MapCompTypeToCompDescs aMapCompDescs;
|
||||
SubComponentType aKnownTypes[] = { TABLE, QUERY, FORM, REPORT, RELATION_DESIGN };
|
||||
for ( size_t i = 0; i < sizeof( aKnownTypes ) / sizeof( aKnownTypes[0] ); ++i )
|
||||
const SubComponentType aKnownTypes[] = { TABLE, QUERY, FORM, REPORT, RELATION_DESIGN };
|
||||
for ( size_t i = 0; i < SAL_N_ELEMENTS( aKnownTypes ); ++i )
|
||||
{
|
||||
if ( !xRecoveryStorage->hasByName( SubComponentRecovery::getComponentsStorageName( aKnownTypes[i] ) ) )
|
||||
continue;
|
||||
|
||||
@@ -190,16 +190,16 @@ namespace dbmm
|
||||
{
|
||||
struct LanguageMapping
|
||||
{
|
||||
const sal_Char* pAsciiLanguage;
|
||||
const char* pAsciiLanguage;
|
||||
const ScriptType eScriptType;
|
||||
|
||||
LanguageMapping( const sal_Char* _pAsciiLanguage, const ScriptType _eScriptType )
|
||||
LanguageMapping( const char* _pAsciiLanguage, const ScriptType _eScriptType )
|
||||
:pAsciiLanguage( _pAsciiLanguage )
|
||||
,eScriptType( _eScriptType )
|
||||
{
|
||||
}
|
||||
}
|
||||
aLanguageMapping[] =
|
||||
};
|
||||
const LanguageMapping aLanguageMapping[] =
|
||||
{
|
||||
LanguageMapping( "JavaScript", eJavaScript ),
|
||||
LanguageMapping( "BeanShell", eBeanShell ),
|
||||
@@ -207,7 +207,7 @@ namespace dbmm
|
||||
LanguageMapping( "Python", ePython ), // TODO: is this correct?
|
||||
LanguageMapping( "Basic", eBasic )
|
||||
};
|
||||
for ( size_t i=0; i < sizeof( aLanguageMapping ) / sizeof( aLanguageMapping[0] ); ++i )
|
||||
for ( size_t i=0; i < SAL_N_ELEMENTS( aLanguageMapping ); ++i )
|
||||
{
|
||||
if ( _rLanguage.equalsAscii( aLanguageMapping[i].pAsciiLanguage ) )
|
||||
{
|
||||
@@ -1205,10 +1205,10 @@ namespace dbmm
|
||||
}
|
||||
::std::set< OUString > aElementNames( aDocStorage.getElementNames() );
|
||||
|
||||
ScriptType aKnownStorageBasedTypes[] = {
|
||||
const ScriptType aKnownStorageBasedTypes[] = {
|
||||
eBeanShell, eJavaScript, ePython, eJava
|
||||
};
|
||||
for ( size_t i=0; i<sizeof( aKnownStorageBasedTypes ) / sizeof( aKnownStorageBasedTypes[0] ); ++i )
|
||||
for ( size_t i=0; i<SAL_N_ELEMENTS( aKnownStorageBasedTypes ); ++i )
|
||||
aElementNames.erase( lcl_getScriptsSubStorageName( aKnownStorageBasedTypes[i] ) );
|
||||
|
||||
if ( !aElementNames.empty() )
|
||||
|
||||
@@ -347,7 +347,7 @@ void ODBExport::exportDataSource()
|
||||
}
|
||||
};
|
||||
|
||||
PropertyMap aTokens[] =
|
||||
const PropertyMap aTokens[] =
|
||||
{
|
||||
PropertyMap( INFO_TEXTFILEHEADER, XML_IS_FIRST_ROW_HEADER_LINE, s_sTrue ),
|
||||
PropertyMap( INFO_SHOWDELETEDROWS, XML_SHOW_DELETED, s_sFalse ),
|
||||
@@ -364,7 +364,7 @@ void ODBExport::exportDataSource()
|
||||
};
|
||||
|
||||
bool bIsXMLDefault = false;
|
||||
for ( size_t i=0; i < sizeof( aTokens ) / sizeof( aTokens[0] ); ++i )
|
||||
for ( size_t i=0; i < SAL_N_ELEMENTS( aTokens ); ++i )
|
||||
{
|
||||
if ( pProperties->Name == aTokens[i].sPropertyName )
|
||||
{
|
||||
@@ -498,7 +498,7 @@ void ODBExport::exportApplicationConnectionSettings(const TSettingsMap& _aSettin
|
||||
,XML_MAX_ROW_COUNT
|
||||
,XML_SUPPRESS_VERSION_COLUMNS
|
||||
};
|
||||
for (size_t i = 0; i< sizeof(pSettings)/sizeof(pSettings[0]); ++i)
|
||||
for (size_t i = 0; i< SAL_N_ELEMENTS(pSettings); ++i)
|
||||
{
|
||||
TSettingsMap::const_iterator aFind = _aSettings.find(pSettings[i]);
|
||||
if ( aFind != _aSettings.end() )
|
||||
@@ -531,7 +531,7 @@ void ODBExport::exportDriverSettings(const TSettingsMap& _aSettings)
|
||||
,XML_IS_FIRST_ROW_HEADER_LINE
|
||||
,XML_PARAMETER_NAME_SUBSTITUTION
|
||||
};
|
||||
for (size_t i = 0; i< sizeof(pSettings)/sizeof(pSettings[0]); ++i)
|
||||
for (size_t i = 0; i< SAL_N_ELEMENTS(pSettings); ++i)
|
||||
{
|
||||
TSettingsMap::const_iterator aFind = _aSettings.find(pSettings[i]);
|
||||
if ( aFind != _aSettings.end() )
|
||||
@@ -1132,7 +1132,7 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp)
|
||||
};
|
||||
|
||||
::std::vector< XMLPropertyState > aPropertyStates;
|
||||
for (size_t i = 0 ; i < sizeof(pExportHelper)/sizeof(pExportHelper[0]); ++i)
|
||||
for (size_t i = 0 ; i < SAL_N_ELEMENTS(pExportHelper); ++i)
|
||||
{
|
||||
aPropertyStates = pExportHelper[i].first->Filter(_xProp);
|
||||
if ( !aPropertyStates.empty() )
|
||||
@@ -1173,11 +1173,11 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp)
|
||||
}
|
||||
else
|
||||
{ // here I know I have a column
|
||||
TExportPropMapperPair pExportHelper[] = {
|
||||
const TExportPropMapperPair pExportHelper[] = {
|
||||
TExportPropMapperPair(m_xColumnExportHelper,TEnumMapperPair(&m_aAutoStyleNames,XML_STYLE_FAMILY_TABLE_COLUMN ))
|
||||
,TExportPropMapperPair(m_xCellExportHelper,TEnumMapperPair(&m_aCellAutoStyleNames,XML_STYLE_FAMILY_TABLE_CELL))
|
||||
};
|
||||
for (size_t i = 0 ; i < sizeof(pExportHelper)/sizeof(pExportHelper[0]); ++i)
|
||||
for (size_t i = 0 ; i < SAL_N_ELEMENTS(pExportHelper); ++i)
|
||||
{
|
||||
::std::vector< XMLPropertyState > aPropStates = pExportHelper[i].first->Filter( _xProp );
|
||||
if ( !aPropStates.empty() )
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace sdbtools
|
||||
*/
|
||||
EComposeRule lcl_translateCompositionType_throw( sal_Int32 _nType )
|
||||
{
|
||||
struct
|
||||
const struct
|
||||
{
|
||||
sal_Int32 nCompositionType;
|
||||
EComposeRule eComposeRule;
|
||||
@@ -196,7 +196,7 @@ namespace sdbtools
|
||||
|
||||
bool found = false;
|
||||
size_t i = 0;
|
||||
for ( ; ( i < sizeof( TypeTable ) / sizeof( TypeTable[0] ) ) && !found; ++i )
|
||||
for ( ; i < SAL_N_ELEMENTS( TypeTable ) && !found; ++i )
|
||||
if ( TypeTable[i].nCompositionType == _nType )
|
||||
found = true;
|
||||
if ( !found )
|
||||
|
||||
@@ -2643,7 +2643,7 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel >
|
||||
{
|
||||
if ( m_xDataSource.is() )
|
||||
{
|
||||
for ( size_t i=0; i < sizeof( aPropertyNames ) / sizeof( aPropertyNames[0] ); ++i )
|
||||
for ( size_t i=0; i < SAL_N_ELEMENTS( aPropertyNames ); ++i )
|
||||
{
|
||||
m_xDataSource->removePropertyChangeListener( aPropertyNames[i], this );
|
||||
}
|
||||
@@ -2666,7 +2666,7 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel >
|
||||
{
|
||||
if ( m_xDataSource.is() )
|
||||
{
|
||||
for ( size_t i=0; i < sizeof( aPropertyNames ) / sizeof( aPropertyNames[0] ); ++i )
|
||||
for ( size_t i=0; i < SAL_N_ELEMENTS( aPropertyNames ); ++i )
|
||||
{
|
||||
m_xDataSource->addPropertyChangeListener( aPropertyNames[i], this );
|
||||
}
|
||||
|
||||
@@ -1152,12 +1152,12 @@ IMPL_LINK_NOARG_TYPED(OAppDetailPageHelper, OnDropdownClickHdl, ToolBox*, void)
|
||||
// execute the menu
|
||||
std::unique_ptr<PopupMenu> aMenu(new PopupMenu( ModuleRes( RID_MENU_APP_PREVIEW ) ));
|
||||
|
||||
sal_uInt16 pActions[] = { SID_DB_APP_DISABLE_PREVIEW
|
||||
const sal_uInt16 pActions[] = { SID_DB_APP_DISABLE_PREVIEW
|
||||
, SID_DB_APP_VIEW_DOC_PREVIEW
|
||||
, SID_DB_APP_VIEW_DOCINFO_PREVIEW
|
||||
};
|
||||
|
||||
for(size_t i=0; i < sizeof(pActions)/sizeof(pActions[0]);++i)
|
||||
for(size_t i=0; i < SAL_N_ELEMENTS(pActions);++i)
|
||||
{
|
||||
aMenu->CheckItem(pActions[i],m_aMenu->IsItemChecked(pActions[i]));
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ OApplicationIconControl::OApplicationIconControl(vcl::Window* _pParent)
|
||||
,m_pActionListener(nullptr)
|
||||
{
|
||||
|
||||
struct CategoryDescriptor
|
||||
const struct CategoryDescriptor
|
||||
{
|
||||
sal_uInt16 nLabelResId;
|
||||
ElementType eType;
|
||||
@@ -47,7 +47,7 @@ OApplicationIconControl::OApplicationIconControl(vcl::Window* _pParent)
|
||||
{ RID_STR_FORMS_CONTAINER, E_FORM, IMG_FORMFOLDER_TREE_L },
|
||||
{ RID_STR_REPORTS_CONTAINER, E_REPORT, IMG_REPORTFOLDER_TREE_L }
|
||||
};
|
||||
for ( size_t i=0; i < sizeof(aCategories)/sizeof(aCategories[0]); ++i)
|
||||
for ( size_t i=0; i < SAL_N_ELEMENTS(aCategories); ++i)
|
||||
{
|
||||
SvxIconChoiceCtrlEntry* pEntry = InsertEntry(
|
||||
OUString( ModuleRes( aCategories[i].nLabelResId ) ) ,
|
||||
|
||||
@@ -41,7 +41,7 @@ OTitleWindow::OTitleWindow(vcl::Window* _pParent,sal_uInt16 _nTitleId,WinBits _n
|
||||
|
||||
const StyleSettings& rStyle = Application::GetSettings().GetStyleSettings();
|
||||
vcl::Window* pWindows[] = { m_aSpace1.get(), m_aSpace2.get(), m_aTitle.get() };
|
||||
for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i)
|
||||
for (size_t i=0; i < SAL_N_ELEMENTS(pWindows); ++i)
|
||||
{
|
||||
vcl::Font aFont = pWindows[i]->GetControlFont();
|
||||
aFont.SetWeight(WEIGHT_BOLD);
|
||||
|
||||
@@ -152,11 +152,11 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU
|
||||
m_aURL = rURL;
|
||||
m_aArgs = rArgs;
|
||||
|
||||
struct ServiceNameToImplName
|
||||
const struct ServiceNameToImplName
|
||||
{
|
||||
const sal_Char* pAsciiServiceName;
|
||||
const sal_Char* pAsciiImplementationName;
|
||||
ServiceNameToImplName( const sal_Char* _pService, const sal_Char* _pImpl )
|
||||
const char* pAsciiServiceName;
|
||||
const char* pAsciiImplementationName;
|
||||
ServiceNameToImplName( const char* _pService, const char* _pImpl )
|
||||
:pAsciiServiceName( _pService )
|
||||
,pAsciiImplementationName( _pImpl )
|
||||
{
|
||||
@@ -174,7 +174,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU
|
||||
Reference< XController2 > xController;
|
||||
|
||||
const OUString sComponentURL( aParser.GetMainURL( INetURLObject::DECODE_TO_IURI ) );
|
||||
for ( size_t i=0; i < sizeof( aImplementations ) / sizeof( aImplementations[0] ); ++i )
|
||||
for ( size_t i=0; i < SAL_N_ELEMENTS( aImplementations ); ++i )
|
||||
{
|
||||
if ( sComponentURL.equalsAscii( aImplementations[i].pAsciiServiceName ) )
|
||||
{
|
||||
|
||||
@@ -1284,7 +1284,7 @@ void SbaTableQueryBrowser::connectExternalDispatches()
|
||||
ID_BROWSER_INSERTCONTENT
|
||||
};
|
||||
|
||||
for ( size_t i=0; i < sizeof( pURLs ) / sizeof( pURLs[0] ); ++i )
|
||||
for ( size_t i=0; i < SAL_N_ELEMENTS( pURLs ); ++i )
|
||||
{
|
||||
URL aURL;
|
||||
aURL.Complete = OUString::createFromAscii( pURLs[i] );
|
||||
|
||||
@@ -275,7 +275,7 @@ void OFieldDescControl::CheckScrollBars()
|
||||
// horizontal :
|
||||
long lMaxXPosition = 0;
|
||||
Control* ppAggregates[] = { pRequired, pNumType, pAutoIncrement, pDefault, pTextLen, pLength, pScale, pFormat, m_pColumnName, m_pType,m_pAutoIncrementValue};
|
||||
for (sal_uInt16 i=0; i<sizeof(ppAggregates)/sizeof(ppAggregates[0]); ++i)
|
||||
for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(ppAggregates); ++i)
|
||||
getMaxXPosition(ppAggregates[i],lMaxXPosition);
|
||||
|
||||
lMaxXPosition += m_pHorzScroll->GetThumbPos() * HSCROLL_STEP;
|
||||
@@ -386,9 +386,9 @@ void OFieldDescControl::ScrollAllAggregates()
|
||||
, pTextLenText, pLengthText
|
||||
, pScaleText, m_pColumnNameText
|
||||
, m_pTypeText, m_pAutoIncrementValueText};
|
||||
OSL_ENSURE(sizeof(ppAggregates)/sizeof(ppAggregates[0]) == sizeof(ppAggregatesText)/sizeof(ppAggregatesText[0]),"Lists are not identical!");
|
||||
OSL_ENSURE(SAL_N_ELEMENTS(ppAggregates) == SAL_N_ELEMENTS(ppAggregatesText),"Lists are not identical!");
|
||||
|
||||
for (sal_uInt16 i=0; i<sizeof(ppAggregates)/sizeof(ppAggregates[0]); ++i)
|
||||
for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(ppAggregates); ++i)
|
||||
ScrollAggregate(ppAggregatesText[i],ppAggregates[i],nullptr,nDeltaX, nDeltaY);
|
||||
|
||||
ScrollAggregate(pFormatText,pFormatSample,pFormat,nDeltaX, nDeltaY);
|
||||
@@ -399,7 +399,7 @@ sal_uInt16 OFieldDescControl::CountActiveAggregates() const
|
||||
{
|
||||
Control* ppAggregates[] = { pRequired, pNumType, pAutoIncrement, pDefault, pTextLen, pLength, pScale, pFormat, m_pColumnName, m_pType,m_pAutoIncrementValue};
|
||||
sal_uInt16 nVisibleAggregates = 0;
|
||||
for (sal_uInt16 i=0; i<sizeof(ppAggregates)/sizeof(ppAggregates[0]); ++i)
|
||||
for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(ppAggregates); ++i)
|
||||
if (ppAggregates[i])
|
||||
++nVisibleAggregates;
|
||||
return nVisibleAggregates;
|
||||
@@ -409,7 +409,7 @@ sal_Int32 OFieldDescControl::GetMaxControlHeight() const
|
||||
{
|
||||
Size aHeight;
|
||||
Control* ppAggregates[] = { pRequired, pNumType, pAutoIncrement, pDefault, pTextLen, pLength, pScale, pFormat, m_pColumnName, m_pType,m_pAutoIncrementValue};
|
||||
for (sal_uInt16 i=0; i<sizeof(ppAggregates)/sizeof(ppAggregates[0]); ++i)
|
||||
for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(ppAggregates); ++i)
|
||||
{
|
||||
if ( ppAggregates[i] )
|
||||
{
|
||||
@@ -438,9 +438,9 @@ void OFieldDescControl::SetReadOnly( bool bReadOnly )
|
||||
, m_pTypeText, m_pAutoIncrementValueText
|
||||
, pFormatText};
|
||||
|
||||
OSL_ENSURE(sizeof(ppAggregates)/sizeof(ppAggregates[0]) == sizeof(ppAggregatesText)/sizeof(ppAggregatesText[0]),"Lists are not identical!");
|
||||
OSL_ENSURE(SAL_N_ELEMENTS(ppAggregates) == SAL_N_ELEMENTS(ppAggregatesText),"Lists are not identical!");
|
||||
|
||||
for (sal_uInt16 i=0; i<sizeof(ppAggregates)/sizeof(ppAggregates[0]); ++i)
|
||||
for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(ppAggregates); ++i)
|
||||
{
|
||||
if ( ppAggregatesText[i] )
|
||||
ppAggregatesText[i]->Enable( !bReadOnly );
|
||||
@@ -662,7 +662,7 @@ void OFieldDescControl::ArrangeAggregates()
|
||||
};
|
||||
|
||||
long nMaxWidth = 0;
|
||||
for (size_t i=0; i<sizeof(adAggregates)/sizeof(adAggregates[0]); i++)
|
||||
for (size_t i=0; i<SAL_N_ELEMENTS(adAggregates); i++)
|
||||
{
|
||||
if (adAggregates[i].pctrlTextControl)
|
||||
{
|
||||
@@ -675,7 +675,7 @@ void OFieldDescControl::ArrangeAggregates()
|
||||
// And go ...
|
||||
int nCurrentControlPos = 0;
|
||||
Control* pZOrderPredecessor = nullptr;
|
||||
for (size_t i=0; i<sizeof(adAggregates)/sizeof(adAggregates[0]); i++)
|
||||
for (size_t i=0; i<SAL_N_ELEMENTS(adAggregates); i++)
|
||||
{
|
||||
if (adAggregates[i].pctrlInputControl)
|
||||
{
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace dbaui
|
||||
{ 0, nullptr }
|
||||
};
|
||||
|
||||
for ( size_t section=0; section < sizeof( aSections ) / sizeof( aSections[0] ) - 1; ++section )
|
||||
for ( size_t section=0; section < SAL_N_ELEMENTS( aSections ) - 1; ++section )
|
||||
{
|
||||
if ( ( m_nAvailableSections & aSections[section].nFlag ) != 0 )
|
||||
{
|
||||
|
||||
@@ -337,7 +337,7 @@ void ODatabaseExport::insertValueIntoColumn()
|
||||
{
|
||||
Reference< XNumberFormatsSupplier > xSupplier = m_xFormatter->getNumberFormatsSupplier();
|
||||
Reference<XNumberFormatTypes> xNumType(xSupplier->getNumberFormats(),UNO_QUERY);
|
||||
sal_Int16 nFormats[] = {
|
||||
const sal_Int16 nFormats[] = {
|
||||
NumberFormat::DATETIME
|
||||
,NumberFormat::DATE
|
||||
,NumberFormat::TIME
|
||||
@@ -345,7 +345,7 @@ void ODatabaseExport::insertValueIntoColumn()
|
||||
,NumberFormat::NUMBER
|
||||
,NumberFormat::LOGICAL
|
||||
};
|
||||
for (size_t i = 0; i < sizeof(nFormats)/sizeof(nFormats[0]); ++i)
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(nFormats); ++i)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -893,7 +893,7 @@ bool callColumnFormatDialog(vcl::Window* _pParent,
|
||||
|
||||
pFormatDescriptor.reset();
|
||||
SfxItemPool::Free(pPool);
|
||||
for (sal_uInt16 i=0; i<sizeof(pDefaults)/sizeof(pDefaults[0]); ++i)
|
||||
for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(pDefaults); ++i)
|
||||
delete pDefaults[i];
|
||||
|
||||
return bRet;
|
||||
|
||||
@@ -143,7 +143,7 @@ void ObjectCopySource::copyUISettingsTo( const Reference< XPropertySet >& _rxObj
|
||||
const OUString aCopyProperties[] = {
|
||||
OUString(PROPERTY_FONT), OUString(PROPERTY_ROW_HEIGHT), OUString(PROPERTY_TEXTCOLOR),OUString(PROPERTY_TEXTLINECOLOR),OUString(PROPERTY_TEXTEMPHASIS),OUString(PROPERTY_TEXTRELIEF)
|
||||
};
|
||||
for ( size_t i=0; i < sizeof( aCopyProperties ) / sizeof( aCopyProperties[0] ); ++i )
|
||||
for ( size_t i=0; i < SAL_N_ELEMENTS( aCopyProperties ); ++i )
|
||||
{
|
||||
if ( m_xObjectPSI->hasPropertyByName( aCopyProperties[i] ) )
|
||||
_rxObject->setPropertyValue( aCopyProperties[i], m_xObject->getPropertyValue( aCopyProperties[i] ) );
|
||||
|
||||
@@ -173,7 +173,8 @@ void OSelectionBrowseBox::initialize()
|
||||
if(xConnection.is())
|
||||
{
|
||||
const IParseContext& rContext = static_cast<OQueryController&>(getDesignView()->getController()).getParser().getContext();
|
||||
IParseContext::InternationalKeyCode eFunctions[] = { IParseContext::InternationalKeyCode::Avg,IParseContext::InternationalKeyCode::Count,IParseContext::InternationalKeyCode::Max
|
||||
const IParseContext::InternationalKeyCode eFunctions[] = {
|
||||
IParseContext::InternationalKeyCode::Avg,IParseContext::InternationalKeyCode::Count,IParseContext::InternationalKeyCode::Max
|
||||
,IParseContext::InternationalKeyCode::Min,IParseContext::InternationalKeyCode::Sum
|
||||
,IParseContext::InternationalKeyCode::Every
|
||||
,IParseContext::InternationalKeyCode::Any
|
||||
@@ -190,7 +191,7 @@ void OSelectionBrowseBox::initialize()
|
||||
OUString sGroup = m_aFunctionStrings.getToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';') - 1, ';');
|
||||
m_aFunctionStrings = m_aFunctionStrings.getToken(0, ';');
|
||||
|
||||
for (size_t i = 0; i < sizeof (eFunctions) / sizeof (eFunctions[0]); ++i)
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(eFunctions); ++i)
|
||||
{
|
||||
m_aFunctionStrings += ";";
|
||||
m_aFunctionStrings += OStringToOUString(rContext.getIntlKeywordAscii(eFunctions[i]),
|
||||
@@ -341,7 +342,7 @@ void OSelectionBrowseBox::Init()
|
||||
Size aHeight;
|
||||
const Control* pControls[] = { m_pTextCell,m_pVisibleCell,m_pTableCell,m_pFieldCell };
|
||||
|
||||
for (sal_Size i = 0; i < sizeof (pControls) / sizeof (pControls[0]); ++i)
|
||||
for (sal_Size i = 0; i < SAL_N_ELEMENTS(pControls); ++i)
|
||||
{
|
||||
const Size aTemp(pControls[i]->GetOptimalSize());
|
||||
if ( aTemp.Height() > aHeight.Height() )
|
||||
|
||||
@@ -234,7 +234,7 @@ void OTableEditorCtrl::InitCellController()
|
||||
|
||||
Size aHeight;
|
||||
const Control* pControls[] = { pTypeCell,pDescrCell,pNameCell,pHelpTextCell};
|
||||
for(sal_Size i= 0; i < sizeof(pControls) / sizeof(pControls[0]);++i)
|
||||
for(sal_Size i= 0; i < SAL_N_ELEMENTS(pControls); ++i)
|
||||
{
|
||||
const Size aTemp(pControls[i]->GetOptimalSize());
|
||||
if ( aTemp.Height() > aHeight.Height() )
|
||||
|
||||
@@ -691,7 +691,7 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X
|
||||
const OUString aSettings[] = {
|
||||
OUString(PROPERTY_FILTER), OUString(PROPERTY_ORDER), OUString(PROPERTY_HAVING_CLAUSE), OUString(PROPERTY_GROUP_BY)
|
||||
};
|
||||
for ( size_t i=0; i < sizeof( aSettings ) / sizeof( aSettings[0] ); ++i )
|
||||
for ( size_t i=0; i < SAL_N_ELEMENTS( aSettings ); ++i )
|
||||
{
|
||||
if ( lcl_hasNonEmptyStringValue_throw( _rxSourceDescriptor, xPSI, aSettings[i] ) )
|
||||
{
|
||||
|
||||
@@ -61,7 +61,7 @@ void Test::test() {
|
||||
OUString("9223372036854775807"),
|
||||
::dp_misc::GREATER }
|
||||
};
|
||||
for (::std::size_t i = 0; i < sizeof data / sizeof (Data); ++i) {
|
||||
for (::std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
data[i].order,
|
||||
::dp_misc::compareVersions(data[i].version1, data[i].version2));
|
||||
|
||||
@@ -262,7 +262,7 @@ void ControlMenuController::updateImagesPopupMenu( PopupMenu* pPopupMenu )
|
||||
if ( pResMgr->IsAvailable( aResId ))
|
||||
{
|
||||
ImageList aImageList( aResId );
|
||||
for ( sal_uInt32 i=0; i < sizeof(nConvertSlots)/sizeof(nConvertSlots[0]); ++i )
|
||||
for ( sal_uInt32 i=0; i < SAL_N_ELEMENTS(nConvertSlots); ++i )
|
||||
{
|
||||
// das entsprechende Image dran
|
||||
if ( m_bShowMenuImages )
|
||||
@@ -310,7 +310,7 @@ void SAL_CALL ControlMenuController::statusChanged( const FeatureStateEvent& Eve
|
||||
osl::ResettableMutexGuard aLock( m_aMutex );
|
||||
|
||||
sal_uInt16 nMenuId = 0;
|
||||
for (sal_uInt32 i=0; i < sizeof(aCommands) / sizeof (aCommands[0]); ++i)
|
||||
for (sal_uInt32 i=0; i < SAL_N_ELEMENTS(aCommands); ++i)
|
||||
{
|
||||
if ( Event.FeatureURL.Complete.equalsAscii( aCommands[i] ))
|
||||
{
|
||||
@@ -419,7 +419,7 @@ void SAL_CALL ControlMenuController::updatePopupMenu() throw (css::uno::RuntimeE
|
||||
fillPopupMenu( m_xPopupMenu );
|
||||
m_aURLToDispatchMap.free();
|
||||
|
||||
for (sal_uInt32 i=0; i<sizeof(aCommands)/sizeof(aCommands[0]); ++i)
|
||||
for (sal_uInt32 i=0; i<SAL_N_ELEMENTS(aCommands); ++i)
|
||||
{
|
||||
aTargetURL.Complete = OUString::createFromAscii( aCommands[i] );
|
||||
m_xURLTransformer->parseStrict( aTargetURL );
|
||||
|
||||
@@ -90,7 +90,7 @@ struct AutoLoadSystemDependencies
|
||||
}
|
||||
|
||||
// For each known DLL ensure it is loaded from the system32 directory
|
||||
for (size_t i = 0; i < sizeof(delayDLLs) / sizeof(delayDLLs[0]); ++i) {
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(delayDLLs); ++i) {
|
||||
size_t fileLen = wcslen(delayDLLs[i]);
|
||||
wcsncpy(systemDirectory + systemDirLen, delayDLLs[i],
|
||||
MAX_PATH - systemDirLen);
|
||||
|
||||
@@ -49,7 +49,7 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler2Helper& rPa
|
||||
// ST_Coordinate
|
||||
OUString sValue;
|
||||
sal_Int32 aIns[] = { XML_lIns, XML_tIns, XML_rIns, XML_bIns };
|
||||
for( sal_Int32 i = 0; i < ( sal_Int32 )( sizeof( aIns ) / sizeof( sal_Int32 ) ); i++)
|
||||
for( sal_Int32 i = 0; i < ( sal_Int32 ) SAL_N_ELEMENTS( aIns ); i++)
|
||||
{
|
||||
sValue = rAttribs.getString( aIns[i] ).get();
|
||||
if( !sValue.isEmpty() )
|
||||
|
||||
@@ -1566,8 +1566,8 @@ void ORptExport::exportGroupsExpressionAsFunction(const Reference< XGroups>& _xG
|
||||
sFunctionName = sFunction + "_" + sExpression;
|
||||
if ( !sFunction.isEmpty() )
|
||||
{
|
||||
sal_Unicode pReplaceChars[] = { '(',')',';',',','+','-','[',']','/','*'};
|
||||
for(sal_uInt32 j= 0; j < sizeof(pReplaceChars)/sizeof(pReplaceChars[0]);++j)
|
||||
const sal_Unicode pReplaceChars[] = { '(',')',';',',','+','-','[',']','/','*'};
|
||||
for(sal_uInt32 j= 0; j < SAL_N_ELEMENTS(pReplaceChars);++j)
|
||||
sFunctionName = sFunctionName.replace(pReplaceChars[j],'_');
|
||||
|
||||
xFunction->setName(sFunctionName);
|
||||
|
||||
@@ -393,12 +393,8 @@ void OFieldExpressionControl::lateInit()
|
||||
m_pComboCell->SetSelectHdl(LINK(this,OFieldExpressionControl,CBChangeHdl));
|
||||
m_pComboCell->SetHelpId(HID_RPT_FIELDEXPRESSION);
|
||||
|
||||
Control* pControls[] = {m_pComboCell};
|
||||
for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
|
||||
{
|
||||
pControls[i]->SetGetFocusHdl(LINK(m_pParent, OGroupsSortingDialog, OnControlFocusGot));
|
||||
pControls[i]->SetLoseFocusHdl(LINK(m_pParent, OGroupsSortingDialog, OnControlFocusLost));
|
||||
}
|
||||
m_pComboCell->SetGetFocusHdl(LINK(m_pParent, OGroupsSortingDialog, OnControlFocusGot));
|
||||
m_pComboCell->SetLoseFocusHdl(LINK(m_pParent, OGroupsSortingDialog, OnControlFocusLost));
|
||||
|
||||
|
||||
// set browse mode
|
||||
@@ -965,14 +961,14 @@ OGroupsSortingDialog::OGroupsSortingDialog(vcl::Window* _pParent, bool _bReadOnl
|
||||
m_pFieldExpression->set_vexpand(true);
|
||||
|
||||
Control* pControlsLst[] = { m_pHeaderLst, m_pFooterLst, m_pGroupOnLst, m_pKeepTogetherLst, m_pOrderLst, m_pGroupIntervalEd};
|
||||
for (size_t i = 0; i < sizeof (pControlsLst) / sizeof (pControlsLst[0]); ++i)
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(pControlsLst); ++i)
|
||||
{
|
||||
pControlsLst[i]->SetGetFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusGot));
|
||||
pControlsLst[i]->SetLoseFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusLost));
|
||||
pControlsLst[i]->Show();
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < (sizeof (pControlsLst) / sizeof (pControlsLst[0])) - 1; ++i)
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(pControlsLst) - 1; ++i)
|
||||
static_cast<ListBox*>(pControlsLst[i])->SetSelectHdl(LINK(this,OGroupsSortingDialog,LBChangeHdl));
|
||||
|
||||
m_pReportListener = new OPropertyChangeMultiplexer(this,m_pController->getReportDefinition().get());
|
||||
@@ -1076,7 +1072,7 @@ void OGroupsSortingDialog::SaveData( sal_Int32 _nRow)
|
||||
xGroup->setSortAscending( m_pOrderLst->GetSelectEntryPos() == 0 );
|
||||
|
||||
ListBox* pControls[] = { m_pHeaderLst, m_pFooterLst, m_pGroupOnLst, m_pKeepTogetherLst, m_pOrderLst};
|
||||
for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i)
|
||||
pControls[i]->SaveValue();
|
||||
}
|
||||
|
||||
@@ -1108,7 +1104,7 @@ IMPL_LINK_TYPED(OGroupsSortingDialog, OnControlFocusGot, Control&, rControl, voi
|
||||
if ( m_pFieldExpression && m_pFieldExpression->getExpressionControl() )
|
||||
{
|
||||
Control* pControls[] = { m_pFieldExpression->getExpressionControl(), m_pHeaderLst, m_pFooterLst, m_pGroupOnLst, m_pGroupIntervalEd, m_pKeepTogetherLst, m_pOrderLst};
|
||||
for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i)
|
||||
{
|
||||
if ( &rControl == pControls[i] )
|
||||
{
|
||||
@@ -1252,8 +1248,8 @@ void OGroupsSortingDialog::displayGroup(const uno::Reference<report::XGroup>& _x
|
||||
case sdbc::DataType::TIME:
|
||||
case sdbc::DataType::TIMESTAMP:
|
||||
{
|
||||
sal_uInt16 nIds[] = { STR_RPT_YEAR, STR_RPT_QUARTER,STR_RPT_MONTH,STR_RPT_WEEK,STR_RPT_DAY,STR_RPT_HOUR,STR_RPT_MINUTE };
|
||||
for (sal_uInt16 i = 0; i < sizeof (nIds) / sizeof (nIds[0]); ++i)
|
||||
const sal_uInt16 nIds[] = { STR_RPT_YEAR, STR_RPT_QUARTER,STR_RPT_MONTH,STR_RPT_WEEK,STR_RPT_DAY,STR_RPT_HOUR,STR_RPT_MINUTE };
|
||||
for (sal_uInt16 i = 0; i < SAL_N_ELEMENTS(nIds); ++i)
|
||||
{
|
||||
m_pGroupOnLst->InsertEntry(OUString(ModuleRes(nIds[i])));
|
||||
m_pGroupOnLst->SetEntryData(i+1,reinterpret_cast<void*>(i+2));
|
||||
@@ -1309,12 +1305,12 @@ void OGroupsSortingDialog::displayGroup(const uno::Reference<report::XGroup>& _x
|
||||
m_pOrderLst->SelectEntryPos(_xGroup->getSortAscending() ? 0 : 1);
|
||||
|
||||
ListBox* pControls[] = { m_pHeaderLst, m_pFooterLst, m_pGroupOnLst, m_pKeepTogetherLst, m_pOrderLst};
|
||||
for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i)
|
||||
pControls[i]->SaveValue();
|
||||
|
||||
ListBox* pControlsLst2[] = { m_pHeaderLst, m_pFooterLst, m_pGroupOnLst, m_pKeepTogetherLst, m_pOrderLst};
|
||||
bool bReadOnly = !m_pController->isEditable();
|
||||
for (size_t i = 0; i < sizeof(pControlsLst2)/sizeof(pControlsLst2[0]); ++i)
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(pControlsLst2); ++i)
|
||||
pControlsLst2[i]->SetReadOnly(bReadOnly);
|
||||
m_pGroupIntervalEd->SetReadOnly(bReadOnly);
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ uno::Sequence< beans::Property > SAL_CALL DataProviderHandler::getSupportedPrope
|
||||
,OUString(PROPERTY_PREVIEW_COUNT)
|
||||
};
|
||||
|
||||
for (size_t nPos = 0; nPos < sizeof(s_pProperties)/sizeof(s_pProperties[0]) ;++nPos )
|
||||
for (size_t nPos = 0; nPos < SAL_N_ELEMENTS(s_pProperties); ++nPos )
|
||||
{
|
||||
aValue.Name = s_pProperties[nPos];
|
||||
aNewProps.push_back(aValue);
|
||||
|
||||
@@ -1309,7 +1309,7 @@ uno::Sequence< beans::Property > SAL_CALL GeometryHandler::getSupportedPropertie
|
||||
};
|
||||
const uno::Reference < beans::XPropertySetInfo > xInfo = m_xReportComponent->getPropertySetInfo();
|
||||
const uno::Sequence< beans::Property> aSeq = xInfo->getProperties();
|
||||
for (size_t i = 0; i < sizeof(pIncludeProperties)/sizeof(pIncludeProperties[0]) ;++i )
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(pIncludeProperties); ++i )
|
||||
{
|
||||
const beans::Property* pIter = aSeq.getConstArray();
|
||||
const beans::Property* pEnd = pIter + aSeq.getLength();
|
||||
|
||||
@@ -294,9 +294,9 @@ namespace rptui
|
||||
for (; pPropsIter != pPropsEnd; ++pPropsIter)
|
||||
{
|
||||
size_t nPos = 0;
|
||||
for (; nPos < sizeof(pExcludeProperties)/sizeof(pExcludeProperties[0]) && pExcludeProperties[nPos] != pPropsIter->Name;++nPos )
|
||||
for (; nPos < SAL_N_ELEMENTS(pExcludeProperties) && pExcludeProperties[nPos] != pPropsIter->Name; ++nPos )
|
||||
;
|
||||
if ( nPos == sizeof(pExcludeProperties)/sizeof(pExcludeProperties[0]) )
|
||||
if ( nPos == SAL_N_ELEMENTS(pExcludeProperties) )
|
||||
_rExcludeProperties.push_back(*pPropsIter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -540,7 +540,7 @@ namespace
|
||||
,{ITEMID_LANGUAGE_ASIAN,OUString(PROPERTY_CHARLOCALEASIAN)}
|
||||
,{ITEMID_LANGUAGE_COMPLEX,OUString(PROPERTY_CHARLOCALECOMPLEX)}
|
||||
};
|
||||
for(size_t k = 0; k < sizeof(pItems)/sizeof(pItems[0]);++k)
|
||||
for(size_t k = 0; k < SAL_N_ELEMENTS(pItems); ++k)
|
||||
{
|
||||
if ( SfxItemState::SET == _rItemSet.GetItemState( pItems[k].nWhich,true,&pItem) && dynamic_cast< const SvxLanguageItem *>( pItem ) != nullptr)
|
||||
{
|
||||
@@ -730,7 +730,7 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep
|
||||
}
|
||||
|
||||
SfxItemPool::Free(pPool);
|
||||
for (sal_uInt16 i=0; i<sizeof(pDefaults)/sizeof(pDefaults[0]); ++i)
|
||||
for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(pDefaults); ++i)
|
||||
delete pDefaults[i];
|
||||
|
||||
return bSuccess;
|
||||
|
||||
@@ -2094,7 +2094,7 @@ void OReportController::onLoadedMenu(const Reference< frame::XLayoutManager >& _
|
||||
,OUString("private:resource/toolbar/resizebar")
|
||||
,OUString("private:resource/toolbar/sectionshrinkbar")
|
||||
};
|
||||
for (size_t i = 0; i< sizeof(s_sMenu)/sizeof(s_sMenu[0]); ++i)
|
||||
for (size_t i = 0; i< SAL_N_ELEMENTS(s_sMenu); ++i)
|
||||
{
|
||||
_xLayoutManager->createElement( s_sMenu[i] );
|
||||
_xLayoutManager->requestElement( s_sMenu[i] );
|
||||
@@ -2537,7 +2537,7 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
|
||||
}
|
||||
SfxItemPool::Free(pPool);
|
||||
|
||||
for (sal_uInt16 i=0; i<sizeof(pDefaults)/sizeof(pDefaults[0]); ++i)
|
||||
for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(pDefaults); ++i)
|
||||
delete pDefaults[i];
|
||||
|
||||
}
|
||||
@@ -2724,7 +2724,7 @@ uno::Any SAL_CALL OReportController::getViewData() throw( uno::RuntimeException,
|
||||
{
|
||||
::osl::MutexGuard aGuard( getMutex() );
|
||||
|
||||
sal_Int32 nCommandIDs[] =
|
||||
const sal_Int32 nCommandIDs[] =
|
||||
{
|
||||
SID_GRID_VISIBLE,
|
||||
SID_GRID_USE,
|
||||
@@ -2736,7 +2736,7 @@ uno::Any SAL_CALL OReportController::getViewData() throw( uno::RuntimeException,
|
||||
};
|
||||
|
||||
::comphelper::NamedValueCollection aCommandProperties;
|
||||
for ( size_t i=0; i < sizeof (nCommandIDs) / sizeof (nCommandIDs[0]); ++i )
|
||||
for ( size_t i=0; i < SAL_N_ELEMENTS(nCommandIDs); ++i )
|
||||
{
|
||||
const FeatureState aFeatureState = GetState( nCommandIDs[i] );
|
||||
|
||||
@@ -3209,7 +3209,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
|
||||
,OUString(PROPERTY_FORMATSSUPPLIER)
|
||||
,OUString(PROPERTY_BACKGROUNDCOLOR)
|
||||
};
|
||||
for(size_t i = 0; i < sizeof (sProps) / sizeof (sProps[0]); ++i)
|
||||
for(size_t i = 0; i < SAL_N_ELEMENTS(sProps); ++i)
|
||||
{
|
||||
if ( xInfo->hasPropertyByName(sProps[i]) && xShapeInfo->hasPropertyByName(sProps[i]) )
|
||||
xUnoProp->setPropertyValue(sProps[i],xShapeProp->getPropertyValue(sProps[i]));
|
||||
@@ -3493,7 +3493,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
|
||||
OUString sDefaultName;
|
||||
size_t i = 0;
|
||||
OUnoObject* pObjs[2];
|
||||
for(i = 0; i < sizeof(pControl)/sizeof(pControl[0]);++i)
|
||||
for(i = 0; i < SAL_N_ELEMENTS(pControl); ++i)
|
||||
{
|
||||
pObjs[i] = dynamic_cast<OUnoObject*>(pControl[i]);
|
||||
uno::Reference<beans::XPropertySet> xUnoProp(pObjs[i]->GetUnoControlModel(),uno::UNO_QUERY_THROW);
|
||||
@@ -3508,7 +3508,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
|
||||
,OUString(PROPERTY_BORDER)
|
||||
,OUString(PROPERTY_BACKGROUNDCOLOR)
|
||||
};
|
||||
for(size_t k = 0; k < sizeof(sProps)/sizeof(sProps[0]);++k)
|
||||
for(size_t k = 0; k < SAL_N_ELEMENTS(sProps); ++k)
|
||||
{
|
||||
if ( xInfo->hasPropertyByName(sProps[k]) && xShapeInfo->hasPropertyByName(sProps[k]) )
|
||||
xUnoProp->setPropertyValue(sProps[k],xShapeProp->getPropertyValue(sProps[k]));
|
||||
@@ -3570,7 +3570,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
|
||||
uno::Reference< report::XFixedText> xShapeProp(pObj->getUnoShape(),uno::UNO_QUERY_THROW);
|
||||
xShapeProp->setName(xShapeProp->getName() + sDefaultName );
|
||||
|
||||
for(i = 0; i < sizeof(pControl)/sizeof(pControl[0]);++i) // insert controls
|
||||
for(i = 0; i < SAL_N_ELEMENTS(pControl); ++i) // insert controls
|
||||
{
|
||||
correctOverlapping(pControl[i],pSectionWindow[1-i]->getReportSection());
|
||||
}
|
||||
@@ -3619,7 +3619,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
|
||||
}
|
||||
else
|
||||
{
|
||||
for(size_t i = 0; i < sizeof(pControl)/sizeof(pControl[0]);++i)
|
||||
for(size_t i = 0; i < SAL_N_ELEMENTS(pControl); ++i)
|
||||
delete pControl[i];
|
||||
}
|
||||
}
|
||||
@@ -3680,7 +3680,7 @@ void OReportController::listen(const bool _bAdd)
|
||||
void (SAL_CALL XPropertySet::*pPropertyListenerAction)( const OUString&, const uno::Reference< XPropertyChangeListener >& ) =
|
||||
_bAdd ? &XPropertySet::addPropertyChangeListener : &XPropertySet::removePropertyChangeListener;
|
||||
|
||||
for (size_t i = 0; i < sizeof(aProps)/sizeof(aProps[0]); ++i)
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(aProps); ++i)
|
||||
(m_xReportDefinition.get()->*pPropertyListenerAction)( aProps[i], static_cast< XPropertyChangeListener* >( this ) );
|
||||
|
||||
OXUndoEnvironment& rUndoEnv = m_aReportModel->GetUndoEnv();
|
||||
@@ -4260,7 +4260,7 @@ void OReportController::openZoomDialog()
|
||||
}
|
||||
SfxItemPool::Free(pPool);
|
||||
|
||||
for (sal_uInt16 i=0; i<sizeof(pDefaults)/sizeof(pDefaults[0]); ++i)
|
||||
for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(pDefaults); ++i)
|
||||
delete pDefaults[i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ void PropBrw::dispose()
|
||||
const OUString pProps[] = { OUString( "ContextDocument" )
|
||||
, OUString( "DialogParentWindow" )
|
||||
, OUString( "ActiveConnection" )};
|
||||
for (size_t i = 0; i < sizeof(pProps)/sizeof(pProps[0]); ++i)
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(pProps); ++i)
|
||||
xName->removeByName(pProps[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ static bool lcl_MayBeDBase( SvStream& rStream )
|
||||
rStream.Seek(STREAM_SEEK_TO_BEGIN);
|
||||
rStream.ReadUChar( nMark );
|
||||
bool bValidMark = false;
|
||||
for (size_t i=0; i < sizeof(nValidMarks)/sizeof(nValidMarks[0]) && !bValidMark; ++i)
|
||||
for (size_t i=0; i < SAL_N_ELEMENTS(nValidMarks) && !bValidMark; ++i)
|
||||
{
|
||||
if (nValidMarks[i] == nMark)
|
||||
bValidMark = true;
|
||||
|
||||
@@ -2939,7 +2939,7 @@ static const char * ASP_Scripts[] = { "common.inc", "webcast.asp", "show.asp", "
|
||||
/** creates and saves the ASP scripts for WebShow */
|
||||
bool HtmlExport::CreateASPScripts()
|
||||
{
|
||||
for( sal_uInt16 n = 0; n < (sizeof( ASP_Scripts ) / sizeof(char *)); n++ )
|
||||
for( sal_uInt16 n = 0; n < SAL_N_ELEMENTS(ASP_Scripts); n++ )
|
||||
{
|
||||
OUString aScript = OUString::createFromAscii(ASP_Scripts[n]);
|
||||
|
||||
@@ -2958,7 +2958,7 @@ static const char *PERL_Scripts[] = { "webcast.pl", "common.pl", "editpic.pl", "
|
||||
// creates and saves the PERL scripts for WebShow
|
||||
bool HtmlExport::CreatePERLScripts()
|
||||
{
|
||||
for( sal_uInt16 n = 0; n < (sizeof( PERL_Scripts ) / sizeof(char *)); n++ )
|
||||
for( sal_uInt16 n = 0; n < SAL_N_ELEMENTS(PERL_Scripts); n++ )
|
||||
{
|
||||
OUString aScript = OUString::createFromAscii(PERL_Scripts[n]);
|
||||
|
||||
|
||||
@@ -2418,7 +2418,7 @@ void SlideshowImpl::createSlideList( bool bAll, const OUString& rPresSlide )
|
||||
|
||||
typedef sal_uInt16 (*FncGetChildWindowId)();
|
||||
|
||||
FncGetChildWindowId aShowChildren[] =
|
||||
static const FncGetChildWindowId aShowChildren[] =
|
||||
{
|
||||
&AnimationChildWindow::GetChildWindowId,
|
||||
&Svx3DChildWindow::GetChildWindowId,
|
||||
@@ -2441,7 +2441,7 @@ void SlideshowImpl::hideChildWindows()
|
||||
|
||||
if( pViewFrame )
|
||||
{
|
||||
for( sal_uLong i = 0, nCount = sizeof( aShowChildren ) / sizeof( FncGetChildWindowId ); i < nCount; i++ )
|
||||
for( sal_uLong i = 0; i < SAL_N_ELEMENTS( aShowChildren ); i++ )
|
||||
{
|
||||
const sal_uInt16 nId = ( *aShowChildren[ i ] )();
|
||||
|
||||
@@ -2462,7 +2462,7 @@ void SlideshowImpl::showChildWindows()
|
||||
SfxViewFrame* pViewFrame = getViewFrame();
|
||||
if( pViewFrame )
|
||||
{
|
||||
for( sal_uLong i = 0, nCount = sizeof( aShowChildren ) / sizeof( FncGetChildWindowId ); i < nCount; i++ )
|
||||
for( sal_uLong i = 0; i < SAL_N_ELEMENTS(aShowChildren); i++ )
|
||||
{
|
||||
if( mnChildMask & ( 1 << i ) )
|
||||
pViewFrame->SetChildWindow( ( *aShowChildren[ i ] )(), true );
|
||||
|
||||
@@ -252,7 +252,7 @@ DDFERR parseCmd(char * line, PCCAB ccab, char * token)
|
||||
|
||||
for (p = token ; *p; ++p) *p = tolower(*p);
|
||||
if (isdigit(token[strlen(token)-1])) token[strlen(token)-1] = '\0';
|
||||
for (i = 0; i < (sizeof(VARS)/sizeof(VARS[0])); i++)
|
||||
for (i = 0; i < SAL_N_ELEMENTS(VARS); i++)
|
||||
{
|
||||
if (strcmp(token, VARS[i]) == 0)
|
||||
{
|
||||
|
||||
@@ -180,7 +180,7 @@ static HMENU createSystrayMenu( )
|
||||
};
|
||||
|
||||
// insert the menu entries for launching the applications
|
||||
for ( size_t i = 0; i < sizeof( aMenuItems ) / sizeof( aMenuItems[0] ); ++i )
|
||||
for ( size_t i = 0; i < SAL_N_ELEMENTS(aMenuItems); ++i )
|
||||
{
|
||||
if ( !aModuleOptions.IsModuleInstalled( aMenuItems[i].eModuleIdentifier ) )
|
||||
// the complete application is not even installed
|
||||
|
||||
@@ -528,13 +528,13 @@ void SfxFrameLoader_Impl::impl_removeLoaderArguments( ::comphelper::NamedValueCo
|
||||
|
||||
::comphelper::NamedValueCollection SfxFrameLoader_Impl::impl_extractViewCreationArgs( ::comphelper::NamedValueCollection& io_rDescriptor )
|
||||
{
|
||||
const sal_Char* pKnownViewArgs[] = {
|
||||
static const char* pKnownViewArgs[] = {
|
||||
"JumpMark",
|
||||
"PickListEntry"
|
||||
};
|
||||
|
||||
::comphelper::NamedValueCollection aViewArgs;
|
||||
for ( size_t i=0; i < sizeof( pKnownViewArgs ) / sizeof( pKnownViewArgs[0] ); ++i )
|
||||
for ( size_t i=0; i < SAL_N_ELEMENTS(pKnownViewArgs); ++i )
|
||||
{
|
||||
if ( io_rDescriptor.has( pKnownViewArgs[i] ) )
|
||||
{
|
||||
|
||||
@@ -1610,13 +1610,13 @@ void FmXGridPeer::removeColumnListeners(const Reference< XPropertySet >& xCol)
|
||||
{
|
||||
// the same props as in addColumnListeners ... linux has problems with global static UStrings, so
|
||||
// we have to do it this way ....
|
||||
static OUString aPropsListenedTo[] =
|
||||
static const OUString aPropsListenedTo[] =
|
||||
{
|
||||
OUString(FM_PROP_LABEL), OUString(FM_PROP_WIDTH), OUString(FM_PROP_HIDDEN), OUString(FM_PROP_ALIGN), OUString(FM_PROP_FORMATKEY)
|
||||
};
|
||||
|
||||
Reference< XPropertySetInfo > xInfo = xCol->getPropertySetInfo();
|
||||
for (sal_uInt16 i=0; i<sizeof(aPropsListenedTo)/sizeof(aPropsListenedTo[0]); ++i)
|
||||
for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(aPropsListenedTo); ++i)
|
||||
if (xInfo->hasPropertyByName(aPropsListenedTo[i]))
|
||||
xCol->removePropertyChangeListener(aPropsListenedTo[i], this);
|
||||
}
|
||||
|
||||
@@ -718,7 +718,7 @@ void DbCellControl::ImplInitWindow( vcl::Window& rParent, const InitWindowFacet
|
||||
|
||||
if ((_eInitWhat & InitWritingMode) != 0)
|
||||
{
|
||||
for (size_t i = 0; i < sizeof(pWindows) / sizeof(pWindows[0]); ++i)
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(pWindows); ++i)
|
||||
{
|
||||
if (pWindows[i])
|
||||
pWindows[i]->EnableRTL(rParent.IsRTLEnabled());
|
||||
@@ -727,7 +727,7 @@ void DbCellControl::ImplInitWindow( vcl::Window& rParent, const InitWindowFacet
|
||||
|
||||
if ((_eInitWhat & InitFontFacet) != 0)
|
||||
{
|
||||
for (size_t i = 0; i < sizeof(pWindows) / sizeof(pWindows[0]); ++i)
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(pWindows); ++i)
|
||||
{
|
||||
if (!pWindows[i])
|
||||
continue;
|
||||
@@ -757,7 +757,7 @@ void DbCellControl::ImplInitWindow( vcl::Window& rParent, const InitWindowFacet
|
||||
bool bTextLineColor = rParent.IsTextLineColor();
|
||||
Color aTextLineColor(rParent.GetTextLineColor());
|
||||
|
||||
for (size_t i=0; i < sizeof(pWindows) / sizeof(pWindows[0]); ++i)
|
||||
for (size_t i=0; i < SAL_N_ELEMENTS(pWindows); ++i)
|
||||
{
|
||||
if (pWindows[i])
|
||||
{
|
||||
@@ -778,7 +778,7 @@ void DbCellControl::ImplInitWindow( vcl::Window& rParent, const InitWindowFacet
|
||||
if (rParent.IsControlBackground())
|
||||
{
|
||||
Color aColor(rParent.GetControlBackground());
|
||||
for (size_t i=0; i < sizeof(pWindows) / sizeof(pWindows[0]); ++i)
|
||||
for (size_t i=0; i < SAL_N_ELEMENTS(pWindows); ++i)
|
||||
{
|
||||
if (pWindows[i])
|
||||
{
|
||||
|
||||
@@ -541,7 +541,7 @@ sal_uInt16 DbGridControl::NavigationBar::ArrangeControls()
|
||||
m_aNewBtn.get()
|
||||
};
|
||||
|
||||
for (size_t i=0; i < (sizeof (pWindows) / sizeof(pWindows[0])); ++i)
|
||||
for (size_t i=0; i < SAL_N_ELEMENTS(pWindows); ++i)
|
||||
{
|
||||
if (pWindows[i]->GetPosPixel().X() < 0)
|
||||
pWindows[i]->SetSizePixel(Size(0, nH));
|
||||
@@ -812,7 +812,7 @@ void DbGridControl::NavigationBar::StateChanged(StateChangedType nType)
|
||||
case StateChangedType::Mirroring:
|
||||
{
|
||||
bool bIsRTLEnabled = IsRTLEnabled();
|
||||
for (size_t i=0; i < (sizeof (pWindows) / sizeof(pWindows[0])); ++i)
|
||||
for (size_t i=0; i < SAL_N_ELEMENTS(pWindows); ++i)
|
||||
pWindows[i]->EnableRTL( bIsRTLEnabled );
|
||||
}
|
||||
break;
|
||||
@@ -826,7 +826,7 @@ void DbGridControl::NavigationBar::StateChanged(StateChangedType nType)
|
||||
if (IsControlFont())
|
||||
aFont.Merge(GetControlFont());
|
||||
|
||||
for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i)
|
||||
for (size_t i=0; i < SAL_N_ELEMENTS(pWindows); ++i)
|
||||
{
|
||||
pWindows[i]->SetZoom(aZoom);
|
||||
pWindows[i]->SetZoomedPointFont(*pWindows[i], aFont);
|
||||
|
||||
@@ -271,7 +271,7 @@ void FmPropBrw::dispose()
|
||||
, OUString( "DialogParentWindow" )
|
||||
, OUString( "ControlContext" )
|
||||
, OUString( "ControlShapeAccess" ) };
|
||||
for ( size_t i = 0; i < sizeof(pProps)/sizeof(pProps[0]); ++i )
|
||||
for ( size_t i = 0; i < SAL_N_ELEMENTS(pProps); ++i )
|
||||
xName->removeByName( pProps[i] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ bool FmFormPage::RequestHelp( vcl::Window* pWindow, SdrView* pView,
|
||||
INetProtocol::Https, INetProtocol::Javascript,
|
||||
INetProtocol::Ldap
|
||||
};
|
||||
for (sal_uInt16 i=0; i<sizeof(s_aQuickHelpSupported)/sizeof(s_aQuickHelpSupported[0]); ++i)
|
||||
for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(s_aQuickHelpSupported); ++i)
|
||||
if (s_aQuickHelpSupported[i] == aProtocol)
|
||||
{
|
||||
aHelpText = INetURLObject::decode(aUrl.GetURLNoPass(), INetURLObject::DECODE_UNAMBIGUOUS);
|
||||
|
||||
@@ -1046,7 +1046,7 @@ PopupMenu* FmXFormShell::GetConversionMenu()
|
||||
PopupMenu* pNewMenu = new PopupMenu(SVX_RES( RID_FMSHELL_CONVERSIONMENU ));
|
||||
|
||||
ImageList aImageList( SVX_RES( RID_SVXIMGLIST_FMEXPL) );
|
||||
for ( size_t i = 0; i < sizeof (nConvertSlots) / sizeof (nConvertSlots[0]); ++i )
|
||||
for ( size_t i = 0; i < SAL_N_ELEMENTS(nConvertSlots); ++i )
|
||||
{
|
||||
// das entsprechende Image dran
|
||||
pNewMenu->SetItemImage(nConvertSlots[i], aImageList.GetImage(nCreateSlots[i]));
|
||||
@@ -1058,7 +1058,7 @@ PopupMenu* FmXFormShell::GetConversionMenu()
|
||||
|
||||
bool FmXFormShell::isControlConversionSlot( sal_uInt16 nSlotId )
|
||||
{
|
||||
for ( size_t i = 0; i < sizeof (nConvertSlots) / sizeof (nConvertSlots[0]); ++i )
|
||||
for ( size_t i = 0; i < SAL_N_ELEMENTS(nConvertSlots); ++i )
|
||||
if (nConvertSlots[i] == nSlotId)
|
||||
return true;
|
||||
return false;
|
||||
@@ -1094,7 +1094,7 @@ bool FmXFormShell::executeControlConversionSlot( const Reference< XFormComponent
|
||||
OSL_ENSURE( isSolelySelected( _rxObject ),
|
||||
"FmXFormShell::executeControlConversionSlot: hmm ... shouldn't this parameter be redundant?" );
|
||||
|
||||
for ( size_t lookupSlot = 0; lookupSlot < sizeof( nConvertSlots ) / sizeof( nConvertSlots[0] ); ++lookupSlot )
|
||||
for ( size_t lookupSlot = 0; lookupSlot < SAL_N_ELEMENTS(nConvertSlots); ++lookupSlot )
|
||||
{
|
||||
if (nConvertSlots[lookupSlot] == _nSlotId)
|
||||
{
|
||||
@@ -1310,10 +1310,10 @@ bool FmXFormShell::canConvertCurrentSelectionToControl( sal_Int16 nConversionSlo
|
||||
)
|
||||
return false; // those types cannot be converted
|
||||
|
||||
DBG_ASSERT(sizeof(nConvertSlots)/sizeof(nConvertSlots[0]) == sizeof(nObjectTypes)/sizeof(nObjectTypes[0]),
|
||||
DBG_ASSERT(SAL_N_ELEMENTS(nConvertSlots) == SAL_N_ELEMENTS(nObjectTypes),
|
||||
"FmXFormShell::canConvertCurrentSelectionToControl: nConvertSlots & nObjectTypes must have the same size !");
|
||||
|
||||
for ( size_t i = 0; i < sizeof( nConvertSlots ) / sizeof( nConvertSlots[0] ); ++i )
|
||||
for ( size_t i = 0; i < SAL_N_ELEMENTS( nConvertSlots ); ++i )
|
||||
if (nConvertSlots[i] == nConversionSlot)
|
||||
return nObjectTypes[i] != nObjectType;
|
||||
|
||||
@@ -2031,7 +2031,7 @@ bool FmXFormShell::setCurrentSelection( const InterfaceBag& _rSelection )
|
||||
impl_updateCurrentForm( xNewCurrentForm );
|
||||
|
||||
// ensure some slots are updated
|
||||
for ( size_t i = 0; i < sizeof( SelObjectSlotMap ) / sizeof( SelObjectSlotMap[0] ); ++i )
|
||||
for ( size_t i = 0; i < SAL_N_ELEMENTS(SelObjectSlotMap); ++i )
|
||||
InvalidateSlot( SelObjectSlotMap[i], false);
|
||||
|
||||
return true;
|
||||
@@ -2071,7 +2071,7 @@ void FmXFormShell::impl_updateCurrentForm( const Reference< XForm >& _rxNewCurFo
|
||||
pPage->GetImpl().setCurForm( m_xCurrentForm );
|
||||
|
||||
// ensure the UI which depends on the current form is up-to-date
|
||||
for ( size_t i = 0; i < sizeof( DlgSlotMap ) / sizeof( DlgSlotMap[0] ); ++i )
|
||||
for ( size_t i = 0; i < SAL_N_ELEMENTS( DlgSlotMap ); ++i )
|
||||
InvalidateSlot( DlgSlotMap[i], false );
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace svx
|
||||
{ OUString(FMURL_FORM_APPLY_FILTER), SID_FM_FORM_FILTERED, FormFeature::ToggleApplyFilter },
|
||||
{ OUString(FMURL_FORM_REMOVE_FILTER), SID_FM_REMOVE_FILTER_SORT, FormFeature::RemoveFilterAndSort }
|
||||
};
|
||||
for ( size_t i=0; i<sizeof(aDescriptions)/sizeof(aDescriptions[0]); ++i )
|
||||
for ( size_t i=0; i<SAL_N_ELEMENTS(aDescriptions); ++i )
|
||||
s_aFeatureDescriptions.push_back( aDescriptions[i] );
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2171,7 +2171,7 @@ struct SvxStyleToolBoxControl::Impl
|
||||
};
|
||||
Reference<container::XNameAccess> xCellStyles;
|
||||
xStylesSupplier->getStyleFamilies()->getByName("CellStyles") >>= xCellStyles;
|
||||
for( sal_uInt32 nStyle = 0; nStyle < sizeof( aCalcStyles ) / sizeof( sal_Char*); ++nStyle )
|
||||
for( sal_uInt32 nStyle = 0; nStyle < SAL_N_ELEMENTS(aCalcStyles); ++nStyle )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -849,7 +849,7 @@ const UHashMapImpl& GetUHashImpl()
|
||||
{ RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DPolygonObject"), E3D_POLYGONOBJ_ID | E3D_INVENTOR_FLAG },
|
||||
};
|
||||
|
||||
for (sal_uInt32 i = 0; i < sizeof(aInit)/sizeof(aInit[0]); i++)
|
||||
for (sal_uInt32 i = 0; i < SAL_N_ELEMENTS(aInit); i++)
|
||||
aImpl[OUString( aInit[i].name, aInit[i].length, RTL_TEXTENCODING_ASCII_US ) ] = aInit[i].id;
|
||||
bInited = true;
|
||||
}
|
||||
|
||||
@@ -275,8 +275,7 @@ void SwTextFormatColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
|
||||
bContinue = pNewChgSet->GetTheChgdSet() == &GetAttrSet();
|
||||
}
|
||||
|
||||
for( int nC = 0, nArrLen = sizeof(aFontSizeArr) / sizeof( aFontSizeArr[0]);
|
||||
nC < nArrLen; ++nC )
|
||||
for( int nC = 0, nArrLen = SAL_N_ELEMENTS(aFontSizeArr); nC < nArrLen; ++nC )
|
||||
{
|
||||
const SvxFontHeightItem *pFSize = aFontSizeArr[ nC ], *pOldFSize;
|
||||
if( pFSize && SfxItemState::SET == GetItemState(
|
||||
|
||||
@@ -63,7 +63,7 @@ protected:
|
||||
{
|
||||
Throbber::IMAGES_16_PX, Throbber::IMAGES_32_PX, Throbber::IMAGES_64_PX
|
||||
};
|
||||
for ( size_t i=0; i < sizeof( aImageSets ) / sizeof( aImageSets[0] ); ++i )
|
||||
for ( size_t i=0; i < SAL_N_ELEMENTS(aImageSets); ++i )
|
||||
{
|
||||
const ::std::vector< OUString > aDefaultURLs( Throbber::getDefaultImageURLs( aImageSets[i] ) );
|
||||
const Sequence< OUString > aImageURLs( &aDefaultURLs[0], aDefaultURLs.size() );
|
||||
|
||||
@@ -2046,7 +2046,7 @@ struct EncodingEntry
|
||||
// The source for the following table is <ftp://ftp.iana.org/in-notes/iana/
|
||||
// assignments/character-sets> as of Jan, 21 2000 12:46:00, unless otherwise
|
||||
// noted:
|
||||
EncodingEntry const aEncodingMap[]
|
||||
static EncodingEntry const aEncodingMap[]
|
||||
= { { "US-ASCII", RTL_TEXTENCODING_ASCII_US },
|
||||
{ "ANSI_X3.4-1968", RTL_TEXTENCODING_ASCII_US },
|
||||
{ "ISO-IR-6", RTL_TEXTENCODING_ASCII_US },
|
||||
@@ -2226,8 +2226,7 @@ EncodingEntry const aEncodingMap[]
|
||||
rtl_TextEncoding getCharsetEncoding(sal_Char const * pBegin,
|
||||
sal_Char const * pEnd)
|
||||
{
|
||||
for (sal_Size i = 0; i < sizeof aEncodingMap / sizeof (EncodingEntry);
|
||||
++i)
|
||||
for (sal_Size i = 0; i < SAL_N_ELEMENTS(aEncodingMap); ++i)
|
||||
if (equalIgnoreCase(pBegin, pEnd, aEncodingMap[i].m_aName))
|
||||
return aEncodingMap[i].m_eEncoding;
|
||||
return RTL_TEXTENCODING_DONTKNOW;
|
||||
|
||||
@@ -1111,7 +1111,7 @@ int GetRawData(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *len, sal_uInt3
|
||||
_this->rawdata = nullptr;
|
||||
}
|
||||
|
||||
for(i=0; i < sizeof(vtable2)/sizeof(*vtable2); i++) {
|
||||
for(i=0; i < SAL_N_ELEMENTS(vtable2); i++) {
|
||||
if (_this->tag == vtable2[i].tag) {
|
||||
return vtable2[i].f(_this, ptr, len, tag);
|
||||
}
|
||||
@@ -1511,7 +1511,7 @@ extern "C"
|
||||
|
||||
if (_this->rawdata) free(_this->rawdata);
|
||||
|
||||
for(i=0; i < sizeof(vcl::vtable1)/sizeof(*vcl::vtable1); i++) {
|
||||
for(i=0; i < SAL_N_ELEMENTS(vcl::vtable1); i++) {
|
||||
if (_this->tag == vcl::vtable1[i].tag) {
|
||||
vcl::vtable1[i].f(_this);
|
||||
return;
|
||||
|
||||
@@ -2167,7 +2167,7 @@ style::NumberingType::
|
||||
CHARS_CYRILLIC_LOWER_LETTER_N_SR*/
|
||||
|
||||
};
|
||||
for( sal_uInt32 nNum = 0; nNum < sizeof(aNumberingPairs)/sizeof( NumberingPairs ); ++nNum)
|
||||
for( sal_uInt32 nNum = 0; nNum < SAL_N_ELEMENTS(aNumberingPairs); ++nNum)
|
||||
{
|
||||
if( /*sCommand*/sNumber.equalsAscii(aNumberingPairs[nNum].cWordName ))
|
||||
{
|
||||
@@ -3098,8 +3098,7 @@ void DomainMapper_Impl::handleAuthor
|
||||
//search for a field mapping
|
||||
OUString sFieldServiceName;
|
||||
sal_uInt16 nMap = 0;
|
||||
for( ; nMap < sizeof(aDocProperties) / sizeof(DocPropertyMap);
|
||||
++nMap )
|
||||
for( ; nMap < SAL_N_ELEMENTS(aDocProperties); ++nMap )
|
||||
{
|
||||
if ((rFirstParam.equalsAscii(aDocProperties[nMap].pDocPropertyName)) && (!xPropertySetInfo->hasPropertyByName(rFirstParam)))
|
||||
{
|
||||
|
||||
@@ -187,7 +187,7 @@ void lcl_mergeProps( PropertyMapPtr pToFill, PropertyMapPtr pToAdd, TblStyleTyp
|
||||
( nStyleId == TBL_STYLE_FIRSTCOL )
|
||||
};
|
||||
|
||||
for ( unsigned i = 0 ; i != sizeof(pPropsToCheck) / sizeof(PropertyIds); i++ )
|
||||
for ( unsigned i = 0 ; i != SAL_N_ELEMENTS(pPropsToCheck); i++ )
|
||||
{
|
||||
PropertyIds nId = pPropsToCheck[i];
|
||||
boost::optional<PropertyMap::Property> pProp = pToAdd->getProperty(nId);
|
||||
@@ -232,7 +232,7 @@ PropertyMapPtr TableStyleSheetEntry::GetLocalPropertiesFromMask( sal_Int32 nMask
|
||||
|
||||
// Get the properties applying according to the mask
|
||||
PropertyMapPtr pProps( new PropertyMap( ) );
|
||||
for (size_t i = 0; i < sizeof(aOrderedStyleTable)/sizeof(aOrderedStyleTable[0]); ++i)
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(aOrderedStyleTable); ++i)
|
||||
{
|
||||
TblStylePrs::iterator pIt = m_aStyles.find( aOrderedStyleTable[ i ].type );
|
||||
if ( ( nMask & aOrderedStyleTable[ i ].mask ) && ( pIt != m_aStyles.end( ) ) )
|
||||
@@ -1429,7 +1429,7 @@ OUString StyleSheetTable::ConvertStyleName( const OUString& rWWName, bool bExten
|
||||
}
|
||||
if(m_pImpl->m_aStyleNameMap.empty())
|
||||
{
|
||||
for( sal_uInt32 nPair = 0; nPair < sizeof(aStyleNamePairs) / sizeof( sal_Char*) / 2; ++nPair)
|
||||
for( sal_uInt32 nPair = 0; nPair < SAL_N_ELEMENTS(aStyleNamePairs)/2; ++nPair)
|
||||
{
|
||||
OUString aFrom = OUString::createFromAscii(aStyleNamePairs[2 * nPair]);
|
||||
OUString aTo = OUString::createFromAscii(aStyleNamePairs[2 * nPair + 1]);
|
||||
|
||||
@@ -547,11 +547,11 @@ namespace xmloff
|
||||
{
|
||||
PROPERTY_LABEL, PROPERTY_TITLE
|
||||
};
|
||||
OSL_ENSURE( sizeof(aStringPropertyNames)/sizeof(aStringPropertyNames[0]) ==
|
||||
sizeof(nStringPropertyAttributeIds)/sizeof(nStringPropertyAttributeIds[0]),
|
||||
OSL_ENSURE( SAL_N_ELEMENTS(aStringPropertyNames) ==
|
||||
SAL_N_ELEMENTS(nStringPropertyAttributeIds),
|
||||
"OControlExport::exportCommonControlAttributes: somebody tampered with the maps (1)!");
|
||||
|
||||
for (i=0; i<sizeof(nStringPropertyAttributeIds)/sizeof(nStringPropertyAttributeIds[0]); ++i)
|
||||
for (i=0; i<SAL_N_ELEMENTS(nStringPropertyAttributeIds); ++i)
|
||||
if (nStringPropertyAttributeIds[i] & m_nIncludeCommon)
|
||||
{
|
||||
exportStringPropertyAttribute(
|
||||
@@ -590,7 +590,7 @@ namespace xmloff
|
||||
OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nFlagsCount),
|
||||
"OControlExport::exportCommonControlAttributes: somebody tampered with the maps (2)!");
|
||||
#endif
|
||||
for (i=0; i<sizeof(nBooleanPropertyAttributeIds)/sizeof(nBooleanPropertyAttributeIds[0]); ++i)
|
||||
for (i=0; i<SAL_N_ELEMENTS(nBooleanPropertyAttributeIds); ++i)
|
||||
if (nBooleanPropertyAttributeIds[i] & m_nIncludeCommon)
|
||||
{
|
||||
exportBooleanPropertyAttribute(
|
||||
@@ -631,7 +631,7 @@ namespace xmloff
|
||||
OSL_ENSURE((nIdCount == nNameCount) && (nNameCount == nDefaultCount),
|
||||
"OControlExport::exportCommonControlAttributes: somebody tampered with the maps (3)!");
|
||||
#endif
|
||||
for (i=0; i<sizeof(nIntegerPropertyAttributeIds)/sizeof(nIntegerPropertyAttributeIds[0]); ++i)
|
||||
for (i=0; i<SAL_N_ELEMENTS(nIntegerPropertyAttributeIds); ++i)
|
||||
if (nIntegerPropertyAttributeIds[i] & m_nIncludeCommon)
|
||||
{
|
||||
exportInt16PropertyAttribute(
|
||||
|
||||
@@ -488,7 +488,7 @@ char const * XmlReader::handleReference(char const * position, char const * end)
|
||||
RTL_CONSTASCII_STRINGPARAM("'") },
|
||||
{ RTL_CONSTASCII_STRINGPARAM("quot;"),
|
||||
RTL_CONSTASCII_STRINGPARAM("\"") } };
|
||||
for (std::size_t i = 0; i < sizeof refs / sizeof refs[0]; ++i) {
|
||||
for (std::size_t i = 0; i < SAL_N_ELEMENTS(refs); ++i) {
|
||||
if (rtl_str_shortenedCompare_WithLength(
|
||||
position, end - position, refs[i].inBegin, refs[i].inLength,
|
||||
refs[i].inLength) ==
|
||||
|
||||
Reference in New Issue
Block a user