summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-10-29 10:02:46 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-10-31 06:56:57 +0100
commit8b9e502480812f61a1c8d37c465aaf93763fe156 (patch)
treec74b7baf71fe1ffd88a9819bb53b33fb75668392 /sdext
parentce22935a8586eda71fd29d4ff969d9cd7a2ec15b (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')
-rw-r--r--sdext/source/minimizer/configurationaccess.cxx49
-rw-r--r--sdext/source/minimizer/impoptimizer.cxx62
-rw-r--r--sdext/source/minimizer/optimizationstats.cxx13
-rw-r--r--sdext/source/minimizer/optimizerdialog.cxx15
-rw-r--r--sdext/source/minimizer/optimizerdialogcontrols.cxx20
-rw-r--r--sdext/source/pdfimport/filterdet.cxx27
-rw-r--r--sdext/source/pdfimport/misc/pwdinteract.cxx4
-rw-r--r--sdext/source/pdfimport/odf/odfemitter.cxx3
-rw-r--r--sdext/source/pdfimport/pdfiadaptor.cxx8
-rw-r--r--sdext/source/pdfimport/wrapper/wrapper.cxx15
-rw-r--r--sdext/source/presenter/PresenterAccessibility.cxx3
-rw-r--r--sdext/source/presenter/PresenterCanvasHelper.cxx9
-rw-r--r--sdext/source/presenter/PresenterGeometryHelper.cxx3
-rw-r--r--sdext/source/presenter/PresenterPaneFactory.cxx15
-rw-r--r--sdext/source/presenter/PresenterSlideShowView.cxx4
-rw-r--r--sdext/source/presenter/PresenterWindowManager.cxx9
16 files changed, 118 insertions, 141 deletions
diff --git a/sdext/source/minimizer/configurationaccess.cxx b/sdext/source/minimizer/configurationaccess.cxx
index 0ed089e341a2..3479918c2dc9 100644
--- a/sdext/source/minimizer/configurationaccess.cxx
+++ b/sdext/source/minimizer/configurationaccess.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <comphelper/propertysequence.hxx>
+#include <comphelper/propertyvalue.hxx>
#include <sal/macros.h>
#include <sal/log.hxx>
#include <tools/diagnose_ex.h>
@@ -427,38 +428,24 @@ sal_Int32 ConfigurationAccess::GetConfigProperty( const PPPOptimizerTokenEnum eP
Sequence< PropertyValue > ConfigurationAccess::GetConfigurationSequence()
{
- Sequence< PropertyValue > aRet( 15 );
OptimizerSettings& rSettings( maSettings.front() );
- aRet[ 0 ].Name = "JPEGCompression";
- aRet[ 0 ].Value <<= rSettings.mbJPEGCompression;
- aRet[ 1 ].Name = "JPEGQuality";
- aRet[ 1 ].Value <<= rSettings.mnJPEGQuality;
- aRet[ 2 ].Name = "RemoveCropArea";
- aRet[ 2 ].Value <<= rSettings.mbRemoveCropArea;
- aRet[ 3 ].Name = "ImageResolution";
- aRet[ 3 ].Value <<= rSettings.mnImageResolution;
- aRet[ 4 ].Name = "EmbedLinkedGraphics";
- aRet[ 4 ].Value <<= rSettings.mbEmbedLinkedGraphics;
- aRet[ 5 ].Name = "OLEOptimization";
- aRet[ 5 ].Value <<= rSettings.mbOLEOptimization;
- aRet[ 6 ].Name = "OLEOptimizationType";
- aRet[ 6 ].Value <<= rSettings.mnOLEOptimizationType;
- aRet[ 7 ].Name = "DeleteUnusedMasterPages";
- aRet[ 7 ].Value <<= rSettings.mbDeleteUnusedMasterPages;
- aRet[ 8 ].Name = "DeleteHiddenSlides";
- aRet[ 8 ].Value <<= rSettings.mbDeleteHiddenSlides;
- aRet[ 9 ].Name = "DeleteNotesPages";
- aRet[ 9 ].Value <<= rSettings.mbDeleteNotesPages;
- aRet[ 10].Name = "CustomShowName";
- aRet[ 10].Value <<= rSettings.maCustomShowName;
- aRet[ 11].Name = "SaveAsURL";
- aRet[ 11].Value <<= rSettings.maSaveAsURL;
- aRet[ 12].Name = "FilterName";
- aRet[ 12].Value <<= rSettings.maFilterName;
- aRet[ 13].Name = "OpenNewDocument";
- aRet[ 13].Value <<= rSettings.mbOpenNewDocument;
- aRet[ 14].Name = "EstimatedFileSize";
- aRet[ 14].Value <<= rSettings.mnEstimatedFileSize;
+ Sequence< PropertyValue > aRet{
+ comphelper::makePropertyValue("JPEGCompression", rSettings.mbJPEGCompression),
+ comphelper::makePropertyValue("JPEGQuality", rSettings.mnJPEGQuality),
+ comphelper::makePropertyValue("RemoveCropArea", rSettings.mbRemoveCropArea),
+ comphelper::makePropertyValue("ImageResolution", rSettings.mnImageResolution),
+ comphelper::makePropertyValue("EmbedLinkedGraphics", rSettings.mbEmbedLinkedGraphics),
+ comphelper::makePropertyValue("OLEOptimization", rSettings.mbOLEOptimization),
+ comphelper::makePropertyValue("OLEOptimizationType", rSettings.mnOLEOptimizationType),
+ comphelper::makePropertyValue("DeleteUnusedMasterPages", rSettings.mbDeleteUnusedMasterPages),
+ comphelper::makePropertyValue("DeleteHiddenSlides", rSettings.mbDeleteHiddenSlides),
+ comphelper::makePropertyValue("DeleteNotesPages", rSettings.mbDeleteNotesPages),
+ comphelper::makePropertyValue("CustomShowName", rSettings.maCustomShowName),
+ comphelper::makePropertyValue("SaveAsURL", rSettings.maSaveAsURL),
+ comphelper::makePropertyValue("FilterName", rSettings.maFilterName),
+ comphelper::makePropertyValue("OpenNewDocument", rSettings.mbOpenNewDocument),
+ comphelper::makePropertyValue("EstimatedFileSize", rSettings.mnEstimatedFileSize)
+ };
return aRet;
}
diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx
index 6f9e2416ac94..cf8b875ebe21 100644
--- a/sdext/source/minimizer/impoptimizer.cxx
+++ b/sdext/source/minimizer/impoptimizer.cxx
@@ -50,6 +50,8 @@
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
+#include <comphelper/propertyvalue.hxx>
+
using namespace ::std;
using namespace ::com::sun::star;
using namespace ::com::sun::star::io;
@@ -202,31 +204,22 @@ static void ImpCompressGraphic( Reference< XGraphicProvider > const & rxGraphicP
{
if ( rxGraphicProvider.is() && rxOutputStream.is() )
{
- Sequence< PropertyValue > aFilterData( 8 );
- aFilterData[ 0 ].Name = "ImageResolution";
- aFilterData[ 0 ].Value <<= nImageResolution;
- aFilterData[ 1 ].Name = "ColorMode"; // todo: jpeg color mode (0->true color, 1->greyscale)
- aFilterData[ 1 ].Value <<= sal_Int32(0);
- aFilterData[ 2 ].Name = "Quality"; // quality that is used if we export to jpeg
- aFilterData[ 2 ].Value <<= nJPEGQuality;
- aFilterData[ 3 ].Name = "Compression"; // compression that is used if we export to png
- aFilterData[ 3 ].Value <<= sal_Int32(6);
- aFilterData[ 4 ].Name = "Interlaced"; // interlaced is turned off if we export to png
- aFilterData[ 4 ].Value <<= sal_Int32(0);
- aFilterData[ 5 ].Name = "LogicalSize";
- aFilterData[ 5 ].Value <<= rLogicalSize;
- aFilterData[ 6 ].Name = "RemoveCropArea";
- aFilterData[ 6 ].Value <<= bRemoveCropping;
- aFilterData[ 7 ].Name = "GraphicCropLogic";
- aFilterData[ 7 ].Value <<= rGraphicCropLogic;
-
- Sequence< PropertyValue > aArgs( 3 );
- aArgs[ 0 ].Name = "MimeType"; // the GraphicProvider is using "MimeType", the GraphicExporter "MediaType"...
- aArgs[ 0 ].Value <<= rDestMimeType;
- aArgs[ 1 ].Name = "OutputStream";
- aArgs[ 1 ].Value <<= rxOutputStream;
- aArgs[ 2 ].Name = "FilterData";
- aArgs[ 2 ].Value <<= aFilterData;
+ Sequence< PropertyValue > aFilterData{
+ comphelper::makePropertyValue("ImageResolution", nImageResolution),
+ comphelper::makePropertyValue("ColorMode", sal_Int32(0)), // todo: jpeg color mode (0->true color, 1->greyscale)
+ comphelper::makePropertyValue("Quality", nJPEGQuality), // quality that is used if we export to jpeg
+ comphelper::makePropertyValue("Compression", sal_Int32(6)), // compression that is used if we export to png
+ comphelper::makePropertyValue("Interlaced", sal_Int32(0)), // interlaced is turned off if we export to png
+ comphelper::makePropertyValue("LogicalSize", rLogicalSize),
+ comphelper::makePropertyValue("RemoveCropArea", bRemoveCropping),
+ comphelper::makePropertyValue("GraphicCropLogic", rGraphicCropLogic)
+ };
+
+ Sequence< PropertyValue > aArgs{
+ comphelper::makePropertyValue("MimeType", rDestMimeType), // the GraphicProvider is using "MimeType", the GraphicExporter "MediaType"...
+ comphelper::makePropertyValue("OutputStream", rxOutputStream),
+ comphelper::makePropertyValue("FilterData", aFilterData)
+ };
rxGraphicProvider->storeGraphic( rxGraphic, aArgs );
}
@@ -328,9 +321,8 @@ static Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentCont
Reference< XInputStream > xInputStream( xTempFile->getInputStream() );
Reference< XSeekable > xSeekable( xInputStream, UNO_QUERY_THROW );
xSeekable->seek( 0 );
- Sequence< PropertyValue > aArgs( 1 );
- aArgs[ 0 ].Name = "InputStream";
- aArgs[ 0 ].Value <<= xInputStream;
+ Sequence< PropertyValue > aArgs{ comphelper::makePropertyValue(
+ "InputStream", xInputStream) };
xNewGraphic = xGraphicProvider->queryGraphic( aArgs );
}
}
@@ -347,9 +339,8 @@ static Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentCont
Reference< XInputStream > xInputStream( xTempFile->getInputStream() );
Reference< XSeekable > xSeekable( xInputStream, UNO_QUERY_THROW );
xSeekable->seek( 0 );
- Sequence< PropertyValue > aArgs( 1 );
- aArgs[ 0 ].Name = "InputStream";
- aArgs[ 0 ].Value <<= xInputStream;
+ Sequence< PropertyValue > aArgs{ comphelper::makePropertyValue("InputStream",
+ xInputStream) };
xNewGraphic = xGraphicProvider->queryGraphic( aArgs );
}
}
@@ -633,8 +624,9 @@ void ImpOptimizer::Optimize( const Sequence< PropertyValue >& rArguments )
{
int nLength = aArguments.getLength();
aArguments.realloc( nLength + 1 );
- aArguments[ nLength ].Name = "FilterName";
- aArguments[ nLength ].Value <<= maFilterName;
+ auto pArguments = aArguments.getArray();
+ pArguments[ nLength ].Name = "FilterName";
+ pArguments[ nLength ].Value <<= maFilterName;
}
xStorable->storeToURL( maSaveAsURL, aArguments );
if ( !nSourceSize )
@@ -648,9 +640,7 @@ void ImpOptimizer::Optimize( const Sequence< PropertyValue >& rArguments )
xSelf = xDesktop->findFrame( "_blank", FrameSearchFlag::CREATE );
Reference< XComponentLoader > xComponentLoader( xSelf, UNO_QUERY );
- Sequence< PropertyValue > aLoadProps( 1 );
- aLoadProps[ 0 ].Name = "Hidden";
- aLoadProps[ 0 ].Value <<= true;
+ Sequence< PropertyValue > aLoadProps{ comphelper::makePropertyValue("Hidden", true) };
mxModel.set( xComponentLoader->loadComponentFromURL(
maSaveAsURL, "_self", 0, aLoadProps ), UNO_QUERY );
}
diff --git a/sdext/source/minimizer/optimizationstats.cxx b/sdext/source/minimizer/optimizationstats.cxx
index deed337c712a..1deef26ac059 100644
--- a/sdext/source/minimizer/optimizationstats.cxx
+++ b/sdext/source/minimizer/optimizationstats.cxx
@@ -23,6 +23,10 @@
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
+#include <comphelper/propertyvalue.hxx>
+
+#include <algorithm>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -51,13 +55,10 @@ const uno::Any* OptimizationStats::GetStatusValue( const PPPOptimizerTokenEnum e
css::beans::PropertyValues OptimizationStats::GetStatusSequence()
{
- int i = 0;
uno::Sequence< PropertyValue > aStatsSequence( maStats.size() );
- for( const auto& rEntry : maStats )
- {
- aStatsSequence[ i ].Name = TKGet( rEntry.first );
- aStatsSequence[ i++ ].Value = rEntry.second;
- }
+ std::transform(maStats.begin(), maStats.end(), aStatsSequence.getArray(),
+ [](const auto& rEntry)
+ { return comphelper::makePropertyValue(TKGet( rEntry.first ), rEntry.second); });
return aStatsSequence;
}
diff --git a/sdext/source/minimizer/optimizerdialog.cxx b/sdext/source/minimizer/optimizerdialog.cxx
index ab392266e56d..bdfca5f326cd 100644
--- a/sdext/source/minimizer/optimizerdialog.cxx
+++ b/sdext/source/minimizer/optimizerdialog.cxx
@@ -31,6 +31,8 @@
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/io/IOException.hpp>
#include <com/sun/star/util/XModifiable.hpp>
+
+#include <comphelper/propertyvalue.hxx>
#include <sal/macros.h>
#include <osl/time.h>
#include <vcl/errinf.hxx>
@@ -595,14 +597,11 @@ void ActionListener::actionPerformed( const ActionEvent& rEvent )
aURL.Protocol = "vnd.com.sun.star.comp.PPPOptimizer:";
aURL.Path = "optimize";
- Sequence< PropertyValue > lArguments( 3 );
- lArguments[ 0 ].Name = "Settings";
- lArguments[ 0 ].Value <<= mrOptimizerDialog.GetConfigurationSequence();
- lArguments[ 1 ].Name = "StatusDispatcher";
- lArguments[ 1 ].Value <<= mrOptimizerDialog.GetStatusDispatcher();
- lArguments[ 2 ].Name = "InformationDialog";
- lArguments[ 2 ].Value <<= mrOptimizerDialog.GetFrame();
-
+ Sequence< PropertyValue > lArguments{
+ comphelper::makePropertyValue("Settings", mrOptimizerDialog.GetConfigurationSequence()),
+ comphelper::makePropertyValue("StatusDispatcher", mrOptimizerDialog.GetStatusDispatcher()),
+ comphelper::makePropertyValue("InformationDialog", mrOptimizerDialog.GetFrame())
+ };
ErrCode errorCode;
try
diff --git a/sdext/source/minimizer/optimizerdialogcontrols.cxx b/sdext/source/minimizer/optimizerdialogcontrols.cxx
index 23011e50716b..8b98f2a5faaf 100644
--- a/sdext/source/minimizer/optimizerdialogcontrols.cxx
+++ b/sdext/source/minimizer/optimizerdialogcontrols.cxx
@@ -393,9 +393,10 @@ void OptimizerDialog::UpdateControlStatesPage0()
if ( rList.size() > 1 ) // the first session in the list is the actual one -> skipping first one
{
aItemList.realloc( rList.size() - 1 );
+ auto pItemList = aItemList.getArray();
for ( std::vector<OptimizerSettings>::size_type i = 1; i < rList.size(); i++ )
{
- aItemList[ i - 1 ] = rList[ i ].maName;
+ pItemList[ i - 1 ] = rList[ i ].maName;
if ( nSelectedItem < 0 )
{
if ( rList[ i ] == rList[ 0 ] )
@@ -407,8 +408,7 @@ void OptimizerDialog::UpdateControlStatesPage0()
Sequence< short > aSelectedItems;
if ( nSelectedItem >= 0 )
{
- aSelectedItems.realloc( 1 );
- aSelectedItems[ 0 ] = nSelectedItem;
+ aSelectedItems = { nSelectedItem };
if ( nSelectedItem > 2 ) // only allowing to delete custom themes, the first can|t be deleted
bRemoveButtonEnabled = true;
}
@@ -517,11 +517,12 @@ void OptimizerDialog::UpdateControlStatesPage2()
}
void OptimizerDialog::InitPage2()
{
- Sequence< OUString > aResolutionItemList( 4 );
- aResolutionItemList[ 0 ] = getString( STR_IMAGE_RESOLUTION_0 ).getToken( 1, ';' );
- aResolutionItemList[ 1 ] = getString( STR_IMAGE_RESOLUTION_1 ).getToken( 1, ';' );
- aResolutionItemList[ 2 ] = getString( STR_IMAGE_RESOLUTION_2 ).getToken( 1, ';' );
- aResolutionItemList[ 3 ] = getString( STR_IMAGE_RESOLUTION_3 ).getToken( 1, ';' );
+ Sequence< OUString > aResolutionItemList{
+ getString( STR_IMAGE_RESOLUTION_0 ).getToken( 1, ';' ),
+ getString( STR_IMAGE_RESOLUTION_1 ).getToken( 1, ';' ),
+ getString( STR_IMAGE_RESOLUTION_2 ).getToken( 1, ';' ),
+ getString( STR_IMAGE_RESOLUTION_3 ).getToken( 1, ';' )
+ };
std::vector< OUString > aControlList
{
@@ -619,8 +620,9 @@ void OptimizerDialog::UpdateControlStatesPage4()
if ( rList.size() > 1 ) // the first session in the list is the actual one -> skipping first one
{
aItemList.realloc( rList.size() - 1 );
+ auto pItemList = aItemList.getArray();
for ( std::vector<OptimizerSettings>::size_type w = 1; w < rList.size(); w++ )
- aItemList[ w - 1 ] = rList[ w ].maName;
+ pItemList[ w - 1 ] = rList[ w ].maName;
}
setControlProperty( "ComboBox0Pg4", "StringItemList", Any( aItemList ) );
diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx
index dcda24fe2184..18751a00490a 100644
--- a/sdext/source/pdfimport/filterdet.cxx
+++ b/sdext/source/pdfimport/filterdet.cxx
@@ -320,16 +320,18 @@ OUString SAL_CALL PDFDetector::detect( uno::Sequence< beans::PropertyValue >& rF
{
nFilterNamePos = nAttribs;
rFilterData.realloc( ++nAttribs );
- rFilterData[ nFilterNamePos ].Name = "FilterName";
+ rFilterData.getArray()[ nFilterNamePos ].Name = "FilterName";
}
+ auto pFilterData = rFilterData.getArray();
aOutTypeName = "pdf_Portable_Document_Format";
- rFilterData[nFilterNamePos].Value <<= aOutFilterName;
+ pFilterData[nFilterNamePos].Value <<= aOutFilterName;
if( xEmbedStream.is() )
{
rFilterData.realloc( ++nAttribs );
- rFilterData[nAttribs-1].Name = "EmbeddedSubstream";
- rFilterData[nAttribs-1].Value <<= xEmbedStream;
+ pFilterData = rFilterData.getArray();
+ pFilterData[nAttribs-1].Name = "EmbeddedSubstream";
+ pFilterData[nAttribs-1].Value <<= xEmbedStream;
}
if( !aPwd.isEmpty() )
{
@@ -337,19 +339,24 @@ OUString SAL_CALL PDFDetector::detect( uno::Sequence< beans::PropertyValue >& rF
{
nPwdPos = nAttribs;
rFilterData.realloc( ++nAttribs );
- rFilterData[ nPwdPos ].Name = "Password";
+ pFilterData = rFilterData.getArray();
+ pFilterData[ nPwdPos ].Name = "Password";
}
- rFilterData[ nPwdPos ].Value <<= aPwd;
+ pFilterData[ nPwdPos ].Value <<= aPwd;
}
}
else
{
+ css::beans::PropertyValue* pFilterData;
if( nFilterNamePos == -1 )
{
nFilterNamePos = nAttribs;
rFilterData.realloc( ++nAttribs );
- rFilterData[ nFilterNamePos ].Name = "FilterName";
+ pFilterData = rFilterData.getArray();
+ pFilterData[ nFilterNamePos ].Name = "FilterName";
}
+ else
+ pFilterData = rFilterData.getArray();
const sal_Int32 nDocumentType = 0; //const sal_Int32 nDocumentType = queryDocumentTypeDialog(m_xContext,aURL);
if( nDocumentType < 0 )
@@ -359,15 +366,15 @@ OUString SAL_CALL PDFDetector::detect( uno::Sequence< beans::PropertyValue >& rF
else switch( nDocumentType )
{
case 0:
- rFilterData[nFilterNamePos].Value <<= OUString( "draw_pdf_import" );
+ pFilterData[nFilterNamePos].Value <<= OUString( "draw_pdf_import" );
break;
case 1:
- rFilterData[nFilterNamePos].Value <<= OUString( "impress_pdf_import" );
+ pFilterData[nFilterNamePos].Value <<= OUString( "impress_pdf_import" );
break;
case 2:
- rFilterData[nFilterNamePos].Value <<= OUString( "writer_pdf_import" );
+ pFilterData[nFilterNamePos].Value <<= OUString( "writer_pdf_import" );
break;
default:
diff --git a/sdext/source/pdfimport/misc/pwdinteract.cxx b/sdext/source/pdfimport/misc/pwdinteract.cxx
index 9885a6606a54..8bf54bddb99f 100644
--- a/sdext/source/pdfimport/misc/pwdinteract.cxx
+++ b/sdext/source/pdfimport/misc/pwdinteract.cxx
@@ -92,9 +92,7 @@ uno::Any PDFPasswordRequest::getRequest()
uno::Sequence< uno::Reference< task::XInteractionContinuation > > PDFPasswordRequest::getContinuations()
{
- uno::Sequence< uno::Reference< task::XInteractionContinuation > > aRet( 1 );
- aRet[0] = this;
- return aRet;
+ return { this };
}
void PDFPasswordRequest::setPassword( const OUString& rPwd )
diff --git a/sdext/source/pdfimport/odf/odfemitter.cxx b/sdext/source/pdfimport/odf/odfemitter.cxx
index aa993ae1fa6a..e38e81fce917 100644
--- a/sdext/source/pdfimport/odf/odfemitter.cxx
+++ b/sdext/source/pdfimport/odf/odfemitter.cxx
@@ -52,10 +52,9 @@ public:
OdfEmitter::OdfEmitter( const uno::Reference<io::XOutputStream>& xOutput ) :
m_xOutput( xOutput ),
- m_aLineFeed(1)
+ m_aLineFeed{ '\n' }
{
OSL_PRECOND(m_xOutput.is(), "OdfEmitter(): invalid output stream");
- m_aLineFeed[0] = '\n';
write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
}
diff --git a/sdext/source/pdfimport/pdfiadaptor.cxx b/sdext/source/pdfimport/pdfiadaptor.cxx
index 14060715c83c..dc2def1c58e3 100644
--- a/sdext/source/pdfimport/pdfiadaptor.cxx
+++ b/sdext/source/pdfimport/pdfiadaptor.cxx
@@ -129,9 +129,7 @@ sal_Bool SAL_CALL PDFIHybridAdaptor::filter( const uno::Sequence< beans::Propert
}
if( xSubStream.is() )
{
- uno::Sequence< uno::Any > aArgs( 2 );
- aArgs[0] <<= m_xModel;
- aArgs[1] <<= xSubStream;
+ uno::Sequence< uno::Any > aArgs{ uno::Any(m_xModel), uno::Any(xSubStream) };
SAL_INFO("sdext.pdfimport", "try to instantiate subfilter" );
uno::Reference< document::XFilter > xSubFilter;
@@ -158,9 +156,9 @@ sal_Bool SAL_CALL PDFIHybridAdaptor::filter( const uno::Sequence< beans::Propert
{
nPwPos = aFilterData.getLength();
aFilterData.realloc( nPwPos+1 );
- aFilterData[nPwPos].Name = "Password";
+ aFilterData.getArray()[nPwPos].Name = "Password";
}
- aFilterData[nPwPos].Value <<= aPwd;
+ aFilterData.getArray()[nPwPos].Value <<= aPwd;
bRet = xSubFilter->filter( aFilterData );
}
else
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx
index 3553a588802c..0560826d5727 100644
--- a/sdext/source/pdfimport/wrapper/wrapper.cxx
+++ b/sdext/source/pdfimport/wrapper/wrapper.cxx
@@ -697,8 +697,7 @@ uno::Sequence<beans::PropertyValue> LineParser::readImageImpl()
uno::Sequence<sal_Int8> aDataSequence(nImageSize);
readBinaryData( aDataSequence );
- uno::Sequence< uno::Any > aStreamCreationArgs(1);
- aStreamCreationArgs[0] <<= aDataSequence;
+ uno::Sequence< uno::Any > aStreamCreationArgs{ uno::Any(aDataSequence) };
uno::Reference< uno::XComponentContext > xContext( m_parser.m_xContext, uno::UNO_SET_THROW );
uno::Reference< lang::XMultiComponentFactory > xFactory( xContext->getServiceManager(), uno::UNO_SET_THROW );
@@ -729,19 +728,17 @@ void LineParser::readImage()
uno::Sequence<sal_Int8> aDataSequence(nMaskColors);
readBinaryData( aDataSequence );
- uno::Sequence<uno::Any> aMaskRanges(2);
-
uno::Sequence<double> aMinRange(nMaskColors/2);
+ auto pMinRange = aMinRange.getArray();
uno::Sequence<double> aMaxRange(nMaskColors/2);
+ auto pMaxRange = aMaxRange.getArray();
for( sal_Int32 i=0; i<nMaskColors/2; ++i )
{
- aMinRange[i] = aDataSequence[i] / 255.0;
- aMaxRange[i] = aDataSequence[i+nMaskColors/2] / 255.0;
+ pMinRange[i] = aDataSequence[i] / 255.0;
+ pMaxRange[i] = aDataSequence[i+nMaskColors/2] / 255.0;
}
- aMaskRanges[0] <<= aMinRange;
- aMaskRanges[1] <<= aMaxRange;
-
+ uno::Sequence<uno::Any> aMaskRanges{ uno::Any(aMinRange), uno::Any(aMaxRange) };
m_parser.m_pSink->drawColorMaskedImage( aImg, aMaskRanges );
}
else
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,