The title bar icon of a window (of a saved file) in OSX is a useful shortcut to the file itself - for instance, it can be dragged to a gmail browser window to attach the file. Unfortunately LO can get confused about which file should be dragged from the title. Steps to reproduce: 1. Create a new Writer file 2. Save as "AAAA.doc", with type Microsoft Word 97/2000/XP/2003 (.doc) (* This bug does not appear to occur when saving as ODT. Unsure about other file types) 3. Close the file 4. Reopen the file 5. Save as "BBBB.doc" Expected result: * Cmd-click / right click on the filename in the title bar should show the directory path of "BBBB.doc" * Dragging the icon from the title bar should yield the file "BBBB.doc" Actual result: * Cmd-click / right click on the filename in the title bar actually shows the directory path of "AAAA.doc" (although the title bar itself reads "BBBB.doc" when not clicked on) * Dragging the icon from the title bar actually yields the file "AAAA.doc" Side effects: Attaching wrong files to emails, embarrassment Reproduced in 3.6.0.4 release and a recent build of 3.6.4.0
Confirmed on OS X 10.7.5 LO 3.6.4.1. Note: Closing BBBB.doc after seeing the error and reopening it does not reproduce this issue.
Bug is still present in 4.3.0.4
Dug into this one a little further. The issue is in platform independent code, although quite possibly only OSX consumes the information in question. When saving an ODF, this happens during the process: SvXMLExport::exportDoc ImplExportMeta _ExportMeta xDocProps->setGenerator(generator); SfxObjectShell::DoSaveCompleted getDocProperties()->setGenerator( ::utl::DocInfoHelper::GetGeneratorString() ); ... xModel->attachResource( aURL, aMediaDescr ); ... InvalidateName() Because setGenerator() is first called beneath SvXMLExport::exportDoc(), the later call to setGenerator() with the same string in SfxObjectShell::DoSaveCompleted() has no effect, and the window title isn't actually changed until the call to InvalidateName(), after the file URL has been set by the call to xModel->attachResource(). In contrast, when saving (exporting) a .doc, nothing calls setGenerator() before SfxObjectShell::DoSaveCompleted(), so the following happens: SfxObjectShell::DoSaveCompleted getDocProperties()->setGenerator( ::utl::DocInfoHelper::GetGeneratorString() ); SfxDocumentMetaData::setMetaTextAndNotify() setModified() SfxDocInfoListener_Impl::modified m_rShell.FlushDocInfo(); SetModified() ModifyChanged() Broadcast( SfxSimpleHint( SFX_HINT_TITLECHANGED ) ); ... xModel->attachResource( aURL, aMediaDescr ); ... InvalidateName() Because setGenerator() actually changes the generator string within DoSaveCompleted() this time, the window title ends up being set early, before the file URL is set. Later in DoSaveCompleted(), when the call to InvalidateName() is reached, nothing happens because the window title hasn't actually changed again, and the fact that the URL has changed isn't considered (In the ODF case, the earlier setGenerator() does not result in a title change broadcast because SetModified() decides not to call ModifyChanged()) As yet I have no idea which strand of yarn to pull in order to untangle this.
Created attachment 104431 [details] Workaround patch Attached is a minimal workaround that is quite possibly completely wrong structurally, but does happen to fix the wrong URL in the titlebar
Matthew J. Francis committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=e7c5c58177e96635bc89679d191d9e9e2f16f8c6 fdo#56562 OSX: Update URL in Writer title bar when saving .doc The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thanks for the patch!
*** Bug 84301 has been marked as a duplicate of this bug. ***