summaryrefslogtreecommitdiff
path: root/cppcanvas
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-05-04 21:20:18 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-06-05 19:24:57 +0200
commit2ed3d691b42525f6c1cc430d5863febcb102816e (patch)
tree97088acb96f8ad26f2ae67f3f8e5c2f6aab05cf0 /cppcanvas
parent6c31c2b01dd32cc7ba1230f2c4a98b8f7def219b (diff)
Use hasElements to check Sequence emptiness in cppcanvas..desktop
Similar to clang-tidy readability-container-size-empty Change-Id: I81c0ff78d2ecc7d984e3ed5e5ce60efe327fc162 Reviewed-on: https://gerrit.libreoffice.org/71799 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cppcanvas')
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx18
-rw-r--r--cppcanvas/source/mtfrenderer/polypolyaction.cxx4
-rw-r--r--cppcanvas/source/mtfrenderer/textaction.cxx4
3 files changed, 13 insertions, 13 deletions
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 241443aa39a9..5de65e350bc7 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -392,8 +392,8 @@ namespace cppcanvas
const OutDevState& rState( rParms.mrStates.getState() );
if( (!rState.isLineColorSet &&
!rState.isFillColorSet) ||
- (rState.lineColor.getLength() == 0 &&
- rState.fillColor.getLength() == 0) )
+ (!rState.lineColor.hasElements() &&
+ !rState.fillColor.hasElements()) )
{
return false;
}
@@ -1813,7 +1813,7 @@ namespace cppcanvas
case MetaActionType::POINT:
{
const OutDevState& rState( rStates.getState() );
- if( rState.lineColor.getLength() )
+ if( rState.lineColor.hasElements() )
{
std::shared_ptr<Action> pPointAction(
internal::PointActionFactory::createPointAction(
@@ -1837,7 +1837,7 @@ namespace cppcanvas
case MetaActionType::PIXEL:
{
const OutDevState& rState( rStates.getState() );
- if( rState.lineColor.getLength() )
+ if( rState.lineColor.hasElements() )
{
std::shared_ptr<Action> pPointAction(
internal::PointActionFactory::createPointAction(
@@ -1862,7 +1862,7 @@ namespace cppcanvas
case MetaActionType::LINE:
{
const OutDevState& rState( rStates.getState() );
- if( rState.lineColor.getLength() )
+ if( rState.lineColor.hasElements() )
{
MetaLineAction* pLineAct = static_cast<MetaLineAction*>(pCurrAct);
@@ -2048,8 +2048,8 @@ namespace cppcanvas
case MetaActionType::POLYLINE:
{
const OutDevState& rState( rStates.getState() );
- if( rState.lineColor.getLength() ||
- rState.fillColor.getLength() )
+ if( rState.lineColor.hasElements() ||
+ rState.fillColor.hasElements() )
{
MetaPolyLineAction* pPolyLineAct = static_cast<MetaPolyLineAction*>(pCurrAct);
@@ -2395,8 +2395,8 @@ namespace cppcanvas
case MetaActionType::Transparent:
{
const OutDevState& rState( rStates.getState() );
- if( rState.lineColor.getLength() ||
- rState.fillColor.getLength() )
+ if( rState.lineColor.hasElements() ||
+ rState.fillColor.hasElements() )
{
MetaTransparentAction* pAct = static_cast<MetaTransparentAction*>(pCurrAct);
::basegfx::B2DPolyPolygon aPoly( pAct->GetPolyPolygon().getB2DPolyPolygon() );
diff --git a/cppcanvas/source/mtfrenderer/polypolyaction.cxx b/cppcanvas/source/mtfrenderer/polypolyaction.cxx
index b2bf7e5ab816..19c75104f5fb 100644
--- a/cppcanvas/source/mtfrenderer/polypolyaction.cxx
+++ b/cppcanvas/source/mtfrenderer/polypolyaction.cxx
@@ -155,7 +155,7 @@ namespace cppcanvas
rendering::RenderState aLocalState( maState );
::canvas::tools::prependToRenderState(aLocalState, rTransformation);
- if( maFillColor.getLength() )
+ if( maFillColor.hasElements() )
{
// TODO(E3): Use DBO's finalizer here,
// fillPolyPolygon() might throw
@@ -169,7 +169,7 @@ namespace cppcanvas
aLocalState.DeviceColor = aTmpColor;
}
- if( aLocalState.DeviceColor.getLength() )
+ if( aLocalState.DeviceColor.hasElements() )
{
rCachedPrimitive = mpCanvas->getUNOCanvas()->drawPolyPolygon( mxPolyPoly,
mpCanvas->getViewState(),
diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx
index d6e2cedd4e8e..04f37560bfad 100644
--- a/cppcanvas/source/mtfrenderer/textaction.cxx
+++ b/cppcanvas/source/mtfrenderer/textaction.cxx
@@ -155,7 +155,7 @@ namespace cppcanvas
void initLayoutWidth(double& rLayoutWidth, const uno::Sequence<double>& rOffsets)
{
- ENSURE_OR_THROW(rOffsets.getLength(),
+ ENSURE_OR_THROW(rOffsets.hasElements(),
"::cppcanvas::internal::initLayoutWidth(): zero-length array" );
rLayoutWidth = *(std::max_element(rOffsets.begin(), rOffsets.end()));
}
@@ -236,7 +236,7 @@ namespace cppcanvas
const OutDevState& rState,
const ::basegfx::B2DHomMatrix* pTextTransform )
{
- ENSURE_OR_THROW( rOffsets.getLength(),
+ ENSURE_OR_THROW( rOffsets.hasElements(),
"::cppcanvas::internal::initArrayAction(): zero-length DX array" );
const ::basegfx::B2DPoint aLocalStartPoint(