Resolve OUStringList typedef
Change-Id: Ifb5dc5128b5619abb83eea427c7fb1115fd825f3
This commit is contained in:
@@ -39,7 +39,7 @@ class FWI_DLLPUBLIC Converter
|
|||||||
static css::uno::Sequence< css::beans::NamedValue > convert_seqPropVal2seqNamedVal ( const css::uno::Sequence< css::beans::PropertyValue >& lSource );
|
static css::uno::Sequence< css::beans::NamedValue > convert_seqPropVal2seqNamedVal ( const css::uno::Sequence< css::beans::PropertyValue >& lSource );
|
||||||
|
|
||||||
// Seq<String> => Vector<String>
|
// Seq<String> => Vector<String>
|
||||||
static OUStringList convert_seqOUString2OUStringList( const css::uno::Sequence< OUString >& lSource );
|
static std::vector<OUString> convert_seqOUString2OUStringList( const css::uno::Sequence< OUString >& lSource );
|
||||||
|
|
||||||
static OUString convert_DateTime2ISO8601 ( const DateTime& aSource );
|
static OUString convert_DateTime2ISO8601 ( const DateTime& aSource );
|
||||||
};
|
};
|
||||||
|
@@ -113,8 +113,8 @@ struct FileType
|
|||||||
OUString sMediaType;
|
OUString sMediaType;
|
||||||
OUString sClipboardFormat;
|
OUString sClipboardFormat;
|
||||||
sal_Int32 nDocumentIconID;
|
sal_Int32 nDocumentIconID;
|
||||||
OUStringList lURLPattern;
|
std::vector<OUString> lURLPattern;
|
||||||
OUStringList lExtensions;
|
std::vector<OUString> lExtensions;
|
||||||
};
|
};
|
||||||
|
|
||||||
// These struct describe a filter which is registered for one type.
|
// These struct describe a filter which is registered for one type.
|
||||||
@@ -179,7 +179,7 @@ struct Filter
|
|||||||
OUString sFilterService;
|
OUString sFilterService;
|
||||||
OUString sUIComponent;
|
OUString sUIComponent;
|
||||||
sal_Int32 nFlags;
|
sal_Int32 nFlags;
|
||||||
OUStringList lUserData;
|
std::vector<OUString> lUserData;
|
||||||
sal_Int32 nFileFormatVersion;
|
sal_Int32 nFileFormatVersion;
|
||||||
OUString sTemplateName;
|
OUString sTemplateName;
|
||||||
};
|
};
|
||||||
@@ -220,7 +220,7 @@ struct Detector
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
OUString sName;
|
OUString sName;
|
||||||
OUStringList lTypes;
|
std::vector<OUString> lTypes;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Programmer can register his own services for loading documents in a frame.
|
// Programmer can register his own services for loading documents in a frame.
|
||||||
@@ -262,7 +262,7 @@ struct Loader
|
|||||||
|
|
||||||
OUString sName;
|
OUString sName;
|
||||||
OUStringHashMap lUINames;
|
OUStringHashMap lUINames;
|
||||||
OUStringList lTypes;
|
std::vector<OUString> lTypes;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Programmer can register his own services to handle a FileType and intercept dispatches.
|
// Programmer can register his own services to handle a FileType and intercept dispatches.
|
||||||
@@ -300,7 +300,7 @@ struct ContentHandler
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
OUString sName;
|
OUString sName;
|
||||||
OUStringList lTypes;
|
std::vector<OUString> lTypes;
|
||||||
};
|
};
|
||||||
|
|
||||||
// We need different hash maps for different tables of our configuration management.
|
// We need different hash maps for different tables of our configuration management.
|
||||||
@@ -319,7 +319,7 @@ class SetNodeHash : public std::unordered_map< OUString ,
|
|||||||
// The preferred hash maps file extensions to preferred types to find these ones faster.
|
// The preferred hash maps file extensions to preferred types to find these ones faster.
|
||||||
|
|
||||||
class PerformanceHash : public std::unordered_map< OUString,
|
class PerformanceHash : public std::unordered_map< OUString,
|
||||||
OUStringList,
|
std::vector<OUString>,
|
||||||
OUStringHash >
|
OUStringHash >
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
@@ -52,7 +52,7 @@ struct FWI_DLLPUBLIC ProtocolHandler
|
|||||||
/// the uno implementation name of this handler
|
/// the uno implementation name of this handler
|
||||||
OUString m_sUNOName;
|
OUString m_sUNOName;
|
||||||
/// list of URL pattern which defines the protocols which this handler is registered for
|
/// list of URL pattern which defines the protocols which this handler is registered for
|
||||||
OUStringList m_lProtocols;
|
std::vector<OUString> m_lProtocols;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -79,8 +79,6 @@ struct KeyEventEqualsFunc
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef ::std::vector< OUString > OUStringList;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Basic OUString hash.
|
Basic OUString hash.
|
||||||
Key and values are OUStrings.
|
Key and values are OUStrings.
|
||||||
|
@@ -462,8 +462,8 @@ void PresetHandler::connectToResource( PresetHandler::EConfigType
|
|||||||
const OUString* pNames;
|
const OUString* pNames;
|
||||||
sal_Int32 c;
|
sal_Int32 c;
|
||||||
sal_Int32 i;
|
sal_Int32 i;
|
||||||
OUStringList lPresets;
|
std::vector<OUString> lPresets;
|
||||||
OUStringList lTargets;
|
std::vector<OUString> lTargets;
|
||||||
|
|
||||||
// read preset names of share layer
|
// read preset names of share layer
|
||||||
xAccess.set(xShare, css::uno::UNO_QUERY);
|
xAccess.set(xShare, css::uno::UNO_QUERY);
|
||||||
|
@@ -87,7 +87,7 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::openPath(const OUStri
|
|||||||
sal_Int32 nOpenMode)
|
sal_Int32 nOpenMode)
|
||||||
{
|
{
|
||||||
OUString sNormedPath = StorageHolder::impl_st_normPath(sPath);
|
OUString sNormedPath = StorageHolder::impl_st_normPath(sPath);
|
||||||
OUStringList lFolders = StorageHolder::impl_st_parsePath(sNormedPath);
|
std::vector<OUString> lFolders = StorageHolder::impl_st_parsePath(sNormedPath);
|
||||||
|
|
||||||
// SAFE -> ----------------------------------
|
// SAFE -> ----------------------------------
|
||||||
osl::ResettableMutexGuard aReadLock(m_mutex);
|
osl::ResettableMutexGuard aReadLock(m_mutex);
|
||||||
@@ -97,7 +97,7 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::openPath(const OUStri
|
|||||||
|
|
||||||
css::uno::Reference< css::embed::XStorage > xChild;
|
css::uno::Reference< css::embed::XStorage > xChild;
|
||||||
OUString sRelPath;
|
OUString sRelPath;
|
||||||
OUStringList::const_iterator pIt;
|
std::vector<OUString>::const_iterator pIt;
|
||||||
|
|
||||||
for ( pIt = lFolders.begin();
|
for ( pIt = lFolders.begin();
|
||||||
pIt != lFolders.end();
|
pIt != lFolders.end();
|
||||||
@@ -167,11 +167,11 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::openPath(const OUStri
|
|||||||
StorageHolder::TStorageList StorageHolder::getAllPathStorages(const OUString& sPath)
|
StorageHolder::TStorageList StorageHolder::getAllPathStorages(const OUString& sPath)
|
||||||
{
|
{
|
||||||
OUString sNormedPath = StorageHolder::impl_st_normPath(sPath);
|
OUString sNormedPath = StorageHolder::impl_st_normPath(sPath);
|
||||||
OUStringList lFolders = StorageHolder::impl_st_parsePath(sNormedPath);
|
std::vector<OUString> lFolders = StorageHolder::impl_st_parsePath(sNormedPath);
|
||||||
|
|
||||||
StorageHolder::TStorageList lStoragesOfPath;
|
StorageHolder::TStorageList lStoragesOfPath;
|
||||||
OUString sRelPath;
|
OUString sRelPath;
|
||||||
OUStringList::const_iterator pIt;
|
std::vector<OUString>::const_iterator pIt;
|
||||||
|
|
||||||
osl::MutexGuard g(m_mutex);
|
osl::MutexGuard g(m_mutex);
|
||||||
|
|
||||||
@@ -229,14 +229,14 @@ void StorageHolder::commitPath(const OUString& sPath)
|
|||||||
void StorageHolder::closePath(const OUString& rPath)
|
void StorageHolder::closePath(const OUString& rPath)
|
||||||
{
|
{
|
||||||
OUString sNormedPath = StorageHolder::impl_st_normPath(rPath);
|
OUString sNormedPath = StorageHolder::impl_st_normPath(rPath);
|
||||||
OUStringList lFolders = StorageHolder::impl_st_parsePath(sNormedPath);
|
std::vector<OUString> lFolders = StorageHolder::impl_st_parsePath(sNormedPath);
|
||||||
|
|
||||||
/* convert list of paths in the following way:
|
/* convert list of paths in the following way:
|
||||||
[0] = "path_1" => "path_1
|
[0] = "path_1" => "path_1
|
||||||
[1] = "path_2" => "path_1/path_2"
|
[1] = "path_2" => "path_1/path_2"
|
||||||
[2] = "path_3" => "path_1/path_2/path_3"
|
[2] = "path_3" => "path_1/path_2/path_3"
|
||||||
*/
|
*/
|
||||||
OUStringList::iterator pIt1;
|
std::vector<OUString>::iterator pIt1;
|
||||||
OUString sParentPath;
|
OUString sParentPath;
|
||||||
for ( pIt1 = lFolders.begin();
|
for ( pIt1 = lFolders.begin();
|
||||||
pIt1 != lFolders.end();
|
pIt1 != lFolders.end();
|
||||||
@@ -249,7 +249,7 @@ void StorageHolder::closePath(const OUString& rPath)
|
|||||||
|
|
||||||
osl::MutexGuard g(m_mutex);
|
osl::MutexGuard g(m_mutex);
|
||||||
|
|
||||||
OUStringList::reverse_iterator pIt2;
|
std::vector<OUString>::reverse_iterator pIt2;
|
||||||
for ( pIt2 = lFolders.rbegin();
|
for ( pIt2 = lFolders.rbegin();
|
||||||
pIt2 != lFolders.rend();
|
pIt2 != lFolders.rend();
|
||||||
++pIt2 )
|
++pIt2 )
|
||||||
@@ -355,7 +355,7 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::getParentStorage(cons
|
|||||||
{
|
{
|
||||||
// normed path = "a/b/c/" ... we search for "a/b/"
|
// normed path = "a/b/c/" ... we search for "a/b/"
|
||||||
OUString sNormedPath = StorageHolder::impl_st_normPath(sChildPath);
|
OUString sNormedPath = StorageHolder::impl_st_normPath(sChildPath);
|
||||||
OUStringList lFolders = StorageHolder::impl_st_parsePath(sNormedPath);
|
std::vector<OUString> lFolders = StorageHolder::impl_st_parsePath(sNormedPath);
|
||||||
sal_Int32 c = lFolders.size();
|
sal_Int32 c = lFolders.size();
|
||||||
|
|
||||||
// a) "" => - => no parent
|
// a) "" => - => no parent
|
||||||
@@ -498,9 +498,9 @@ OUString StorageHolder::impl_st_normPath(const OUString& sPath)
|
|||||||
return sNormedPath;
|
return sNormedPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
OUStringList StorageHolder::impl_st_parsePath(const OUString& sPath)
|
std::vector<OUString> StorageHolder::impl_st_parsePath(const OUString& sPath)
|
||||||
{
|
{
|
||||||
OUStringList lToken;
|
std::vector<OUString> lToken;
|
||||||
sal_Int32 i = 0;
|
sal_Int32 i = 0;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
@@ -40,9 +40,9 @@ css::uno::Sequence< css::beans::NamedValue > Converter::convert_seqPropVal2seqNa
|
|||||||
/**
|
/**
|
||||||
* converts a sequence of unicode strings into a vector of such items
|
* converts a sequence of unicode strings into a vector of such items
|
||||||
*/
|
*/
|
||||||
OUStringList Converter::convert_seqOUString2OUStringList( const css::uno::Sequence< OUString >& lSource )
|
std::vector<OUString> Converter::convert_seqOUString2OUStringList( const css::uno::Sequence< OUString >& lSource )
|
||||||
{
|
{
|
||||||
OUStringList lDestination;
|
std::vector<OUString> lDestination;
|
||||||
sal_Int32 nCount = lSource.getLength();
|
sal_Int32 nCount = lSource.getLength();
|
||||||
|
|
||||||
for (sal_Int32 nItem=0; nItem<nCount; ++nItem )
|
for (sal_Int32 nItem=0; nItem<nCount; ++nItem )
|
||||||
|
@@ -240,7 +240,7 @@ void HandlerCFGAccess::read( HandlerHash** ppHandler ,
|
|||||||
aHandler.m_lProtocols = Converter::convert_seqOUString2OUStringList(lTemp);
|
aHandler.m_lProtocols = Converter::convert_seqOUString2OUStringList(lTemp);
|
||||||
|
|
||||||
// register his pattern into the performance search hash
|
// register his pattern into the performance search hash
|
||||||
for (OUStringList::iterator pItem =aHandler.m_lProtocols.begin();
|
for (std::vector<OUString>::iterator pItem =aHandler.m_lProtocols.begin();
|
||||||
pItem!=aHandler.m_lProtocols.end();
|
pItem!=aHandler.m_lProtocols.end();
|
||||||
++pItem )
|
++pItem )
|
||||||
{
|
{
|
||||||
|
@@ -126,11 +126,11 @@ class PresetHandler
|
|||||||
|
|
||||||
/** @short knows the names of all presets inside the current
|
/** @short knows the names of all presets inside the current
|
||||||
working storage of the share layer. */
|
working storage of the share layer. */
|
||||||
OUStringList m_lPresets;
|
std::vector<OUString> m_lPresets;
|
||||||
|
|
||||||
/** @short knows the names of all targets inside the current
|
/** @short knows the names of all targets inside the current
|
||||||
working storage of the user layer. */
|
working storage of the user layer. */
|
||||||
OUStringList m_lTargets;
|
std::vector<OUString> m_lTargets;
|
||||||
|
|
||||||
/** @short its the current office locale and will be used
|
/** @short its the current office locale and will be used
|
||||||
to handle localized presets.
|
to handle localized presets.
|
||||||
|
@@ -183,7 +183,7 @@ class StorageHolder
|
|||||||
|
|
||||||
/** @short TODO
|
/** @short TODO
|
||||||
*/
|
*/
|
||||||
static OUStringList impl_st_parsePath(const OUString& sPath);
|
static std::vector<OUString> impl_st_parsePath(const OUString& sPath);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace framework
|
} // namespace framework
|
||||||
|
@@ -71,7 +71,7 @@ private:
|
|||||||
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
||||||
|
|
||||||
/** cached list of all registered event names of cfg for call optimization. */
|
/** cached list of all registered event names of cfg for call optimization. */
|
||||||
OUStringList m_lEvents;
|
std::vector<OUString> m_lEvents;
|
||||||
|
|
||||||
/** we listen at the configuration for changes at the event list. */
|
/** we listen at the configuration for changes at the event list. */
|
||||||
ConfigAccess m_aConfig;
|
ConfigAccess m_aConfig;
|
||||||
@@ -343,7 +343,7 @@ void SAL_CALL JobExecutor::elementInserted( const css::container::ContainerEvent
|
|||||||
OUString sEvent = ::utl::extractFirstFromConfigurationPath(sValue);
|
OUString sEvent = ::utl::extractFirstFromConfigurationPath(sValue);
|
||||||
if (!sEvent.isEmpty())
|
if (!sEvent.isEmpty())
|
||||||
{
|
{
|
||||||
OUStringList::iterator pEvent = std::find(m_lEvents.begin(), m_lEvents.end(), sEvent);
|
std::vector<OUString>::iterator pEvent = std::find(m_lEvents.begin(), m_lEvents.end(), sEvent);
|
||||||
if (pEvent == m_lEvents.end())
|
if (pEvent == m_lEvents.end())
|
||||||
m_lEvents.push_back(sEvent);
|
m_lEvents.push_back(sEvent);
|
||||||
}
|
}
|
||||||
@@ -358,7 +358,7 @@ void SAL_CALL JobExecutor::elementRemoved ( const css::container::ContainerEvent
|
|||||||
OUString sEvent = ::utl::extractFirstFromConfigurationPath(sValue);
|
OUString sEvent = ::utl::extractFirstFromConfigurationPath(sValue);
|
||||||
if (!sEvent.isEmpty())
|
if (!sEvent.isEmpty())
|
||||||
{
|
{
|
||||||
OUStringList::iterator pEvent = std::find(m_lEvents.begin(), m_lEvents.end(), sEvent);
|
std::vector<OUString>::iterator pEvent = std::find(m_lEvents.begin(), m_lEvents.end(), sEvent);
|
||||||
if (pEvent != m_lEvents.end())
|
if (pEvent != m_lEvents.end())
|
||||||
m_lEvents.erase(pEvent);
|
m_lEvents.erase(pEvent);
|
||||||
}
|
}
|
||||||
|
@@ -121,10 +121,10 @@ class PathSettings : private cppu::BaseMutex
|
|||||||
OUString sPathName;
|
OUString sPathName;
|
||||||
|
|
||||||
/// contains all paths, which are used internally - but are not visible for the user.
|
/// contains all paths, which are used internally - but are not visible for the user.
|
||||||
OUStringList lInternalPaths;
|
std::vector<OUString> lInternalPaths;
|
||||||
|
|
||||||
/// contains all paths configured by the user
|
/// contains all paths configured by the user
|
||||||
OUStringList lUserPaths;
|
std::vector<OUString> lUserPaths;
|
||||||
|
|
||||||
/// this special path is used to generate feature depending content there
|
/// this special path is used to generate feature depending content there
|
||||||
OUString sWritePath;
|
OUString sWritePath;
|
||||||
@@ -365,7 +365,7 @@ private:
|
|||||||
/** read a path info using the old cfg schema.
|
/** read a path info using the old cfg schema.
|
||||||
This is needed for "migration on demand" reasons only.
|
This is needed for "migration on demand" reasons only.
|
||||||
Can be removed for next major release .-) */
|
Can be removed for next major release .-) */
|
||||||
OUStringList impl_readOldFormat(const OUString& sPath);
|
std::vector<OUString> impl_readOldFormat(const OUString& sPath);
|
||||||
|
|
||||||
/** read a path info using the new cfg schema. */
|
/** read a path info using the new cfg schema. */
|
||||||
PathSettings::PathInfo impl_readNewFormat(const OUString& sPath);
|
PathSettings::PathInfo impl_readNewFormat(const OUString& sPath);
|
||||||
@@ -375,7 +375,7 @@ private:
|
|||||||
Can be removed with new major release ... */
|
Can be removed with new major release ... */
|
||||||
|
|
||||||
void impl_mergeOldUserPaths( PathSettings::PathInfo& rPath,
|
void impl_mergeOldUserPaths( PathSettings::PathInfo& rPath,
|
||||||
const OUStringList& lOld );
|
const std::vector<OUString>& lOld );
|
||||||
|
|
||||||
/** reload one path directly from the new configuration schema (because
|
/** reload one path directly from the new configuration schema (because
|
||||||
it was updated by any external code) */
|
it was updated by any external code) */
|
||||||
@@ -386,7 +386,7 @@ private:
|
|||||||
or check if the given path value uses paths, which can be replaced with predefined
|
or check if the given path value uses paths, which can be replaced with predefined
|
||||||
placeholder variables ...
|
placeholder variables ...
|
||||||
*/
|
*/
|
||||||
void impl_subst( OUStringList& lVals ,
|
void impl_subst(std::vector<OUString>& lVals ,
|
||||||
const css::uno::Reference< css::util::XStringSubstitution >& xSubst ,
|
const css::uno::Reference< css::util::XStringSubstitution >& xSubst ,
|
||||||
bool bReSubst);
|
bool bReSubst);
|
||||||
|
|
||||||
@@ -395,14 +395,14 @@ private:
|
|||||||
|
|
||||||
/** converts our new string list schema to the old ";" separated schema ... */
|
/** converts our new string list schema to the old ";" separated schema ... */
|
||||||
OUString impl_convertPath2OldStyle(const PathSettings::PathInfo& rPath ) const;
|
OUString impl_convertPath2OldStyle(const PathSettings::PathInfo& rPath ) const;
|
||||||
OUStringList impl_convertOldStyle2Path(const OUString& sOldStylePath) const;
|
std::vector<OUString> impl_convertOldStyle2Path(const OUString& sOldStylePath) const;
|
||||||
|
|
||||||
/** remove still known paths from the given lList argument.
|
/** remove still known paths from the given lList argument.
|
||||||
So real user defined paths can be extracted from the list of
|
So real user defined paths can be extracted from the list of
|
||||||
fix internal paths !
|
fix internal paths !
|
||||||
*/
|
*/
|
||||||
void impl_purgeKnownPaths(PathSettings::PathInfo& rPath,
|
void impl_purgeKnownPaths(PathSettings::PathInfo& rPath,
|
||||||
OUStringList& lList);
|
std::vector<OUString>& lList);
|
||||||
|
|
||||||
/** rebuild the member m_lPropDesc using the path list m_lPaths. */
|
/** rebuild the member m_lPropDesc using the path list m_lPaths. */
|
||||||
void impl_rebuildPropertyDescriptor();
|
void impl_rebuildPropertyDescriptor();
|
||||||
@@ -421,7 +421,7 @@ private:
|
|||||||
|
|
||||||
/** it checks, if the given path value seems to be a valid URL or system path. */
|
/** it checks, if the given path value seems to be a valid URL or system path. */
|
||||||
bool impl_isValidPath(const OUString& sPath) const;
|
bool impl_isValidPath(const OUString& sPath) const;
|
||||||
bool impl_isValidPath(const OUStringList& lPath) const;
|
bool impl_isValidPath(const std::vector<OUString>& lPath) const;
|
||||||
|
|
||||||
void impl_storePath(const PathSettings::PathInfo& aPath);
|
void impl_storePath(const PathSettings::PathInfo& aPath);
|
||||||
|
|
||||||
@@ -581,10 +581,10 @@ void PathSettings::impl_readAll()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NO substitution here ! It's done outside ...
|
// NO substitution here ! It's done outside ...
|
||||||
OUStringList PathSettings::impl_readOldFormat(const OUString& sPath)
|
std::vector<OUString> PathSettings::impl_readOldFormat(const OUString& sPath)
|
||||||
{
|
{
|
||||||
css::uno::Reference< css::container::XNameAccess > xCfg( fa_getCfgOld() );
|
css::uno::Reference< css::container::XNameAccess > xCfg( fa_getCfgOld() );
|
||||||
OUStringList aPathVal;
|
std::vector<OUString> aPathVal;
|
||||||
|
|
||||||
if( xCfg->hasByName(sPath) )
|
if( xCfg->hasByName(sPath) )
|
||||||
{
|
{
|
||||||
@@ -599,7 +599,7 @@ OUStringList PathSettings::impl_readOldFormat(const OUString& sPath)
|
|||||||
}
|
}
|
||||||
else if (aVal >>= lStringListVal)
|
else if (aVal >>= lStringListVal)
|
||||||
{
|
{
|
||||||
aPathVal = comphelper::sequenceToContainer<OUStringList>(lStringListVal);
|
aPathVal = comphelper::sequenceToContainer<std::vector<OUString>>(lStringListVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -623,19 +623,19 @@ PathSettings::PathInfo PathSettings::impl_readNewFormat(const OUString& sPath)
|
|||||||
// read internal path list
|
// read internal path list
|
||||||
css::uno::Reference< css::container::XNameAccess > xIPath;
|
css::uno::Reference< css::container::XNameAccess > xIPath;
|
||||||
xPath->getByName(CFGPROP_INTERNALPATHS) >>= xIPath;
|
xPath->getByName(CFGPROP_INTERNALPATHS) >>= xIPath;
|
||||||
aPathVal.lInternalPaths = comphelper::sequenceToContainer<OUStringList>(xIPath->getElementNames());
|
aPathVal.lInternalPaths = comphelper::sequenceToContainer<std::vector<OUString>>(xIPath->getElementNames());
|
||||||
|
|
||||||
// read user defined path list
|
// read user defined path list
|
||||||
css::uno::Sequence<OUString> vTmpUserPathsSeq;
|
css::uno::Sequence<OUString> vTmpUserPathsSeq;
|
||||||
xPath->getByName(CFGPROP_USERPATHS) >>= vTmpUserPathsSeq;
|
xPath->getByName(CFGPROP_USERPATHS) >>= vTmpUserPathsSeq;
|
||||||
aPathVal.lUserPaths = comphelper::sequenceToContainer<OUStringList>(vTmpUserPathsSeq);
|
aPathVal.lUserPaths = comphelper::sequenceToContainer<std::vector<OUString>>(vTmpUserPathsSeq);
|
||||||
|
|
||||||
// read the writeable path
|
// read the writeable path
|
||||||
xPath->getByName(CFGPROP_WRITEPATH) >>= aPathVal.sWritePath;
|
xPath->getByName(CFGPROP_WRITEPATH) >>= aPathVal.sWritePath;
|
||||||
|
|
||||||
// avoid duplicates, by removing the writeable path from
|
// avoid duplicates, by removing the writeable path from
|
||||||
// the user defined path list if it happens to be there too
|
// the user defined path list if it happens to be there too
|
||||||
OUStringList::iterator aI = std::find(aPathVal.lUserPaths.begin(), aPathVal.lUserPaths.end(), aPathVal.sWritePath);
|
std::vector<OUString>::iterator aI = std::find(aPathVal.lUserPaths.begin(), aPathVal.lUserPaths.end(), aPathVal.sWritePath);
|
||||||
if (aI != aPathVal.lUserPaths.end())
|
if (aI != aPathVal.lUserPaths.end())
|
||||||
aPathVal.lUserPaths.erase(aI);
|
aPathVal.lUserPaths.erase(aI);
|
||||||
|
|
||||||
@@ -705,9 +705,9 @@ void PathSettings::impl_storePath(const PathSettings::PathInfo& aPath)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PathSettings::impl_mergeOldUserPaths( PathSettings::PathInfo& rPath,
|
void PathSettings::impl_mergeOldUserPaths( PathSettings::PathInfo& rPath,
|
||||||
const OUStringList& lOld )
|
const std::vector<OUString>& lOld )
|
||||||
{
|
{
|
||||||
OUStringList::const_iterator pIt;
|
std::vector<OUString>::const_iterator pIt;
|
||||||
for ( pIt = lOld.begin();
|
for ( pIt = lOld.begin();
|
||||||
pIt != lOld.end();
|
pIt != lOld.end();
|
||||||
++pIt )
|
++pIt )
|
||||||
@@ -764,7 +764,7 @@ PathSettings::EChangeOp PathSettings::impl_updatePath(const OUString& sPath
|
|||||||
{
|
{
|
||||||
// migration of old user defined values on demand
|
// migration of old user defined values on demand
|
||||||
// can be disabled for a new major
|
// can be disabled for a new major
|
||||||
OUStringList lOldVals = impl_readOldFormat(sPath);
|
std::vector<OUString> lOldVals = impl_readOldFormat(sPath);
|
||||||
// replace all might existing variables with real values
|
// replace all might existing variables with real values
|
||||||
// Do it before these old paths will be compared against the
|
// Do it before these old paths will be compared against the
|
||||||
// new path configuration. Otherwise some striungs uses different variables ... but substitution
|
// new path configuration. Otherwise some striungs uses different variables ... but substitution
|
||||||
@@ -958,11 +958,11 @@ void PathSettings::impl_notifyPropListener( PathSettings::EChangeOp /*eOp*/
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathSettings::impl_subst( OUStringList& lVals ,
|
void PathSettings::impl_subst(std::vector<OUString>& lVals ,
|
||||||
const css::uno::Reference< css::util::XStringSubstitution >& xSubst ,
|
const css::uno::Reference< css::util::XStringSubstitution >& xSubst ,
|
||||||
bool bReSubst)
|
bool bReSubst)
|
||||||
{
|
{
|
||||||
OUStringList::iterator pIt;
|
std::vector<OUString>::iterator pIt;
|
||||||
|
|
||||||
for ( pIt = lVals.begin();
|
for ( pIt = lVals.begin();
|
||||||
pIt != lVals.end();
|
pIt != lVals.end();
|
||||||
@@ -994,8 +994,8 @@ void PathSettings::impl_subst(PathSettings::PathInfo& aPath ,
|
|||||||
|
|
||||||
OUString PathSettings::impl_convertPath2OldStyle(const PathSettings::PathInfo& rPath) const
|
OUString PathSettings::impl_convertPath2OldStyle(const PathSettings::PathInfo& rPath) const
|
||||||
{
|
{
|
||||||
OUStringList::const_iterator pIt;
|
std::vector<OUString>::const_iterator pIt;
|
||||||
OUStringList lTemp;
|
std::vector<OUString> lTemp;
|
||||||
lTemp.reserve(rPath.lInternalPaths.size() + rPath.lUserPaths.size() + 1);
|
lTemp.reserve(rPath.lInternalPaths.size() + rPath.lUserPaths.size() + 1);
|
||||||
|
|
||||||
for ( pIt = rPath.lInternalPaths.begin();
|
for ( pIt = rPath.lInternalPaths.begin();
|
||||||
@@ -1028,9 +1028,9 @@ OUString PathSettings::impl_convertPath2OldStyle(const PathSettings::PathInfo& r
|
|||||||
return sPathVal.makeStringAndClear();
|
return sPathVal.makeStringAndClear();
|
||||||
}
|
}
|
||||||
|
|
||||||
OUStringList PathSettings::impl_convertOldStyle2Path(const OUString& sOldStylePath) const
|
std::vector<OUString> PathSettings::impl_convertOldStyle2Path(const OUString& sOldStylePath) const
|
||||||
{
|
{
|
||||||
OUStringList lList;
|
std::vector<OUString> lList;
|
||||||
sal_Int32 nToken = 0;
|
sal_Int32 nToken = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@@ -1044,9 +1044,9 @@ OUStringList PathSettings::impl_convertOldStyle2Path(const OUString& sOldStylePa
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PathSettings::impl_purgeKnownPaths(PathSettings::PathInfo& rPath,
|
void PathSettings::impl_purgeKnownPaths(PathSettings::PathInfo& rPath,
|
||||||
OUStringList& lList)
|
std::vector<OUString>& lList)
|
||||||
{
|
{
|
||||||
OUStringList::iterator pIt;
|
std::vector<OUString>::iterator pIt;
|
||||||
|
|
||||||
// Erase items in the internal path list from lList.
|
// Erase items in the internal path list from lList.
|
||||||
// Also erase items in the internal path list from the user path list.
|
// Also erase items in the internal path list from the user path list.
|
||||||
@@ -1055,7 +1055,7 @@ void PathSettings::impl_purgeKnownPaths(PathSettings::PathInfo& rPath,
|
|||||||
++pIt )
|
++pIt )
|
||||||
{
|
{
|
||||||
const OUString& rItem = *pIt;
|
const OUString& rItem = *pIt;
|
||||||
OUStringList::iterator pItem = std::find(lList.begin(), lList.end(), rItem);
|
std::vector<OUString>::iterator pItem = std::find(lList.begin(), lList.end(), rItem);
|
||||||
if (pItem != lList.end())
|
if (pItem != lList.end())
|
||||||
lList.erase(pItem);
|
lList.erase(pItem);
|
||||||
pItem = std::find(rPath.lUserPaths.begin(), rPath.lUserPaths.end(), rItem);
|
pItem = std::find(rPath.lUserPaths.begin(), rPath.lUserPaths.end(), rItem);
|
||||||
@@ -1068,7 +1068,7 @@ void PathSettings::impl_purgeKnownPaths(PathSettings::PathInfo& rPath,
|
|||||||
while ( pIt != rPath.lUserPaths.end() )
|
while ( pIt != rPath.lUserPaths.end() )
|
||||||
{
|
{
|
||||||
const OUString& rItem = *pIt;
|
const OUString& rItem = *pIt;
|
||||||
OUStringList::iterator pItem = std::find(lList.begin(), lList.end(), rItem);
|
std::vector<OUString>::iterator pItem = std::find(lList.begin(), lList.end(), rItem);
|
||||||
if ( pItem == lList.end() )
|
if ( pItem == lList.end() )
|
||||||
{
|
{
|
||||||
rPath.lUserPaths.erase(pIt);
|
rPath.lUserPaths.erase(pIt);
|
||||||
@@ -1086,13 +1086,13 @@ void PathSettings::impl_purgeKnownPaths(PathSettings::PathInfo& rPath,
|
|||||||
++pIt )
|
++pIt )
|
||||||
{
|
{
|
||||||
const OUString& rItem = *pIt;
|
const OUString& rItem = *pIt;
|
||||||
OUStringList::iterator pItem = std::find(lList.begin(), lList.end(), rItem);
|
std::vector<OUString>::iterator pItem = std::find(lList.begin(), lList.end(), rItem);
|
||||||
if (pItem != lList.end())
|
if (pItem != lList.end())
|
||||||
lList.erase(pItem);
|
lList.erase(pItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Erase the write path from lList
|
// Erase the write path from lList
|
||||||
OUStringList::iterator pItem = std::find(lList.begin(), lList.end(), rPath.sWritePath);
|
std::vector<OUString>::iterator pItem = std::find(lList.begin(), lList.end(), rPath.sWritePath);
|
||||||
if (pItem != lList.end())
|
if (pItem != lList.end())
|
||||||
lList.erase(pItem);
|
lList.erase(pItem);
|
||||||
}
|
}
|
||||||
@@ -1211,7 +1211,7 @@ void PathSettings::impl_setPathValue( sal_Int32 nID ,
|
|||||||
{
|
{
|
||||||
OUString sVal;
|
OUString sVal;
|
||||||
aVal >>= sVal;
|
aVal >>= sVal;
|
||||||
OUStringList lList = impl_convertOldStyle2Path(sVal);
|
std::vector<OUString> lList = impl_convertOldStyle2Path(sVal);
|
||||||
impl_subst(lList, fa_getSubstitution(), false);
|
impl_subst(lList, fa_getSubstitution(), false);
|
||||||
impl_purgeKnownPaths(aChangePath, lList);
|
impl_purgeKnownPaths(aChangePath, lList);
|
||||||
if (! impl_isValidPath(lList))
|
if (! impl_isValidPath(lList))
|
||||||
@@ -1227,7 +1227,7 @@ void PathSettings::impl_setPathValue( sal_Int32 nID ,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OUStringList::const_iterator pIt;
|
std::vector<OUString>::const_iterator pIt;
|
||||||
for ( pIt = lList.begin();
|
for ( pIt = lList.begin();
|
||||||
pIt != lList.end();
|
pIt != lList.end();
|
||||||
++pIt )
|
++pIt )
|
||||||
@@ -1252,7 +1252,7 @@ void PathSettings::impl_setPathValue( sal_Int32 nID ,
|
|||||||
|
|
||||||
css::uno::Sequence<OUString> lTmpList;
|
css::uno::Sequence<OUString> lTmpList;
|
||||||
aVal >>= lTmpList;
|
aVal >>= lTmpList;
|
||||||
OUStringList lList = comphelper::sequenceToContainer<OUStringList>(lTmpList);
|
std::vector<OUString> lList = comphelper::sequenceToContainer<std::vector<OUString>>(lTmpList);
|
||||||
if (! impl_isValidPath(lList))
|
if (! impl_isValidPath(lList))
|
||||||
throw css::lang::IllegalArgumentException();
|
throw css::lang::IllegalArgumentException();
|
||||||
aChangePath.lInternalPaths = lList;
|
aChangePath.lInternalPaths = lList;
|
||||||
@@ -1273,7 +1273,7 @@ void PathSettings::impl_setPathValue( sal_Int32 nID ,
|
|||||||
|
|
||||||
css::uno::Sequence<OUString> lTmpList;
|
css::uno::Sequence<OUString> lTmpList;
|
||||||
aVal >>= lTmpList;
|
aVal >>= lTmpList;
|
||||||
OUStringList lList = comphelper::sequenceToContainer<OUStringList>(lTmpList);
|
std::vector<OUString> lList = comphelper::sequenceToContainer<std::vector<OUString>>(lTmpList);
|
||||||
if (! impl_isValidPath(lList))
|
if (! impl_isValidPath(lList))
|
||||||
throw css::lang::IllegalArgumentException();
|
throw css::lang::IllegalArgumentException();
|
||||||
aChangePath.lUserPaths = lList;
|
aChangePath.lUserPaths = lList;
|
||||||
@@ -1302,9 +1302,9 @@ void PathSettings::impl_setPathValue( sal_Int32 nID ,
|
|||||||
pOrgPath->takeOver(aChangePath);
|
pOrgPath->takeOver(aChangePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PathSettings::impl_isValidPath(const OUStringList& lPath) const
|
bool PathSettings::impl_isValidPath(const std::vector<OUString>& lPath) const
|
||||||
{
|
{
|
||||||
OUStringList::const_iterator pIt;
|
std::vector<OUString>::const_iterator pIt;
|
||||||
for ( pIt = lPath.begin();
|
for ( pIt = lPath.begin();
|
||||||
pIt != lPath.end();
|
pIt != lPath.end();
|
||||||
++pIt )
|
++pIt )
|
||||||
|
Reference in New Issue
Block a user