summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls/linectrl.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-11-21 15:49:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-22 12:15:38 +0100
commit3fbbd74b7bc6aef4af5f0c4b23a73a6726b9afbf (patch)
treeb3a0df75c42a93645f5342863a7291c871e520eb /svx/source/tbxctrls/linectrl.cxx
parent4b7490fe49bb93f895e974602a2616fa80b74019 (diff)
loplugin:flatten in svx
Change-Id: Idc4d0186ecc6f0722c2b1358486a2430f037ae29 Reviewed-on: https://gerrit.libreoffice.org/45036 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/tbxctrls/linectrl.cxx')
-rw-r--r--svx/source/tbxctrls/linectrl.cxx72
1 files changed, 36 insertions, 36 deletions
diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx
index 987796504f43..b9e7b5e222dc 100644
--- a/svx/source/tbxctrls/linectrl.cxx
+++ b/svx/source/tbxctrls/linectrl.cxx
@@ -366,50 +366,50 @@ IMPL_LINK_NOARG(SvxLineEndWindow, SelectHdl, ValueSet*, void)
void SvxLineEndWindow::FillValueSet()
{
- if( mpLineEndList.is() )
- {
- ScopedVclPtrInstance< VirtualDevice > pVD;
+ if( !mpLineEndList.is() )
+ return;
- long nCount = mpLineEndList->Count();
+ ScopedVclPtrInstance< VirtualDevice > pVD;
- // First entry: no line end.
- // An entry is temporarily added to get the UI bitmap
- basegfx::B2DPolyPolygon aNothing;
- mpLineEndList->Insert(o3tl::make_unique<XLineEndEntry>(aNothing, SvxResId(RID_SVXSTR_NONE)));
- const XLineEndEntry* pEntry = mpLineEndList->GetLineEnd(nCount);
- Bitmap aBmp = mpLineEndList->GetUiBitmap( nCount );
- OSL_ENSURE( !aBmp.IsEmpty(), "UI bitmap was not created" );
+ long nCount = mpLineEndList->Count();
- maBmpSize = aBmp.GetSizePixel();
- pVD->SetOutputSizePixel( maBmpSize, false );
- maBmpSize.Width() = maBmpSize.Width() / 2;
- Point aPt0( 0, 0 );
- Point aPt1( maBmpSize.Width(), 0 );
+ // First entry: no line end.
+ // An entry is temporarily added to get the UI bitmap
+ basegfx::B2DPolyPolygon aNothing;
+ mpLineEndList->Insert(o3tl::make_unique<XLineEndEntry>(aNothing, SvxResId(RID_SVXSTR_NONE)));
+ const XLineEndEntry* pEntry = mpLineEndList->GetLineEnd(nCount);
+ Bitmap aBmp = mpLineEndList->GetUiBitmap( nCount );
+ OSL_ENSURE( !aBmp.IsEmpty(), "UI bitmap was not created" );
- pVD->DrawBitmap( Point(), aBmp );
- mpLineEndSet->InsertItem(1, Image(pVD->GetBitmap(aPt0, maBmpSize)), pEntry->GetName());
- mpLineEndSet->InsertItem(2, Image(pVD->GetBitmap(aPt1, maBmpSize)), pEntry->GetName());
+ maBmpSize = aBmp.GetSizePixel();
+ pVD->SetOutputSizePixel( maBmpSize, false );
+ maBmpSize.Width() = maBmpSize.Width() / 2;
+ Point aPt0( 0, 0 );
+ Point aPt1( maBmpSize.Width(), 0 );
- mpLineEndList->Remove(nCount);
+ pVD->DrawBitmap( Point(), aBmp );
+ mpLineEndSet->InsertItem(1, Image(pVD->GetBitmap(aPt0, maBmpSize)), pEntry->GetName());
+ mpLineEndSet->InsertItem(2, Image(pVD->GetBitmap(aPt1, maBmpSize)), pEntry->GetName());
- for( long i = 0; i < nCount; i++ )
- {
- pEntry = mpLineEndList->GetLineEnd( i );
- DBG_ASSERT( pEntry, "Could not access LineEndEntry" );
- aBmp = mpLineEndList->GetUiBitmap( i );
- OSL_ENSURE( !aBmp.IsEmpty(), "UI bitmap was not created" );
-
- pVD->DrawBitmap( aPt0, aBmp );
- mpLineEndSet->InsertItem((sal_uInt16)((i+1)*2L+1),
- Image(pVD->GetBitmap(aPt0, maBmpSize)), pEntry->GetName());
- mpLineEndSet->InsertItem((sal_uInt16)((i+2)*2L),
- Image(pVD->GetBitmap(aPt1, maBmpSize)), pEntry->GetName());
- }
- mnLines = std::min( (sal_uInt16)(nCount + 1), (sal_uInt16) MAX_LINES );
- mpLineEndSet->SetLineCount( mnLines );
+ mpLineEndList->Remove(nCount);
- SetSize();
+ for( long i = 0; i < nCount; i++ )
+ {
+ pEntry = mpLineEndList->GetLineEnd( i );
+ DBG_ASSERT( pEntry, "Could not access LineEndEntry" );
+ aBmp = mpLineEndList->GetUiBitmap( i );
+ OSL_ENSURE( !aBmp.IsEmpty(), "UI bitmap was not created" );
+
+ pVD->DrawBitmap( aPt0, aBmp );
+ mpLineEndSet->InsertItem((sal_uInt16)((i+1)*2L+1),
+ Image(pVD->GetBitmap(aPt0, maBmpSize)), pEntry->GetName());
+ mpLineEndSet->InsertItem((sal_uInt16)((i+2)*2L),
+ Image(pVD->GetBitmap(aPt1, maBmpSize)), pEntry->GetName());
}
+ mnLines = std::min( (sal_uInt16)(nCount + 1), (sal_uInt16) MAX_LINES );
+ mpLineEndSet->SetLineCount( mnLines );
+
+ SetSize();
}
void SvxLineEndWindow::statusChanged( const css::frame::FeatureStateEvent& rEvent )