summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog/dinfdlg.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-10-14 09:25:24 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2021-10-15 10:36:36 +0200
commit2484de6728bd11bb7949003d112f1ece2223c7a1 (patch)
tree1296534e396da284b38d2c478dcd2b31c4714179 /sfx2/source/dialog/dinfdlg.cxx
parent88375fd36899d21d3309cf8333712e02a87d3a91 (diff)
Remove non-const Sequence::begin()/end() in internal code
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2/source/dialog/dinfdlg.cxx')
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 1a3cdec7e08f..7462f840d1ec 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -2322,7 +2322,7 @@ bool SfxCmisPropertiesPage::FillItemSet( SfxItemSet* rSet )
aOldProps[i].Value >>= oldValue;
// We only edit hours and minutes
// don't compare NanoSeconds and Seconds
- for ( auto& rDateTime : oldValue )
+ for ( auto& rDateTime : asNonConstRange(oldValue) )
{
rDateTime.NanoSeconds = 0;
rDateTime.Seconds = 0;
@@ -2357,7 +2357,7 @@ void SfxCmisPropertiesPage::Reset( const SfxItemSet* rItemSet )
m_xPropertiesCtrl->ClearAllLines();
const SfxDocumentInfoItem& rInfoItem = rItemSet->Get(SID_DOCINFO);
uno::Sequence< document::CmisProperty > aCmisProps = rInfoItem.GetCmisProperties();
- for ( auto& rCmisProp : aCmisProps )
+ for ( auto& rCmisProp : asNonConstRange(aCmisProps) )
{
m_xPropertiesCtrl->AddLine(rCmisProp.Id,
rCmisProp.Name,