summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2017-03-29 00:01:04 +0200
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2017-04-04 14:35:16 +0000
commit3ecb9b4bd7dc70664bbb8d7c957ea8dc5015223f (patch)
tree3446bd81bcd905833fb46f1660bb2d6e095d358b /svtools
parent0144600bf5b5d8093f6a720ad21df221f08bce9e (diff)
tdf#99352: assert on stray VclPtrs past DeInit
- ignore on Windows for now, as it is acting up Change-Id: I98dbb887ed556b58188870c3eb3de1327bc58109 Reviewed-on: https://gerrit.libreoffice.org/35816 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx25
1 files changed, 13 insertions, 12 deletions
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index b07207d88332..91de032185f1 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -49,6 +49,7 @@
#include <tools/urlobj.hxx>
#include <algorithm>
#include <map>
+#include <array>
namespace svt
@@ -423,8 +424,8 @@ void AssignmentPersistentData::ImplCommit()
struct AddressBookSourceDialogData
{
- VclPtr<FixedText> pFieldLabels[FIELD_PAIRS_VISIBLE * 2];
- VclPtr<ListBox> pFields[FIELD_PAIRS_VISIBLE * 2];
+ std::array<VclPtr<FixedText>, FIELD_PAIRS_VISIBLE*2> pFieldLabels;
+ std::array<VclPtr<ListBox>, FIELD_PAIRS_VISIBLE*2> pFields;
/// when working transient, we need the data source
Reference< XDataSource >
@@ -449,27 +450,27 @@ void AssignmentPersistentData::ImplCommit()
AddressBookSourceDialogData( )
- :nFieldScrollPos(0)
+ :pFieldLabels{{nullptr}}
+ ,pFields{{nullptr}}
+ ,nFieldScrollPos(0)
,nLastVisibleListIndex(0)
,bOddFieldNumber(false)
,bWorkingPersistent( true )
,pConfigData( new AssignmentPersistentData )
{
- memset(pFieldLabels, 0, sizeof(pFieldLabels));
- memset(pFields, 0, sizeof(pFields));
}
AddressBookSourceDialogData( const Reference< XDataSource >& _rxTransientDS, const OUString& _rDataSourceName,
const OUString& _rTableName, const Sequence< AliasProgrammaticPair >& _rFields )
- :m_xTransientDataSource( _rxTransientDS )
+ :pFieldLabels{{nullptr}}
+ ,pFields{{nullptr}}
+ ,m_xTransientDataSource( _rxTransientDS )
,nFieldScrollPos(0)
,nLastVisibleListIndex(0)
,bOddFieldNumber(false)
,bWorkingPersistent( false )
,pConfigData( new AssigmentTransientData( _rDataSourceName, _rTableName, _rFields ) )
{
- memset(pFieldLabels, 0, sizeof(pFieldLabels));
- memset(pFields, 0, sizeof(pFields));
}
// Copy assignment is forbidden and not implemented.
@@ -977,14 +978,14 @@ void AssignmentPersistentData::ImplCommit()
// loop through our field control rows and do some adjustments
// for the new texts
- VclPtr<FixedText>* pLeftLabelControl = m_pImpl->pFieldLabels;
- VclPtr<FixedText>* pRightLabelControl = pLeftLabelControl + 1;
+ auto pLeftLabelControl = m_pImpl->pFieldLabels.begin();
+ auto pRightLabelControl = pLeftLabelControl+1;
auto pLeftColumnLabel = m_pImpl->aFieldLabels.cbegin() + 2 * _nPos;
auto pRightColumnLabel = pLeftColumnLabel + 1;
// for the focus movement and the selection scroll
- VclPtr<ListBox>* pLeftListControl = m_pImpl->pFields;
- VclPtr<ListBox>* pRightListControl = pLeftListControl + 1;
+ auto pLeftListControl = m_pImpl->pFields.begin();
+ auto pRightListControl = pLeftListControl + 1;
// for the focus movement
sal_Int32 nOldFocusRow = -1;