[Libreoffice-commits] core.git: include/sfx2 sfx2/source

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 18 15:02:27 UTC 2019


 include/sfx2/strings.hrc      |    2 +-
 sfx2/source/appl/linkmgr2.cxx |    7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit d1398fd1cd6957f56992a9239929ccc64fd747f0
Author:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
AuthorDate: Wed Jul 17 11:52:23 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Thu Jul 18 17:01:14 2019 +0200

    tdf#126461 incl. document name in link update msg
    
    If you open a OLE-linked document from the console, LO will ask to
    update the linked information on open. But this happens before the
    document shell has even has set the title of the shell, so a user
    has no way to know, what "This document" really refers to.
    
    This is even more problematic if you have multiple open documents
    restored by a session manager.
    
    So this changes the string to include the document name.
    
    Change-Id: Ife7b21f6eeb4dd5c1aebd383752cc62279da33fb
    Reviewed-on: https://gerrit.libreoffice.org/75777
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index 63cca694a535..b5128e136ce1 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -142,7 +142,7 @@
 #define STR_QUICKSTART_FILE                     NC_("STR_QUICKSTART_FILE", "File")
 #define STR_QUICKSTART_STARTCENTER              NC_("STR_QUICKSTART_STARTCENTER", "Startcenter")
 #define STR_QUICKSTART_RECENTDOC                NC_("STR_QUICKSTART_RECENTDOC", "Recent Documents")
-#define STR_QUERY_UPDATE_LINKS                  NC_("STR_QUERY_UPDATE_LINKS", "This document contains one or more links to external data.\n\nWould you like to change the document, and update all links\nto get the most recent data?")
+#define STR_QUERY_UPDATE_LINKS                  NC_("STR_QUERY_UPDATE_LINKS", "The document %{filename} contains one or more links to external data.\n\nWould you like to change the document, and update all links\nto get the most recent data?")
 #define STR_DDE_ERROR                           NC_("STR_DDE_ERROR", "DDE link to %1 for %2 area %3 are not available.")
 #define STR_SECURITY_WARNING_NO_HYPERLINKS      NC_("STR_SECURITY_WARNING_NO_HYPERLINKS", "For security reasons, the hyperlink cannot be executed.\nThe stated address will not be opened.")
 #define RID_SECURITY_WARNING_TITLE                  NC_("RID_SECURITY_WARNING_TITLE", "Security Warning")
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index 6a6c282dc4ab..f3b24cb66032 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -311,9 +311,12 @@ void LinkManager::UpdateAllLinks(
 
         if( bAskUpdate )
         {
+            OUString aMsg = SfxResId(STR_QUERY_UPDATE_LINKS);
+            INetURLObject aURL(pPersist->getDocumentBaseURL());
+            aMsg = aMsg.replaceFirst("%{filename}", aURL.GetLastName());
+
             std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pParentWin,
-                                                           VclMessageType::Question, VclButtonsType::YesNo,
-                                                           SfxResId(STR_QUERY_UPDATE_LINKS)));
+                                                           VclMessageType::Question, VclButtonsType::YesNo, aMsg));
             xQueryBox->set_default_response(RET_YES);
 
             int nRet = xQueryBox->run();


More information about the Libreoffice-commits mailing list