diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-29 10:02:46 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-31 06:56:57 +0100 |
commit | 8b9e502480812f61a1c8d37c465aaf93763fe156 (patch) | |
tree | c74b7baf71fe1ffd88a9819bb53b33fb75668392 /sdext/source/presenter | |
parent | ce22935a8586eda71fd29d4ff969d9cd7a2ec15b (diff) |
Prepare for removal of non-const operator[] from Sequence in sdext
Change-Id: I1992d1ffbbc80efe9749ebd254971a0a92a10019
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124386
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sdext/source/presenter')
6 files changed, 21 insertions, 22 deletions
diff --git a/sdext/source/presenter/PresenterAccessibility.cxx b/sdext/source/presenter/PresenterAccessibility.cxx index 5c3a3efb20d6..10d73b88d898 100644 --- a/sdext/source/presenter/PresenterAccessibility.cxx +++ b/sdext/source/presenter/PresenterAccessibility.cxx @@ -1278,8 +1278,7 @@ void AccessibleRelationSet::AddRelation ( { maRelations.emplace_back(); maRelations.back().RelationType = nRelationType; - maRelations.back().TargetSet.realloc(1); - maRelations.back().TargetSet[0] = rxObject; + maRelations.back().TargetSet = { rxObject }; } //----- XAccessibleRelationSet ------------------------------------------------ diff --git a/sdext/source/presenter/PresenterCanvasHelper.cxx b/sdext/source/presenter/PresenterCanvasHelper.cxx index 8381f8d5aabd..4ff103958e1a 100644 --- a/sdext/source/presenter/PresenterCanvasHelper.cxx +++ b/sdext/source/presenter/PresenterCanvasHelper.cxx @@ -250,10 +250,11 @@ void PresenterCanvasHelper::SetDeviceColor( OSL_ASSERT(rRenderState.DeviceColor.getLength() == 4); if (rRenderState.DeviceColor.getLength() == 4) { - rRenderState.DeviceColor[0] = ((aColor >> 16) & 0x0ff) / 255.0; - rRenderState.DeviceColor[1] = ((aColor >> 8) & 0x0ff) / 255.0; - rRenderState.DeviceColor[2] = ((aColor >> 0) & 0x0ff) / 255.0; - rRenderState.DeviceColor[3] = 1.0 - ((aColor >> 24) & 0x0ff) / 255.0; + auto pDeviceColor = rRenderState.DeviceColor.getArray(); + pDeviceColor[0] = ((aColor >> 16) & 0x0ff) / 255.0; + pDeviceColor[1] = ((aColor >> 8) & 0x0ff) / 255.0; + pDeviceColor[2] = ((aColor >> 0) & 0x0ff) / 255.0; + pDeviceColor[3] = 1.0 - ((aColor >> 24) & 0x0ff) / 255.0; } } diff --git a/sdext/source/presenter/PresenterGeometryHelper.cxx b/sdext/source/presenter/PresenterGeometryHelper.cxx index 67a81d63c766..b2ad35c63e94 100644 --- a/sdext/source/presenter/PresenterGeometryHelper.cxx +++ b/sdext/source/presenter/PresenterGeometryHelper.cxx @@ -235,10 +235,11 @@ Reference<rendering::XPolyPolygon2D> PresenterGeometryHelper::CreatePolygon( const sal_Int32 nCount (rBoxes.size()); Sequence<Sequence<geometry::RealPoint2D> > aPoints(nCount); + auto aPointsRange = asNonConstRange(aPoints); for (sal_Int32 nIndex=0; nIndex<nCount; ++nIndex) { const awt::Rectangle& rBox (rBoxes[nIndex]); - aPoints[nIndex] = Sequence<geometry::RealPoint2D> + aPointsRange[nIndex] = Sequence<geometry::RealPoint2D> { { o3tl::narrowing<double>(rBox.X), o3tl::narrowing<double>(rBox.Y) }, { o3tl::narrowing<double>(rBox.X), o3tl::narrowing<double>(rBox.Y+rBox.Height) }, diff --git a/sdext/source/presenter/PresenterPaneFactory.cxx b/sdext/source/presenter/PresenterPaneFactory.cxx index 258f956d00a1..b4aadc771f2c 100644 --- a/sdext/source/presenter/PresenterPaneFactory.cxx +++ b/sdext/source/presenter/PresenterPaneFactory.cxx @@ -241,14 +241,13 @@ Reference<XResource> PresenterPaneFactory::CreatePane ( } // Supply arguments. - Sequence<Any> aArguments (6); - aArguments[0] <<= rxPaneId; - aArguments[1] <<= rxParentPane->getWindow(); - aArguments[2] <<= rxParentPane->getCanvas(); - aArguments[3] <<= OUString(); - aArguments[4] <<= Reference<drawing::framework::XPaneBorderPainter>( - mpPresenterController->GetPaneBorderPainter()); - aArguments[5] <<= !bIsSpritePane; + Sequence<Any> aArguments{ Any(rxPaneId), + Any(rxParentPane->getWindow()), + Any(rxParentPane->getCanvas()), + Any(OUString()), + Any(Reference<drawing::framework::XPaneBorderPainter>( + mpPresenterController->GetPaneBorderPainter())), + Any(!bIsSpritePane) }; xPane->initialize(aArguments); // Store pane and canvases and windows in container. diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx index b1ae31bad822..5ca0ee630ca0 100644 --- a/sdext/source/presenter/PresenterSlideShowView.cxx +++ b/sdext/source/presenter/PresenterSlideShowView.cxx @@ -943,9 +943,7 @@ void PresenterSlideShowView::impl_addAndConfigureView() // disabling sound for the new slide show view. beans::PropertyValue aProperty; aProperty.Name = "IsSoundEnabled"; - Sequence<Any> aValues (2); - aValues[0] <<= xView; - aValues[1] <<= false; + Sequence<Any> aValues{ Any(xView), Any(false) }; aProperty.Value <<= aValues; mxSlideShow->setProperty(aProperty); } diff --git a/sdext/source/presenter/PresenterWindowManager.cxx b/sdext/source/presenter/PresenterWindowManager.cxx index 24115fa52523..d1ccaadc75d6 100644 --- a/sdext/source/presenter/PresenterWindowManager.cxx +++ b/sdext/source/presenter/PresenterWindowManager.cxx @@ -941,10 +941,11 @@ void PresenterWindowManager::PaintBackground (const awt::Rectangle& rUpdateBox) else { const util::Color aBackgroundColor (mpBackgroundBitmap->maReplacementColor); - aRenderState.DeviceColor[0] = ((aBackgroundColor >> 16) & 0x0ff) / 255.0; - aRenderState.DeviceColor[1] = ((aBackgroundColor >> 8) & 0x0ff) / 255.0; - aRenderState.DeviceColor[2] = ((aBackgroundColor >> 0) & 0x0ff) / 255.0; - aRenderState.DeviceColor[3] = ((aBackgroundColor >> 24) & 0x0ff) / 255.0; + auto pDeviceColor = aRenderState.DeviceColor.getArray(); + pDeviceColor[0] = ((aBackgroundColor >> 16) & 0x0ff) / 255.0; + pDeviceColor[1] = ((aBackgroundColor >> 8) & 0x0ff) / 255.0; + pDeviceColor[2] = ((aBackgroundColor >> 0) & 0x0ff) / 255.0; + pDeviceColor[3] = ((aBackgroundColor >> 24) & 0x0ff) / 255.0; mxParentCanvas->fillPolyPolygon( xBackgroundPolygon, aViewState, |