From 878b6df7239388a049063cfa402c476d79e9d82d Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Fri, 4 Apr 2008 13:11:44 +0000 Subject: INTEGRATION: CWS titles02 (1.24.30); FILE MERGED 2008/02/29 11:01:54 as 1.24.30.2: RESYNC: (1.24-1.25); FILE MERGED 2007/10/17 08:10:03 as 1.24.30.1: #116375# improve title generation; make autorecovery working (related to titles) --- framework/source/services/autorecovery.cxx | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'framework') diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index a85ac2eacefe..b1fe50f73597 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -4,9 +4,9 @@ * * $RCSfile: autorecovery.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: obo $ $Date: 2008-02-26 14:45:05 $ + * last change: $Author: kz $ $Date: 2008-04-04 14:11:44 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -93,6 +93,10 @@ #include #endif +#ifndef _COM_SUN_STAR_FRAME_XTITLE_HPP_ +#include +#endif + #ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_ #include #endif @@ -1824,8 +1828,8 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame css::uno::Reference< css::frame::XStorable > xDoc(aNew.Document, css::uno::UNO_QUERY_THROW); aNew.OrgURL = xDoc->getLocation(); - css::uno::Reference< css::beans::XPropertySet > xFrameProps(xFrame, css::uno::UNO_QUERY_THROW); - xFrameProps->getPropertyValue(FRAME_PROPNAME_TITLE) >>= aNew.Title; + css::uno::Reference< css::frame::XTitle > xTitle(aNew.Document, css::uno::UNO_QUERY_THROW); + aNew.Title = xTitle->getTitle (); // SAFE -> ---------------------------------- ReadGuard aReadLock(m_aLock); @@ -2043,9 +2047,16 @@ void AutoRecovery::implts_markDocumentAsSaved(const css::uno::Reference< css::fr ::comphelper::MediaDescriptor lDescriptor(rInfo.Document->getArgs()); rInfo.RealFilter = lDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_FILTERNAME(), ::rtl::OUString()); - rInfo.Title = lDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_TITLE() , ::rtl::OUString()); - if (!rInfo.Title.getLength()) - rInfo.Title = lDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_DOCUMENTTITLE(), ::rtl::OUString()); + + css::uno::Reference< css::frame::XTitle > xDocTitle(xDocument, css::uno::UNO_QUERY); + if (xDocTitle.is ()) + rInfo.Title = xDocTitle->getTitle (); + else + { + rInfo.Title = lDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_TITLE() , ::rtl::OUString()); + if (!rInfo.Title.getLength()) + rInfo.Title = lDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_DOCUMENTTITLE(), ::rtl::OUString()); + } rInfo.UsedForSaving = sal_False; -- cgit v1.2.3