Kaydet (Commit) dd670d89 authored tarafından Mike Kaganski's avatar Mike Kaganski

Use range-based for here instead of ScNameToIndexAccess

Change-Id: Ida1351dda42f2dc0ddb50dbcbd55564d64280c15
Reviewed-on: https://gerrit.libreoffice.org/71655
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst ed67b443
......@@ -262,23 +262,23 @@ static sheet::DataPilotFieldOrientation lcl_GetDataGetOrientation( const uno::Re
sheet::DataPilotFieldOrientation nRet = sheet::DataPilotFieldOrientation_HIDDEN;
if ( xSource.is() )
{
uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions();
uno::Reference<container::XIndexAccess> xIntDims = new ScNameToIndexAccess( xDimsName );
long nIntCount = xIntDims->getCount();
bool bFound = false;
for (long nIntDim=0; nIntDim<nIntCount && !bFound; nIntDim++)
uno::Reference<container::XNameAccess> xDimNames = xSource->getDimensions();
for (const OUString& rDimName: xDimNames->getElementNames())
{
uno::Reference<beans::XPropertySet> xDimProp(xIntDims->getByIndex(nIntDim),
uno::Reference<beans::XPropertySet> xDimProp(xDimNames->getByName(rDimName),
uno::UNO_QUERY);
if ( xDimProp.is() )
{
bFound = ScUnoHelpFunctions::GetBoolProperty( xDimProp,
const bool bFound = ScUnoHelpFunctions::GetBoolProperty( xDimProp,
SC_UNO_DP_ISDATALAYOUT );
//TODO: error checking -- is "IsDataLayoutDimension" property required??
if (bFound)
{
nRet = ScUnoHelpFunctions::GetEnumProperty(
xDimProp, SC_UNO_DP_ORIENTATION,
sheet::DataPilotFieldOrientation_HIDDEN );
break;
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment