From bbf134a2b77909706492cbc41952210f89c0df71 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 24 Apr 2018 13:36:34 +0200 Subject: SvTabListBox::SetTabs, pass count explicit passing count as first element in array, dodgy. Change-Id: I49905b554b3b4d6cc3fa419a36389cd2e5ded463 --- sfx2/source/dialog/versdlg.cxx | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index 79e59754ea9e..ff3dcb81ef6b 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -171,10 +171,8 @@ void SfxVersionsTabListBox_Impl::setColSizes() } } - long aStaticTabs[] = { 3, 0, 0, 0 }; - aStaticTabs[2] = nMax; - aStaticTabs[3] = nMax + nMaxAuthorWidth; - SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel); + long aTabPositions[] = { 0, nMax, nMax + nMaxAuthorWidth }; + SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aTabPositions), aTabPositions, MapUnit::MapPixel); } SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, bool bIsSaveVersionOnClose ) @@ -215,10 +213,8 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, bool bIsSaveVersion m_pVersionBox->SetStyle( m_pVersionBox->GetStyle() | WB_HSCROLL | WB_CLIPCHILDREN ); m_pVersionBox->SetSelectionMode( SelectionMode::Single ); - long nTabs_Impl[] = { 3, 0, 0, 0 }; - - - m_pVersionBox->SvSimpleTable::SetTabs(&nTabs_Impl[0]); + long aTabPositions[] = { 0, 0, 0 }; + m_pVersionBox->SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aTabPositions), aTabPositions); OUString sHeader1(get("datetime")->GetText()); OUString sHeader2(get("savedby")->GetText()); OUString sHeader3(get("comments")->GetText()); @@ -517,9 +513,8 @@ SfxCmisVersionsDialog::SfxCmisVersionsDialog ( SfxViewFrame* pVwFrame ) m_pVersionBox->SetStyle( m_pVersionBox->GetStyle() | WB_HSCROLL | WB_CLIPCHILDREN ); m_pVersionBox->SetSelectionMode( SelectionMode::Single ); - long nTabs_Impl[] = { 3, 0, 0, 0 }; - - m_pVersionBox->SvSimpleTable::SetTabs(&nTabs_Impl[0]); + long aTabPositions[] = { 0, 0, 0 }; + m_pVersionBox->SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aTabPositions), aTabPositions); OUString sHeader1(get("datetime")->GetText()); OUString sHeader2(get("savedby")->GetText()); OUString sHeader3(get("comments")->GetText()); -- cgit