sc/source/ui/inc/namepast.hxx | 1 + sc/source/ui/namedlg/namepast.cxx | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-)
New commits: commit 8720ccc3fb40a9e0df0b0c62d0854f744fa715f8 Author: Eike Rathke <er...@redhat.com> AuthorDate: Sat Oct 31 19:20:14 2020 +0100 Commit: Eike Rathke <er...@redhat.com> CommitDate: Sat Oct 31 21:30:48 2020 +0100 Resolves: tdf#137896 Paste sheet-local names with sheet name prefix Change-Id: Ib1779bb42c8b26a825899f8a93bc22b7ee441637 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105124 Tested-by: Jenkins Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/sc/source/ui/inc/namepast.hxx b/sc/source/ui/inc/namepast.hxx index b5f09be8b628..cc54ed26e5d0 100644 --- a/sc/source/ui/inc/namepast.hxx +++ b/sc/source/ui/inc/namepast.hxx @@ -41,6 +41,7 @@ private: std::vector<OUString> maSelectedNames; std::map<OUString, std::unique_ptr<ScRangeName>> m_RangeMap; + OUString m_aSheetSep; public: ScNamePasteDlg(weld::Window* pParent, ScDocShell* pShell); diff --git a/sc/source/ui/namedlg/namepast.cxx b/sc/source/ui/namedlg/namepast.cxx index 97b04395de43..491c69e0f7ba 100644 --- a/sc/source/ui/namedlg/namepast.cxx +++ b/sc/source/ui/namedlg/namepast.cxx @@ -24,6 +24,8 @@ #include <rangenam.hxx> #include <viewdata.hxx> #include <scui_def.hxx> +#include <globstr.hrc> +#include <scresid.hxx> ScNamePasteDlg::ScNamePasteDlg(weld::Window * pParent, ScDocShell* pShell) : GenericDialogController(pParent, "modules/scalc/ui/insertname.ui", "InsertNameDialog") @@ -32,6 +34,7 @@ ScNamePasteDlg::ScNamePasteDlg(weld::Window * pParent, ScDocShell* pShell) , m_xBtnClose(m_xBuilder->weld_button("close")) { ScDocument& rDoc = pShell->GetDocument(); + m_aSheetSep = OUString( rDoc.GetSheetSeparator()); std::map<OUString, ScRangeName*> aCopyMap; rDoc.GetRangeNameMap(aCopyMap); for (const auto& [aTemp, pName] : aCopyMap) @@ -70,10 +73,14 @@ IMPL_LINK(ScNamePasteDlg, ButtonHdl, weld::Button&, rButton, void) } else if (&rButton == m_xBtnPaste.get()) { + const OUString aGlobalScope( ScResId( STR_GLOBAL_SCOPE)); std::vector<ScRangeNameLine> aSelectedLines = m_xTable->GetSelectedEntries(); for (const auto& rLine : aSelectedLines) { - maSelectedNames.push_back(rLine.aName); + if (rLine.aScope == aGlobalScope) + maSelectedNames.push_back(rLine.aName); + else + maSelectedNames.push_back(rLine.aScope + m_aSheetSep + rLine.aName); } m_xDialog->response(BTN_PASTE_NAME); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits