Kaydet (Commit) c2e931d5 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

More reduction of scoping inside nested for loop.

üst 1b623cda
...@@ -689,43 +689,48 @@ void ScXMLExport::CollectSharedData(sal_Int32& nTableCount, sal_Int32& nShapesCo ...@@ -689,43 +689,48 @@ void ScXMLExport::CollectSharedData(sal_Int32& nTableCount, sal_Int32& nShapesCo
for (sal_Int32 nShape = 0; nShape < nShapes; ++nShape) for (sal_Int32 nShape = 0; nShape < nShapes; ++nShape)
{ {
uno::Reference<drawing::XShape> xShape(xShapesIndex->getByIndex(nShape), uno::UNO_QUERY); uno::Reference<drawing::XShape> xShape(xShapesIndex->getByIndex(nShape), uno::UNO_QUERY);
if (xShape.is()) if (!xShape.is())
continue;
uno::Reference<beans::XPropertySet> xShapeProp(xShape, uno::UNO_QUERY);
if (!xShapeProp.is())
continue;
sal_Int16 nLayerID = 0;
bool bExtracted = xShapeProp->getPropertyValue(sLayerID) >>= nLayerID;
if (!bExtracted)
continue;
if ((nLayerID == SC_LAYER_INTERN) || (nLayerID == SC_LAYER_HIDDEN))
{ {
uno::Reference<beans::XPropertySet> xShapeProp(xShape, uno::UNO_QUERY); CollectInternalShape(xShape);
if( xShapeProp.is() ) continue;
{ }
sal_Int16 nLayerID = 0;
if( xShapeProp->getPropertyValue(sLayerID) >>= nLayerID ) ++nShapesCount;
{
if( (nLayerID == SC_LAYER_INTERN) || (nLayerID == SC_LAYER_HIDDEN) ) SvxShape* pShapeImp = SvxShape::getImplementation(xShape);
CollectInternalShape(xShape); if (!pShapeImp)
else continue;
{
++nShapesCount; SdrObject* pSdrObj = pShapeImp->GetSdrObject();
if (SvxShape* pShapeImp = SvxShape::getImplementation(xShape)) if (!pSdrObj)
{ continue;
if (SdrObject *pSdrObj = pShapeImp->GetSdrObject())
{ if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjData(pSdrObj))
if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjData( pSdrObj )) {
{ ScMyShape aMyShape;
ScMyShape aMyShape; aMyShape.aAddress = pAnchor->maStart;
aMyShape.aAddress = pAnchor->maStart; aMyShape.aEndAddress = pAnchor->maEnd;
aMyShape.aEndAddress = pAnchor->maEnd; aMyShape.nEndX = pAnchor->maEndOffset.X();
aMyShape.nEndX = pAnchor->maEndOffset.X(); aMyShape.nEndY = pAnchor->maEndOffset.Y();
aMyShape.nEndY = pAnchor->maEndOffset.Y(); aMyShape.xShape = xShape;
aMyShape.xShape = xShape; pSharedData->AddNewShape(aMyShape);
pSharedData->AddNewShape(aMyShape); pSharedData->SetLastColumn(nTable, pAnchor->maStart.Col());
pSharedData->SetLastColumn(nTable, pAnchor->maStart.Col()); pSharedData->SetLastRow(nTable, pAnchor->maStart.Row());
pSharedData->SetLastRow(nTable, pAnchor->maStart.Row());
}
else
pSharedData->AddTableShape(nTable, xShape);
}
}
}
}
}
} }
else
pSharedData->AddTableShape(nTable, xShape);
} }
} }
} }
......
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