Prepare for removal of non-const operator[] from Sequence in unotools
Change-Id: I720d1c1e4a8d32e8a7c7ac62ab9cf988bac31d01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124406 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
@@ -250,6 +250,7 @@ void SvtCompatibilityOptions_Impl::ImplCommit()
|
|||||||
ClearNodeSet( SETNODE_ALLFILEFORMATS );
|
ClearNodeSet( SETNODE_ALLFILEFORMATS );
|
||||||
|
|
||||||
Sequence< PropertyValue > lPropertyValues( SvtCompatibilityEntry::getElementCount() - 1 );
|
Sequence< PropertyValue > lPropertyValues( SvtCompatibilityEntry::getElementCount() - 1 );
|
||||||
|
auto lPropertyValuesRange = asNonConstRange(lPropertyValues);
|
||||||
sal_uInt32 nNewCount = m_aOptions.size();
|
sal_uInt32 nNewCount = m_aOptions.size();
|
||||||
for ( sal_uInt32 nItem = 0; nItem < nNewCount; ++nItem )
|
for ( sal_uInt32 nItem = 0; nItem < nNewCount; ++nItem )
|
||||||
{
|
{
|
||||||
@@ -258,8 +259,8 @@ void SvtCompatibilityOptions_Impl::ImplCommit()
|
|||||||
|
|
||||||
for ( int i = static_cast<int>(SvtCompatibilityEntry::Index::Module); i < static_cast<int>(SvtCompatibilityEntry::Index::INVALID); ++i )
|
for ( int i = static_cast<int>(SvtCompatibilityEntry::Index::Module); i < static_cast<int>(SvtCompatibilityEntry::Index::INVALID); ++i )
|
||||||
{
|
{
|
||||||
lPropertyValues[ i - 1 ].Name = sNode + SvtCompatibilityEntry::getName( SvtCompatibilityEntry::Index(i) );
|
lPropertyValuesRange[ i - 1 ].Name = sNode + SvtCompatibilityEntry::getName( SvtCompatibilityEntry::Index(i) );
|
||||||
lPropertyValues[ i - 1 ].Value = aItem.getValue( SvtCompatibilityEntry::Index(i) );
|
lPropertyValuesRange[ i - 1 ].Value = aItem.getValue( SvtCompatibilityEntry::Index(i) );
|
||||||
}
|
}
|
||||||
|
|
||||||
SetSetProperties( SETNODE_ALLFILEFORMATS, lPropertyValues );
|
SetSetProperties( SETNODE_ALLFILEFORMATS, lPropertyValues );
|
||||||
@@ -273,6 +274,7 @@ Sequence< OUString > SvtCompatibilityOptions_Impl::impl_GetPropertyNames( Sequen
|
|||||||
|
|
||||||
// expand list to result list ...
|
// expand list to result list ...
|
||||||
Sequence< OUString > lProperties( rItems.getLength() * ( SvtCompatibilityEntry::getElementCount() - 1 ) );
|
Sequence< OUString > lProperties( rItems.getLength() * ( SvtCompatibilityEntry::getElementCount() - 1 ) );
|
||||||
|
auto lPropertiesRange = asNonConstRange(lProperties);
|
||||||
|
|
||||||
sal_Int32 nDestStep = 0;
|
sal_Int32 nDestStep = 0;
|
||||||
// Copy entries to destination and expand every item with 2 supported sub properties.
|
// Copy entries to destination and expand every item with 2 supported sub properties.
|
||||||
@@ -281,7 +283,7 @@ Sequence< OUString > SvtCompatibilityOptions_Impl::impl_GetPropertyNames( Sequen
|
|||||||
OUString sFixPath = SETNODE_ALLFILEFORMATS PATHDELIMITER + rItem + PATHDELIMITER;
|
OUString sFixPath = SETNODE_ALLFILEFORMATS PATHDELIMITER + rItem + PATHDELIMITER;
|
||||||
for ( int i = static_cast<int>(SvtCompatibilityEntry::Index::Module); i < static_cast<int>(SvtCompatibilityEntry::Index::INVALID); ++i )
|
for ( int i = static_cast<int>(SvtCompatibilityEntry::Index::Module); i < static_cast<int>(SvtCompatibilityEntry::Index::INVALID); ++i )
|
||||||
{
|
{
|
||||||
lProperties[ nDestStep ] = sFixPath + SvtCompatibilityEntry::getName( SvtCompatibilityEntry::Index(i) );
|
lPropertiesRange[ nDestStep ] = sFixPath + SvtCompatibilityEntry::getName( SvtCompatibilityEntry::Index(i) );
|
||||||
nDestStep++;
|
nDestStep++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -193,6 +193,7 @@ void ConfigItem::impl_packLocalizedProperties( const Sequence< OUString >&
|
|||||||
// The result list we pack into the return any. We never change size of lists!
|
// The result list we pack into the return any. We never change size of lists!
|
||||||
nSourceSize = lInNames.getLength();
|
nSourceSize = lInNames.getLength();
|
||||||
lOutValues.realloc( nSourceSize );
|
lOutValues.realloc( nSourceSize );
|
||||||
|
auto plOutValues = lOutValues.getArray();
|
||||||
|
|
||||||
// Algorithm:
|
// Algorithm:
|
||||||
// Copy all names and values from in to out lists.
|
// Copy all names and values from in to out lists.
|
||||||
@@ -213,22 +214,23 @@ void ConfigItem::impl_packLocalizedProperties( const Sequence< OUString >&
|
|||||||
lPropertyNames = xSetAccess->getElementNames();
|
lPropertyNames = xSetAccess->getElementNames();
|
||||||
nPropertiesSize = lPropertyNames.getLength();
|
nPropertiesSize = lPropertyNames.getLength();
|
||||||
lProperties.realloc( nPropertiesSize );
|
lProperties.realloc( nPropertiesSize );
|
||||||
|
auto plProperties = lProperties.getArray();
|
||||||
|
|
||||||
for( nPropertyCounter=0; nPropertyCounter<nPropertiesSize; ++nPropertyCounter )
|
for( nPropertyCounter=0; nPropertyCounter<nPropertiesSize; ++nPropertyCounter )
|
||||||
{
|
{
|
||||||
lProperties[nPropertyCounter].Name = lPropertyNames[nPropertyCounter];
|
plProperties[nPropertyCounter].Name = lPropertyNames[nPropertyCounter];
|
||||||
OUString sLocaleValue;
|
OUString sLocaleValue;
|
||||||
xSetAccess->getByName( lPropertyNames[nPropertyCounter] ) >>= sLocaleValue;
|
xSetAccess->getByName( lPropertyNames[nPropertyCounter] ) >>= sLocaleValue;
|
||||||
lProperties[nPropertyCounter].Value <<= sLocaleValue;
|
plProperties[nPropertyCounter].Value <<= sLocaleValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
lOutValues[nDestinationCounter] <<= lProperties;
|
plOutValues[nDestinationCounter] <<= lProperties;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ... or copy normal items to return lists directly.
|
// ... or copy normal items to return lists directly.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lOutValues[nDestinationCounter] = lInValues[nSourceCounter];
|
plOutValues[nDestinationCounter] = lInValues[nSourceCounter];
|
||||||
}
|
}
|
||||||
++nDestinationCounter;
|
++nDestinationCounter;
|
||||||
}
|
}
|
||||||
@@ -258,7 +260,9 @@ void ConfigItem::impl_unpackLocalizedProperties( const Sequence< OUString >
|
|||||||
nSourceSize = lInNames.getLength();
|
nSourceSize = lInNames.getLength();
|
||||||
|
|
||||||
lOutNames.realloc ( nSourceSize );
|
lOutNames.realloc ( nSourceSize );
|
||||||
|
auto plOutNames = lOutNames.getArray();
|
||||||
lOutValues.realloc ( nSourceSize );
|
lOutValues.realloc ( nSourceSize );
|
||||||
|
auto plOutValues = lOutValues.getArray();
|
||||||
|
|
||||||
// Algorithm:
|
// Algorithm:
|
||||||
// Copy all names and values from const to return lists.
|
// Copy all names and values from const to return lists.
|
||||||
@@ -279,13 +283,15 @@ void ConfigItem::impl_unpackLocalizedProperties( const Sequence< OUString >
|
|||||||
if( (nDestinationCounter+nPropertiesSize) > lOutNames.getLength() )
|
if( (nDestinationCounter+nPropertiesSize) > lOutNames.getLength() )
|
||||||
{
|
{
|
||||||
lOutNames.realloc ( nDestinationCounter+nPropertiesSize );
|
lOutNames.realloc ( nDestinationCounter+nPropertiesSize );
|
||||||
|
plOutNames = lOutNames.getArray();
|
||||||
lOutValues.realloc ( nDestinationCounter+nPropertiesSize );
|
lOutValues.realloc ( nDestinationCounter+nPropertiesSize );
|
||||||
|
plOutValues = lOutValues.getArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
for( const auto& rProperty : std::as_const(lProperties) )
|
for( const auto& rProperty : std::as_const(lProperties) )
|
||||||
{
|
{
|
||||||
lOutNames [nDestinationCounter] = sNodeName + rProperty.Name;
|
plOutNames [nDestinationCounter] = sNodeName + rProperty.Name;
|
||||||
lOutValues[nDestinationCounter] = rProperty.Value;
|
plOutValues[nDestinationCounter] = rProperty.Value;
|
||||||
++nDestinationCounter;
|
++nDestinationCounter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -295,11 +301,13 @@ void ConfigItem::impl_unpackLocalizedProperties( const Sequence< OUString >
|
|||||||
if( (nDestinationCounter+1) > lOutNames.getLength() )
|
if( (nDestinationCounter+1) > lOutNames.getLength() )
|
||||||
{
|
{
|
||||||
lOutNames.realloc ( nDestinationCounter+1 );
|
lOutNames.realloc ( nDestinationCounter+1 );
|
||||||
|
plOutNames = lOutNames.getArray();
|
||||||
lOutValues.realloc ( nDestinationCounter+1 );
|
lOutValues.realloc ( nDestinationCounter+1 );
|
||||||
|
plOutValues = lOutValues.getArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
lOutNames [nDestinationCounter] = lInNames [nSourceCounter];
|
plOutNames [nDestinationCounter] = lInNames [nSourceCounter];
|
||||||
lOutValues[nDestinationCounter] = lInValues[nSourceCounter];
|
plOutValues[nDestinationCounter] = lInValues[nSourceCounter];
|
||||||
++nDestinationCounter;
|
++nDestinationCounter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -313,10 +321,11 @@ Sequence< sal_Bool > ConfigItem::GetReadOnlyStates(const css::uno::Sequence< OUS
|
|||||||
// Every item must match to length of incoming name list.
|
// Every item must match to length of incoming name list.
|
||||||
sal_Int32 nCount = rNames.getLength();
|
sal_Int32 nCount = rNames.getLength();
|
||||||
Sequence< sal_Bool > lStates(nCount);
|
Sequence< sal_Bool > lStates(nCount);
|
||||||
|
sal_Bool* plStates = lStates.getArray();
|
||||||
|
|
||||||
// We must be sure to return a valid information every time!
|
// We must be sure to return a valid information every time!
|
||||||
// Set default to non readonly... similar to the configuration handling of this property.
|
// Set default to non readonly... similar to the configuration handling of this property.
|
||||||
std::fill_n(lStates.getArray(), lStates.getLength(), false);
|
std::fill_n(plStates, lStates.getLength(), false);
|
||||||
|
|
||||||
// no access - no information...
|
// no access - no information...
|
||||||
Reference< XHierarchicalNameAccess > xHierarchyAccess = GetTree();
|
Reference< XHierarchicalNameAccess > xHierarchyAccess = GetTree();
|
||||||
@@ -374,7 +383,7 @@ Sequence< sal_Bool > ConfigItem::GetReadOnlyStates(const css::uno::Sequence< OUS
|
|||||||
}
|
}
|
||||||
|
|
||||||
Property aProp = xInfo->getPropertyByName(sProperty);
|
Property aProp = xInfo->getPropertyByName(sProperty);
|
||||||
lStates[i] = ((aProp.Attributes & PropertyAttribute::READONLY) == PropertyAttribute::READONLY);
|
plStates[i] = (aProp.Attributes & PropertyAttribute::READONLY) == PropertyAttribute::READONLY;
|
||||||
}
|
}
|
||||||
catch (const Exception&)
|
catch (const Exception&)
|
||||||
{
|
{
|
||||||
|
@@ -119,13 +119,12 @@ utl::ConfigManager & utl::ConfigManager::getConfigManager() {
|
|||||||
|
|
||||||
css::uno::Reference< css::container::XHierarchicalNameAccess >
|
css::uno::Reference< css::container::XHierarchicalNameAccess >
|
||||||
utl::ConfigManager::acquireTree(utl::ConfigItem const & item) {
|
utl::ConfigManager::acquireTree(utl::ConfigItem const & item) {
|
||||||
css::uno::Sequence< css::uno::Any > args(1);
|
css::uno::Sequence< css::uno::Any > args{ css::uno::Any(css::beans::NamedValue(
|
||||||
args[0] <<= css::beans::NamedValue(
|
|
||||||
"nodepath",
|
"nodepath",
|
||||||
css::uno::makeAny("/org.openoffice." + item.GetSubTreeName()));
|
css::uno::makeAny("/org.openoffice." + item.GetSubTreeName()))) };
|
||||||
if (item.GetMode() & ConfigItemMode::AllLocales) {
|
if (item.GetMode() & ConfigItemMode::AllLocales) {
|
||||||
args.realloc(2);
|
args.realloc(2);
|
||||||
args[1] <<= css::beans::NamedValue("locale", css::uno::makeAny(OUString("*")));
|
args.getArray()[1] <<= css::beans::NamedValue("locale", css::uno::makeAny(OUString("*")));
|
||||||
}
|
}
|
||||||
return css::uno::Reference< css::container::XHierarchicalNameAccess >(
|
return css::uno::Reference< css::container::XHierarchicalNameAccess >(
|
||||||
getConfigurationProvider()->createInstanceWithArguments(
|
getConfigurationProvider()->createInstanceWithArguments(
|
||||||
@@ -136,10 +135,9 @@ utl::ConfigManager::acquireTree(utl::ConfigItem const & item) {
|
|||||||
|
|
||||||
css::uno::Reference< css::container::XHierarchicalNameAccess >
|
css::uno::Reference< css::container::XHierarchicalNameAccess >
|
||||||
utl::ConfigManager::acquireTree(std::u16string_view rSubTreeName) {
|
utl::ConfigManager::acquireTree(std::u16string_view rSubTreeName) {
|
||||||
css::uno::Sequence< css::uno::Any > args(1);
|
css::uno::Sequence< css::uno::Any > args{ css::uno::Any(css::beans::NamedValue(
|
||||||
args[0] <<= css::beans::NamedValue(
|
|
||||||
"nodepath",
|
"nodepath",
|
||||||
css::uno::makeAny(OUString::Concat(u"/org.openoffice.") + rSubTreeName));
|
css::uno::makeAny(OUString::Concat(u"/org.openoffice.") + rSubTreeName))) };
|
||||||
return css::uno::Reference< css::container::XHierarchicalNameAccess >(
|
return css::uno::Reference< css::container::XHierarchicalNameAccess >(
|
||||||
getConfigurationProvider()->createInstanceWithArguments(
|
getConfigurationProvider()->createInstanceWithArguments(
|
||||||
"com.sun.star.configuration.ConfigurationUpdateAccess",
|
"com.sun.star.configuration.ConfigurationUpdateAccess",
|
||||||
|
@@ -314,6 +314,7 @@ static void lcl_SortAndExpandPropertyNames( const Sequence< OUString >& lSource
|
|||||||
sal_Int32 nDestinationStep = lDestination.getLength(); // start on end of current list ...!
|
sal_Int32 nDestinationStep = lDestination.getLength(); // start on end of current list ...!
|
||||||
|
|
||||||
lDestination.realloc( (nSourceCount*PROPERTYCOUNT)+nDestinationStep ); // get enough memory for copy operations after nDestination ...
|
lDestination.realloc( (nSourceCount*PROPERTYCOUNT)+nDestinationStep ); // get enough memory for copy operations after nDestination ...
|
||||||
|
auto plDestination = lDestination.getArray();
|
||||||
|
|
||||||
// Copy all items to temp. vector to use fast sort operations :-)
|
// Copy all items to temp. vector to use fast sort operations :-)
|
||||||
lTemp.insert( lTemp.end(), lSource.begin(), lSource.end() );
|
lTemp.insert( lTemp.end(), lSource.begin(), lSource.end() );
|
||||||
@@ -328,10 +329,10 @@ static void lcl_SortAndExpandPropertyNames( const Sequence< OUString >& lSource
|
|||||||
for( const auto& rItem : lTemp )
|
for( const auto& rItem : lTemp )
|
||||||
{
|
{
|
||||||
OUString sFixPath(OUString::Concat(sSetNode) + PATHDELIMITER + rItem + PATHDELIMITER);
|
OUString sFixPath(OUString::Concat(sSetNode) + PATHDELIMITER + rItem + PATHDELIMITER);
|
||||||
lDestination[nDestinationStep++] = sFixPath + PROPERTYNAME_URL;
|
plDestination[nDestinationStep++] = sFixPath + PROPERTYNAME_URL;
|
||||||
lDestination[nDestinationStep++] = sFixPath + PROPERTYNAME_TITLE;
|
plDestination[nDestinationStep++] = sFixPath + PROPERTYNAME_TITLE;
|
||||||
lDestination[nDestinationStep++] = sFixPath + PROPERTYNAME_IMAGEIDENTIFIER;
|
plDestination[nDestinationStep++] = sFixPath + PROPERTYNAME_IMAGEIDENTIFIER;
|
||||||
lDestination[nDestinationStep++] = sFixPath + PROPERTYNAME_TARGETNAME;
|
plDestination[nDestinationStep++] = sFixPath + PROPERTYNAME_TARGETNAME;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,6 +17,9 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sal/config.h>
|
||||||
|
|
||||||
|
#include <comphelper/propertyvalue.hxx>
|
||||||
#include <unotools/eventcfg.hxx>
|
#include <unotools/eventcfg.hxx>
|
||||||
#include <unotools/configmgr.hxx>
|
#include <unotools/configmgr.hxx>
|
||||||
#include <unotools/configitem.hxx>
|
#include <unotools/configitem.hxx>
|
||||||
@@ -160,7 +163,6 @@ void GlobalEventConfig_Impl::ImplCommit()
|
|||||||
SAL_INFO("unotools", "In GlobalEventConfig_Impl::ImplCommit");
|
SAL_INFO("unotools", "In GlobalEventConfig_Impl::ImplCommit");
|
||||||
// clear the existing nodes
|
// clear the existing nodes
|
||||||
ClearNodeSet( SETNODE_BINDINGS );
|
ClearNodeSet( SETNODE_BINDINGS );
|
||||||
Sequence< beans::PropertyValue > seqValues( 1 );
|
|
||||||
OUString sNode;
|
OUString sNode;
|
||||||
//step through the list of events
|
//step through the list of events
|
||||||
for(const auto& rEntry : m_eventBindingHash)
|
for(const auto& rEntry : m_eventBindingHash)
|
||||||
@@ -172,10 +174,8 @@ void GlobalEventConfig_Impl::ImplCommit()
|
|||||||
rEntry.first +
|
rEntry.first +
|
||||||
"']" PATHDELIMITER PROPERTYNAME_BINDINGURL;
|
"']" PATHDELIMITER PROPERTYNAME_BINDINGURL;
|
||||||
SAL_INFO("unotools", "writing binding for: " << sNode);
|
SAL_INFO("unotools", "writing binding for: " << sNode);
|
||||||
seqValues[ 0 ].Name = sNode;
|
|
||||||
seqValues[ 0 ].Value <<= rEntry.second;
|
|
||||||
//write the data to the registry
|
//write the data to the registry
|
||||||
SetSetProperties(SETNODE_BINDINGS,seqValues);
|
SetSetProperties(SETNODE_BINDINGS,{ comphelper::makePropertyValue(sNode, rEntry.second) });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,9 +191,10 @@ void GlobalEventConfig_Impl::initBindingInfo()
|
|||||||
|
|
||||||
// Expand all keys
|
// Expand all keys
|
||||||
Sequence< OUString > lMacros(1);
|
Sequence< OUString > lMacros(1);
|
||||||
|
auto plMacros = lMacros.getArray();
|
||||||
for (const auto& rEventName : lEventNames )
|
for (const auto& rEventName : lEventNames )
|
||||||
{
|
{
|
||||||
lMacros[0] = aSetNode + rEventName + aCommandKey;
|
plMacros[0] = aSetNode + rEventName + aCommandKey;
|
||||||
SAL_INFO("unotools", "reading binding for: " << lMacros[0]);
|
SAL_INFO("unotools", "reading binding for: " << lMacros[0]);
|
||||||
Sequence< Any > lValues = GetProperties( lMacros );
|
Sequence< Any > lValues = GetProperties( lMacros );
|
||||||
if( lValues.hasElements() )
|
if( lValues.hasElements() )
|
||||||
@@ -235,13 +236,14 @@ Any GlobalEventConfig_Impl::getByName( const OUString& aName )
|
|||||||
{
|
{
|
||||||
Any aRet;
|
Any aRet;
|
||||||
Sequence< beans::PropertyValue > props(2);
|
Sequence< beans::PropertyValue > props(2);
|
||||||
props[0].Name = "EventType";
|
auto pProps = props.getArray();
|
||||||
props[0].Value <<= OUString("Script");
|
pProps[0].Name = "EventType";
|
||||||
props[1].Name = "Script";
|
pProps[0].Value <<= OUString("Script");
|
||||||
|
pProps[1].Name = "Script";
|
||||||
EventBindingHash::const_iterator it = m_eventBindingHash.find( aName );
|
EventBindingHash::const_iterator it = m_eventBindingHash.find( aName );
|
||||||
if( it != m_eventBindingHash.end() )
|
if( it != m_eventBindingHash.end() )
|
||||||
{
|
{
|
||||||
props[1].Value <<= it->second;
|
pProps[1].Value <<= it->second;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -251,7 +253,7 @@ Any GlobalEventConfig_Impl::getByName( const OUString& aName )
|
|||||||
if ( pos == m_supportedEvents.end() )
|
if ( pos == m_supportedEvents.end() )
|
||||||
throw container::NoSuchElementException( aName );
|
throw container::NoSuchElementException( aName );
|
||||||
|
|
||||||
props[1].Value <<= OUString();
|
pProps[1].Value <<= OUString();
|
||||||
}
|
}
|
||||||
aRet <<= props;
|
aRet <<= props;
|
||||||
return aRet;
|
return aRet;
|
||||||
|
@@ -1072,8 +1072,7 @@ uno::Reference< util::XChangesBatch > const & SvtLinguConfig::GetMainUpdateAcces
|
|||||||
beans::PropertyValue aValue;
|
beans::PropertyValue aValue;
|
||||||
aValue.Name = "nodepath";
|
aValue.Name = "nodepath";
|
||||||
aValue.Value <<= OUString("org.openoffice.Office.Linguistic");
|
aValue.Value <<= OUString("org.openoffice.Office.Linguistic");
|
||||||
uno::Sequence< uno::Any > aProps(1);
|
uno::Sequence< uno::Any > aProps{ uno::Any(aValue) };
|
||||||
aProps[0] <<= aValue;
|
|
||||||
m_xMainUpdateAccess.set(
|
m_xMainUpdateAccess.set(
|
||||||
xConfigurationProvider->createInstanceWithArguments(
|
xConfigurationProvider->createInstanceWithArguments(
|
||||||
"com.sun.star.configuration.ConfigurationUpdateAccess", aProps),
|
"com.sun.star.configuration.ConfigurationUpdateAccess", aProps),
|
||||||
|
@@ -126,31 +126,32 @@ struct FactoryInfo
|
|||||||
// b) add names and values of changed ones only and count it
|
// b) add names and values of changed ones only and count it
|
||||||
// c) resize return list by using count
|
// c) resize return list by using count
|
||||||
css::uno::Sequence< css::beans::PropertyValue > lProperties ( 4 );
|
css::uno::Sequence< css::beans::PropertyValue > lProperties ( 4 );
|
||||||
|
auto plProperties = lProperties.getArray();
|
||||||
sal_Int8 nRealyChanged = 0;
|
sal_Int8 nRealyChanged = 0;
|
||||||
|
|
||||||
if( bChangedTemplateFile )
|
if( bChangedTemplateFile )
|
||||||
{
|
{
|
||||||
lProperties[nRealyChanged].Name
|
plProperties[nRealyChanged].Name
|
||||||
= OUString::Concat(sNodeBase) + PROPERTYNAME_TEMPLATEFILE;
|
= OUString::Concat(sNodeBase) + PROPERTYNAME_TEMPLATEFILE;
|
||||||
|
|
||||||
if ( !sTemplateFile.isEmpty() )
|
if ( !sTemplateFile.isEmpty() )
|
||||||
{
|
{
|
||||||
lProperties[nRealyChanged].Value
|
plProperties[nRealyChanged].Value
|
||||||
<<= getStringSubstitution()
|
<<= getStringSubstitution()
|
||||||
->reSubstituteVariables( sTemplateFile );
|
->reSubstituteVariables( sTemplateFile );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lProperties[nRealyChanged].Value <<= sTemplateFile;
|
plProperties[nRealyChanged].Value <<= sTemplateFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
++nRealyChanged;
|
++nRealyChanged;
|
||||||
}
|
}
|
||||||
if( bChangedDefaultFilter )
|
if( bChangedDefaultFilter )
|
||||||
{
|
{
|
||||||
lProperties[nRealyChanged].Name
|
plProperties[nRealyChanged].Name
|
||||||
= OUString::Concat(sNodeBase) + PROPERTYNAME_DEFAULTFILTER;
|
= OUString::Concat(sNodeBase) + PROPERTYNAME_DEFAULTFILTER;
|
||||||
lProperties[nRealyChanged].Value <<= sDefaultFilter;
|
plProperties[nRealyChanged].Value <<= sDefaultFilter;
|
||||||
++nRealyChanged;
|
++nRealyChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,6 +23,8 @@
|
|||||||
#include <com/sun/star/uno/Any.hxx>
|
#include <com/sun/star/uno/Any.hxx>
|
||||||
#include <com/sun/star/uno/Sequence.hxx>
|
#include <com/sun/star/uno/Sequence.hxx>
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
using namespace com::sun::star::beans;
|
using namespace com::sun::star::beans;
|
||||||
using namespace com::sun::star::uno;
|
using namespace com::sun::star::uno;
|
||||||
|
|
||||||
@@ -84,10 +86,13 @@ static void ReadNode(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(nLen > 0);
|
||||||
|
|
||||||
Sequence< OUString > lResult( nLen );
|
Sequence< OUString > lResult( nLen );
|
||||||
lResult[0] = sNode + "Hide";
|
auto plResult = lResult.getArray();
|
||||||
|
plResult[0] = sNode + "Hide";
|
||||||
if ( _eType != NT_Option )
|
if ( _eType != NT_Option )
|
||||||
lResult[1] = sNode + sSet;
|
plResult[1] = sNode + sSet;
|
||||||
|
|
||||||
Sequence< Any > aValues = utl::ConfigItem::GetProperties( xHierarchyAccess, lResult, /*bAllLocales*/false );
|
Sequence< Any > aValues = utl::ConfigItem::GetProperties( xHierarchyAccess, lResult, /*bAllLocales*/false );
|
||||||
bool bHide = false;
|
bool bHide = false;
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#include <com/sun/star/uno/Sequence.hxx>
|
#include <com/sun/star/uno/Sequence.hxx>
|
||||||
|
|
||||||
#include <com/sun/star/beans/PropertyValue.hpp>
|
#include <com/sun/star/beans/PropertyValue.hpp>
|
||||||
|
#include <comphelper/propertyvalue.hxx>
|
||||||
#include <comphelper/sequence.hxx>
|
#include <comphelper/sequence.hxx>
|
||||||
#include <tools/urlobj.hxx>
|
#include <tools/urlobj.hxx>
|
||||||
|
|
||||||
@@ -196,16 +197,16 @@ std::vector< SvtSecurityOptions::Certificate > GetTrustedAuthors()
|
|||||||
|
|
||||||
sal_Int32 c2 = c1 * 3; // 3 Properties inside Struct TrustedAuthor
|
sal_Int32 c2 = c1 * 3; // 3 Properties inside Struct TrustedAuthor
|
||||||
Sequence< OUString > lAllAuthors( c2 );
|
Sequence< OUString > lAllAuthors( c2 );
|
||||||
|
auto plAllAuthors = lAllAuthors.getArray();
|
||||||
sal_Int32 i2 = 0;
|
sal_Int32 i2 = 0;
|
||||||
OUString aSep( "/" );
|
OUString aSep( "/" );
|
||||||
for( const auto& rAuthor : lAuthors )
|
for( const auto& rAuthor : lAuthors )
|
||||||
{
|
{
|
||||||
lAllAuthors[ i2 ] = PROPERTYNAME_MACRO_TRUSTEDAUTHORS + aSep + rAuthor + aSep + PROPERTYNAME_TRUSTEDAUTHOR_SUBJECTNAME;
|
plAllAuthors[ i2 ] = PROPERTYNAME_MACRO_TRUSTEDAUTHORS + aSep + rAuthor + aSep + PROPERTYNAME_TRUSTEDAUTHOR_SUBJECTNAME;
|
||||||
++i2;
|
++i2;
|
||||||
lAllAuthors[ i2 ] = PROPERTYNAME_MACRO_TRUSTEDAUTHORS + aSep + rAuthor + aSep + PROPERTYNAME_TRUSTEDAUTHOR_SERIALNUMBER;
|
plAllAuthors[ i2 ] = PROPERTYNAME_MACRO_TRUSTEDAUTHORS + aSep + rAuthor + aSep + PROPERTYNAME_TRUSTEDAUTHOR_SERIALNUMBER;
|
||||||
++i2;
|
++i2;
|
||||||
lAllAuthors[ i2 ] = PROPERTYNAME_MACRO_TRUSTEDAUTHORS + aSep + rAuthor + aSep + PROPERTYNAME_TRUSTEDAUTHOR_RAWDATA;
|
plAllAuthors[ i2 ] = PROPERTYNAME_MACRO_TRUSTEDAUTHORS + aSep + rAuthor + aSep + PROPERTYNAME_TRUSTEDAUTHOR_RAWDATA;
|
||||||
++i2;
|
++i2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,13 +250,14 @@ void SetTrustedAuthors( const std::vector< Certificate >& rAuthors )
|
|||||||
OUString aPrefix(
|
OUString aPrefix(
|
||||||
PROPERTYNAME_MACRO_TRUSTEDAUTHORS + "/a"
|
PROPERTYNAME_MACRO_TRUSTEDAUTHORS + "/a"
|
||||||
+ OUString::number(i) + "/");
|
+ OUString::number(i) + "/");
|
||||||
Sequence< css::beans::PropertyValue > lPropertyValues( 3 );
|
Sequence< css::beans::PropertyValue > lPropertyValues{
|
||||||
lPropertyValues[ 0 ].Name = aPrefix + PROPERTYNAME_TRUSTEDAUTHOR_SUBJECTNAME;
|
comphelper::makePropertyValue(aPrefix + PROPERTYNAME_TRUSTEDAUTHOR_SUBJECTNAME,
|
||||||
lPropertyValues[ 0 ].Value <<= rAuthors[ i ].SubjectName;
|
rAuthors[i].SubjectName),
|
||||||
lPropertyValues[ 1 ].Name = aPrefix + PROPERTYNAME_TRUSTEDAUTHOR_SERIALNUMBER;
|
comphelper::makePropertyValue(aPrefix + PROPERTYNAME_TRUSTEDAUTHOR_SERIALNUMBER,
|
||||||
lPropertyValues[ 1 ].Value <<= rAuthors[ i ].SerialNumber;
|
rAuthors[i].SerialNumber),
|
||||||
lPropertyValues[ 2 ].Name = aPrefix + PROPERTYNAME_TRUSTEDAUTHOR_RAWDATA;
|
comphelper::makePropertyValue(aPrefix + PROPERTYNAME_TRUSTEDAUTHOR_RAWDATA,
|
||||||
lPropertyValues[ 2 ].Value <<= rAuthors[ i ].RawData;
|
rAuthors[i].RawData)
|
||||||
|
};
|
||||||
|
|
||||||
utl::ConfigItem::SetSetProperties( xHierarchyAccess, PROPERTYNAME_MACRO_TRUSTEDAUTHORS, lPropertyValues );
|
utl::ConfigItem::SetSetProperties( xHierarchyAccess, PROPERTYNAME_MACRO_TRUSTEDAUTHORS, lPropertyValues );
|
||||||
}
|
}
|
||||||
|
@@ -886,26 +886,18 @@ void LocaleDataWrapper::loadDigitGrouping()
|
|||||||
* sequence. Needed additional API and a locale data element.
|
* sequence. Needed additional API and a locale data element.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!aGrouping.hasElements())
|
if (aGrouping.hasElements() && aGrouping[0])
|
||||||
{
|
|
||||||
aGrouping.realloc(3); // room for {3,2,0}
|
|
||||||
aGrouping[0] = 0; // invalidate
|
|
||||||
}
|
|
||||||
if (aGrouping[0])
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
i18n::LanguageCountryInfo aLCInfo( getLanguageCountryInfo());
|
i18n::LanguageCountryInfo aLCInfo( getLanguageCountryInfo());
|
||||||
if (aLCInfo.Country.equalsIgnoreAsciiCase("IN") || // India
|
if (aLCInfo.Country.equalsIgnoreAsciiCase("IN") || // India
|
||||||
aLCInfo.Country.equalsIgnoreAsciiCase("BT") ) // Bhutan
|
aLCInfo.Country.equalsIgnoreAsciiCase("BT") ) // Bhutan
|
||||||
{
|
{
|
||||||
aGrouping[0] = 3;
|
aGrouping = { 3, 2, 0 };
|
||||||
aGrouping[1] = 2;
|
|
||||||
aGrouping[2] = 0;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aGrouping[0] = 3;
|
aGrouping = { 3, 0, 0 };
|
||||||
aGrouping[1] = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -58,14 +58,11 @@ ZipPackageHelper::ZipPackageHelper(
|
|||||||
: mxContext( rxContext )
|
: mxContext( rxContext )
|
||||||
{
|
{
|
||||||
// create the package zip file
|
// create the package zip file
|
||||||
Sequence< Any > aArguments( 2 );
|
Sequence< Any > aArguments{
|
||||||
aArguments[ 0 ] <<= sPackageURL;
|
Any(sPackageURL),
|
||||||
|
// let ZipPackage be used
|
||||||
// let ZipPackage be used
|
Any(beans::NamedValue("StorageFormat", Any(OUString(ZIP_STORAGE_FORMAT_STRING))))
|
||||||
beans::NamedValue aArg;
|
};
|
||||||
aArg.Name = "StorageFormat";
|
|
||||||
aArg.Value <<= OUString(ZIP_STORAGE_FORMAT_STRING);
|
|
||||||
aArguments[ 1 ] <<= aArg;
|
|
||||||
|
|
||||||
Reference< XHierarchicalNameAccess > xHNameAccess(
|
Reference< XHierarchicalNameAccess > xHNameAccess(
|
||||||
mxContext->getServiceManager()->createInstanceWithArgumentsAndContext(
|
mxContext->getServiceManager()->createInstanceWithArgumentsAndContext(
|
||||||
|
Reference in New Issue
Block a user