Issue 121028 - path can't be removed in auto text dialog once it was added
Summary: path can't be removed in auto text dialog once it was added
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: editing (show other issues)
Version: 4.0.0
Hardware: All All
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-19 01:58 UTC by xiao ting xiao
Modified: 2014-04-16 04:21 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description xiao ting xiao 2012-09-19 01:58:31 UTC
Build: Aoo_Trunk_20120918.1800 Revision :1387022 

Steps:
1. New a SW document in AOO
2. Select menu Edit-->Auto Text to launch Auto Text dialog
3. Click Path button to launch Select Paths dialog
4. Select a path in path list, and click Delete button to delete it. Click OK to apply the modification.
5. Click Path button to re-launch Select Paths dialog

Bug:
deleted path is still in path list.

Note:
In Select paths dialog, click Add button to add a path, the new added path also can't be removed.
Comment 1 Ariel Constenla-Haile 2012-12-04 16:42:21 UTC
The bug is not in the dialog nor in sw module.

Setting a break point in SwGlossaryDlg::PathHdl, main/sw/source/ui/misc/glossary.cxx:1194
shows that error is not there: The dialog calls SvtPathOptions::SetAutoTextPath with a string with the path removed.

The problem is in the implementation of the service css.util.PathSettings in the framework module. There is a bug removing paths.

See framework::PathSettings::impl_setPathValue
in main/framework/source/services/pathsettings.cxx

case IDGROUP_OLDSTYLE :
{
    ::rtl::OUString sVal;
    aVal >>= sVal;
    OUStringList lList = impl_convertOldStyle2Path(sVal);
    impl_subst(lList, fa_getSubstitution(), sal_False);
    impl_purgeKnownPaths(aChangePath, lList);
    if (! impl_isValidPath(lList))
        throw css::lang::IllegalArgumentException();

    if (aChangePath.bIsSinglePath)
    {
        LOG_ASSERT2(lList.size()>1, "PathSettings::impl_setPathValue()", "You try to set more then path value for a defined SINGLE_PATH!")
        if ( !lList.empty() )
            aChangePath.sWritePath = *(lList.begin());
        else
            aChangePath.sWritePath = ::rtl::OUString();
    }
    else
    {
        OUStringList::const_iterator pIt;
        for (  pIt  = lList.begin();
                pIt != lList.end()  ;
                ++pIt                 )
        {
            aChangePath.lUserPaths.push_back(*pIt);
        }
    }
}
break;

The problem with that code is that it only contemplates ADDING new paths, not removing:  impl_purgeKnownPaths(aChangePath, lList); removes from lList all path already in aChangePath

* In the case where we are REMOVING a path, lList will remain empty
* In the case where we are ADDING a path, lList will only have the new path, that is pushed back inside aChangePath.lUserPaths
Comment 2 Edwin Sharp 2013-11-01 09:14:37 UTC
Bug confirmed during TestLink testing Test Case ID AOOTest-621.

AOO410m1(Build:9750)  -  Rev. 1537113
Rev.1537113
Win 7
Comment 3 Rainer Bielefeld 2014-04-16 04:21:07 UTC
Version has been modified erroneous, so back to old Version selection