Bug 76274 - Files with XLT extension are not added to Recent documents
Summary: Files with XLT extension are not added to Recent documents
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1.0.0.alpha0+ Master
Hardware: Other Windows (All)
: medium normal
Assignee: Gagandeep Singh
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Recent-Document-List
  Show dependency treegraph
 
Reported: 2014-03-17 15:10 UTC by Pedro
Modified: 2019-03-29 08:28 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro 2014-03-17 15:10:05 UTC
While trying to help on bug
http://nabble.documentfoundation.org/Problem-with-formulas-between-Excel-and-LO-tp4101818.html
I noticed that the XLT file provided is not added to the 4.2 branch Start Center thumbnails or Recent documents list nor to the 4.1 branch Recent documents list.

It works as expected in the 4.0 branch (tested with 4.0.6.2) so it is a regression (unless it was a deliberate change...)
Comment 1 Miroslav Voda 2014-03-17 18:32:54 UTC
I would like to solve this problem.
Comment 2 bfoman (inactive) 2014-06-04 21:50:51 UTC
(In reply to comment #1)
> I would like to solve this problem.

Please assign this bug to yourself if you work on it, otherwise change status to NEW.
Comment 3 Julien Nabet 2015-02-15 14:31:23 UTC
Jan: noticing you had worked on "recent docs" parts, I thought you might be interested in this one.

First I thought about just a missing xlt here
     69 bool RecentDocsView::typeMatchesExtension(ApplicationType type, const OUString &rExt)
     70 {
     71     bool bRet = false;
     72 
     73     if (rExt == "odt" || rExt == "doc" || rExt == "docx" ||
     74         rExt == "rtf" || rExt == "txt" || rExt == "odm" || rExt == "otm")
     75     {
     76         bRet = type & TYPE_WRITER;
     77     }
     78     else if (rExt == "ods" || rExt == "xls" || rExt == "xlsx")
     79     {
     80         bRet = type & TYPE_CALC;

(see http://opengrok.libreoffice.org/xref/core/sfx2/source/control/recentdocsview.cxx#78)

but with gdb, I tried to unwind all this and noticed this part:
    162 void SfxPickList::AddDocumentToPickList( SfxObjectShell* pDocSh )
    163 {
    164     SfxMedium *pMed = pDocSh->GetMedium();
    165     if( !pMed )
    166         return;
    167 
    168     // Unnamed Documents and embedded-Documents not in Picklist
    169     if ( !pDocSh->HasName() ||
    170             SFX_CREATE_MODE_STANDARD != pDocSh->GetCreateMode() )
    171         return;
see http://opengrok.libreoffice.org/xref/core/sfx2/source/appl/sfxpicklist.cxx#162
HasName method returned empty.

Keeping on with unwinding, I noticed the call to SetNoName, see:
#0  SfxObjectShell::SetNoName (this=0x6ea77f0) at /home/julien/compile-libreoffice/libreoffice/sfx2/source/doc/objmisc.cxx:988
#1  0x00002aaaaed15c2a in SfxObjectShell::TemplateDisconnectionAfterLoad (this=0x6ea77f0) at /home/julien/compile-libreoffice/libreoffice/sfx2/source/doc/objmisc.cxx:1321
#2  0x00002aaaaed1580b in SfxObjectShell::FinishedLoading (this=0x6ea77f0, nFlags=3) at /home/julien/compile-libreoffice/libreoffice/sfx2/source/doc/objmisc.cxx:1269
#3  0x00002aaae52edbe4 in ScDocShell::ConvertFrom (this=0x6ea77f0, rMedium=...) at /home/julien/compile-libreoffice/libreoffice/sc/source/ui/docshell/docsh.cxx:1506
#4  0x00002aaaaed27108 in SfxObjectShell::DoLoad (this=0x6ea77f0, pMed=0x2aa2040) at /home/julien/compile-libreoffice/libreoffice/sfx2/source/doc/objstor.cxx:781
#5  0x00002aaaaed6b693 in SfxBaseModel::load (this=0x29a6570, seqArguments=uno::Sequence of length 15 = {...})
    at /home/julien/compile-libreoffice/libreoffice/sfx2/source/doc/sfxbasemodel.cxx:1859
#6  0x00002aaaaee590ea in (anonymous namespace)::SfxFrameLoader_Impl::load (this=0x2a62050, rArgs=uno::Sequence of length 12 = {...}, 
    _rTargetFrame=uno::Reference to ((anonymous namespace)::Frame *) 0x280d2e8) at /home/julien/compile-libreoffice/libreoffice/sfx2/source/view/frmload.cxx:703

Since, there's no ott too, may we suppose template files won't be in recent docs on purpose?
Comment 4 Jan Holesovsky 2015-02-27 10:23:55 UTC
I suspect the behavior is not really defined - what to do when the user chooses the template from the recent docs?  Should he/she edit the template, or use it to start a new doc?

What do you expect as the users, please?
Comment 5 Julien Nabet 2015-02-27 10:33:32 UTC
Thank you Jan for your feedback.
I don't have personal opinion about this.
Perhaps other users would have one.

Anyway, let's also ask to ux team.
Comment 6 Heiko Tietze 2015-02-27 12:46:13 UTC
Good point. I'd expect that opening a template starts a new document based on this style. Otherwise it wouldn't make sense to have file-based templates.
Comment 7 Yousuf Philips (jay) (retired) 2015-02-27 12:49:23 UTC
So how does a user go about editing a template after creating it?
Comment 8 V Stuart Foote 2015-02-27 13:54:47 UTC
So thinking about this a bit...

A template--native ODF or not--is a template, and not simply a document. They need to be managed, edited and maintained of course. But, they are a special class of documents that should be handled other than normal documents.

So, any reason they could not be handled from the Template manager? Either the "My templates" panel, or implement a new "Recent templates" listing and/or GUI panel?

=-=

Q: Functionally what happens within LibreOffice when opening a template is it being opened to edit the template, or opened to create a new document?
 
A: It depends

   1.) for ODF templates--the user decides at the end with their save action

   2.) for other templates MSO, OOXML, WP, etc.--a new document is created by filter action of reading in the template.  A new document is not intentional, just the affect of filter process to render into ODF.

And of course the round trip overwrite--Save-as from ODF, if supported by export filter--will often corrupt the template. So we really should not be attempting to "edit" non-native templates.

Q: Does it make sense to include the recently used templates (with or without thumbnails) on the recent documents list or as StartCenter thumbnails?  

A: IMHO, I think not-- and that handling should include the ODF templates. So what then to do with them?  Rework the Template manager to include recently used templates seems to be appropriate.
Comment 9 Pedro 2015-02-27 19:03:33 UTC
It makes sense to move template editing into the Template Manager (and not save it as a thumbnail in recent documents)

However, the Template Manager will also not show thumbnails of non-ODF templates. Actually if you add an XLT template to your My Templates, the My Template folder shows as empty. This is really not expected...

So: I agree that XLT templates are not added to the Recent Documents but they should work at least in Template Manager.

Maybe I should close this bug and open a new one?
Comment 10 Robinson Tryon (qubit) 2015-03-19 14:59:11 UTC
Component: ux-advise, so
Status -> NEW
Comment 11 Robinson Tryon (qubit) 2015-12-14 05:32:45 UTC Comment hidden (obsolete)
Comment 12 Joel Madero 2016-01-09 21:50:41 UTC
I'm removing the bibisect request here as it's unclear if ux actually wants the previous behavior (XLT showing up in recent documents) and if so, how that should behave. Therefore, no need for a bibisectRequest at this time.

Once UX team decides on the behavior, they can decide whether a bibisect would be useful or not and add the appropriate keywords (also removing regression as we're not sure it's actually a regression or wanted behavior at this point).

My suggestion is moving forward, no bibisects on ux-advice issues. If UX team wants one, they can request it after deciding on a course of action and setting the component to the appropriate component.
Comment 13 Robinson Tryon (qubit) 2016-08-25 05:39:05 UTC Comment hidden (obsolete)
Comment 14 Heiko Tietze 2017-12-06 20:28:48 UTC
We talked about this topic in the design meeting. Since templates are added to the recent documents menu it should also be done for Excel templates.

Setting easyhack with code pointer in comment 3.
Comment 15 abstatic 2018-02-24 23:44:39 UTC
Hello, is this bug still open, I'd like to work on this.
Comment 16 Xisco Faulí 2018-03-28 02:31:12 UTC Comment hidden (obsolete)
Comment 17 Xisco Faulí 2018-04-28 02:30:04 UTC Comment hidden (obsolete)
Comment 18 Xisco Faulí 2018-05-29 02:35:23 UTC Comment hidden (obsolete)
Comment 19 Xisco Faulí 2018-06-29 02:43:58 UTC Comment hidden (obsolete)
Comment 20 Xisco Faulí 2018-07-30 02:34:57 UTC Comment hidden (obsolete)
Comment 21 Xisco Faulí 2018-08-30 02:49:23 UTC Comment hidden (obsolete)
Comment 22 Tamás Zolnai 2018-09-08 18:55:39 UTC
Let reset assignee due to inactivity.
Comment 23 Julien Nabet 2019-03-16 14:38:05 UTC
Sing: since you assigned yourself, let's put the status to ASSIGNED.
Comment 24 Gagandeep Singh 2019-03-16 14:56:23 UTC
(In reply to Julien Nabet from comment #23)
> Sing: since you assigned yourself, let's put the status to ASSIGNED.

Thanks, I missed that :)
Comment 25 Vaibhav Rastogi 2019-03-19 18:23:00 UTC Comment hidden (obsolete)
Comment 26 Gagandeep Singh 2019-03-20 09:48:29 UTC
Hi, I am working on this bug.
Comment 27 Mike Kaganski 2019-03-20 10:51:35 UTC
I do not see a problem in current versions, and actually I am tempted to think it was a misunderstanding from the beginning (or maybe I'm wrong, and *some* previous versions had a problem that was resolved later).

Opening any template *for editing* does add it to recent file list. It works fine with any of templates, be it OTT, or OTS, or DOT, or XLT. One might open a template for editing, e.g., using File->Templates->Open Template...

On the other hand, using a template to create new document (an intended usage of templates) is semantically *not* opening the template (of course, it is opened internally, but from the top-level PoV, it's the new document without a name that is being created in this process, and a template is a detail). In this process, no template (neither ODF, nor foreign) is added to recent list. The correct way to have templates "pinned" is to properly configure (manage) one's Templates, adding required ones there.

Since the XLT in question is correctly added to the list, it's possibly good to close it WFM?
Comment 28 Heiko Tietze 2019-03-29 08:28:58 UTC
Mike is right, when a template is opened it never shows up under recent files unless it has been edited. That's a bit different to opening a document, which goes into the list without editing. 

Let's close this ticket as WFM - and if necessary open a new one to discuss whether or not templates in general should show up in the list without editing. But I don't see a work flow that requires this behavior.