summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-08-19 20:16:53 +0300
committerTor Lillqvist <tml@collabora.com>2014-08-19 21:03:05 +0300
commita0de5cc93db6153059a0912d5d76d056cf8c595e (patch)
treef26461c2dc973abb463078c70f272c238f41c889 /framework
parentbbc2f9e9903dcef059c719a8007e12c3e662a51e (diff)
fdo#529470: I can't remove a path in AutoText dialog
This is, not surprisingly, somewhat weird code, but I think this patch does what is necessary, it does fix the bug. Change-Id: Ie1947b311f1455ba48a904f5ef42ad92899fac31
Diffstat (limited to 'framework')
-rw-r--r--framework/source/services/pathsettings.cxx36
1 files changed, 31 insertions, 5 deletions
diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx
index 271eeff96d87..f82fc248a2a3 100644
--- a/framework/source/services/pathsettings.cxx
+++ b/framework/source/services/pathsettings.cxx
@@ -402,8 +402,8 @@ private:
So real user defined paths can be extracted from the list of
fix internal paths !
*/
- void impl_purgeKnownPaths(const PathSettings::PathInfo& rPath,
- OUStringList& lList);
+ void impl_purgeKnownPaths(PathSettings::PathInfo& rPath,
+ OUStringList& lList);
/** rebuild the member m_lPropDesc using the path list m_lPaths. */
void impl_rebuildPropertyDescriptor();
@@ -1042,10 +1042,13 @@ OUStringList PathSettings::impl_convertOldStyle2Path(const OUString& sOldStylePa
return lList;
}
-void PathSettings::impl_purgeKnownPaths(const PathSettings::PathInfo& rPath,
- OUStringList& lList)
+void PathSettings::impl_purgeKnownPaths(PathSettings::PathInfo& rPath,
+ OUStringList& lList)
{
- OUStringList::const_iterator pIt;
+ OUStringList::iterator pIt;
+
+ // Erase items in the internal path list from lList.
+ // Also erase items in the internal path list from the user path list.
for ( pIt = rPath.lInternalPaths.begin();
pIt != rPath.lInternalPaths.end();
++pIt )
@@ -1054,7 +1057,29 @@ void PathSettings::impl_purgeKnownPaths(const PathSettings::PathInfo& rPath,
OUStringList::iterator pItem = lList.find(rItem);
if (pItem != lList.end())
lList.erase(pItem);
+ pItem = rPath.lUserPaths.find(rItem);
+ if (pItem != rPath.lUserPaths.end())
+ rPath.lUserPaths.erase(pItem);
+ }
+
+ // Erase itsems not in lList from the user path list.
+ pIt = rPath.lUserPaths.begin();
+ while ( pIt != rPath.lUserPaths.end() )
+ {
+ const OUString& rItem = *pIt;
+ OUStringList::iterator pItem = lList.find(rItem);
+ if ( pItem == lList.end() )
+ {
+ rPath.lUserPaths.erase(pIt);
+ pIt = rPath.lUserPaths.begin();
+ }
+ else
+ {
+ ++pIt;
+ }
}
+
+ // Erase items in the user path list from lList.
for ( pIt = rPath.lUserPaths.begin();
pIt != rPath.lUserPaths.end();
++pIt )
@@ -1065,6 +1090,7 @@ void PathSettings::impl_purgeKnownPaths(const PathSettings::PathInfo& rPath,
lList.erase(pItem);
}
+ // Erase the write path from lList
OUStringList::iterator pItem = lList.find(rPath.sWritePath);
if (pItem != lList.end())
lList.erase(pItem);