summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2018-11-20 09:12:36 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-11-20 22:43:35 +0100
commit8848881e25e75387a7ac26503c7da3787dd25b80 (patch)
tree110e3ae25e748e7a58585129e7046689613d69b0 /framework
parentde4ffc3a70da6a8ce9897b7f08e345c29b69fd3c (diff)
tdf#121537 Display SuggestedSaveAsName in title if set
Change-Id: I762eb7766a5cbe788c0a360c8a6f37b9b1106412 Reviewed-on: https://gerrit.libreoffice.org/63639 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit 4355137901e18e24de2ab123fd0454147f1f3890) Reviewed-on: https://gerrit.libreoffice.org/63648 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/fwe/helper/titlehelper.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx
index 3d7943623753..36141cfba0f1 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -32,6 +32,7 @@
#include <unotools/configmgr.hxx>
#include <unotools/bootstrap.hxx>
+#include <unotools/mediadescriptor.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/mutex.hxx>
@@ -39,6 +40,11 @@
#include <vcl/opengl/OpenGLWrapper.hxx>
#include <vcl/svapp.hxx>
+
+using namespace css;
+using namespace css::uno;
+using namespace css::frame;
+
namespace framework{
TitleHelper::TitleHelper(const css::uno::Reference< css::uno::XComponentContext >& rxContext)
@@ -339,6 +345,10 @@ void TitleHelper::impl_updateTitleForModel (const css::uno::Reference< css::fram
if (xURLProvider.is())
sURL = xURLProvider->getLocation ();
+ utl::MediaDescriptor aDescriptor(xModel->getArgs());
+ const OUString sSuggestedSaveAsName = aDescriptor.getUnpackedValueOrDefault(
+ utl::MediaDescriptor::PROP_SUGGESTEDSAVEASNAME(), OUString());
+
if (!sURL.isEmpty())
{
sTitle = impl_convertURL2Title(sURL);
@@ -346,6 +356,11 @@ void TitleHelper::impl_updateTitleForModel (const css::uno::Reference< css::fram
xNumbers->releaseNumber (nLeasedNumber);
nLeasedNumber = css::frame::UntitledNumbersConst::INVALID_NUMBER;
}
+ else if (!sSuggestedSaveAsName.isEmpty())
+ {
+ // tdf#121537 Use suggested save as name for title if file has not yet been saved
+ sTitle = sSuggestedSaveAsName;
+ }
else
{
if (nLeasedNumber == css::frame::UntitledNumbersConst::INVALID_NUMBER)