summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMert Tumer <mert.tumer@collabora.com>2021-12-29 16:34:38 +0300
committerAndras Timar <andras.timar@collabora.com>2022-01-11 13:40:44 +0100
commit108a6044debbe0831b7a8309e2a5fba23e384b39 (patch)
tree5d2de0adb3ddc95554ebdbcb9b2f06ee81a1308b
parentsc: fix cond. format icon size, when we work with pixels (diff)
downloadcore-108a6044debbe0831b7a8309e2a5fba23e384b39.tar.gz
core-108a6044debbe0831b7a8309e2a5fba23e384b39.zip
LOK android: Fix csv sheet name becomes temp name
Signed-off-by: Mert Tumer <mert.tumer@collabora.com> Change-Id: If43d7a995a5e53734fc7ecdcbf9b750b4886dc45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127684 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--sc/source/ui/docshell/docsh.cxx29
1 files changed, 18 insertions, 11 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 6a8e1e477743..f8258883a98b 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -132,6 +132,8 @@
#include <memory>
#include <vector>
+#include <comphelper/lok.hxx>
+
using namespace com::sun::star;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -1286,17 +1288,22 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
sc::SetFormulaDirtyContext aCxt;
m_aDocument.SetAllFormulasDirty(aCxt);
- // The same resulting name has to be handled in
- // ScExternalRefCache::initializeDoc() and related, hence
- // pass 'true' for RenameTab()'s bExternalDocument for a
- // composed name so ValidTabName() will not be checked,
- // which could veto the rename in case it contained
- // characters that Excel does not handle. If we wanted to
- // change that then it needed to be handled in all
- // corresponding places of the external references
- // manager/cache. Likely then we'd also need a method to
- // compose a name excluding such characters.
- m_aDocument.RenameTab( 0, INetURLObject( rMedium.GetName()).GetBase(), true/*bExternalDocument*/);
+ bool bIsMobile = comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current()
+ && SfxViewShell::Current()->isLOKMobilePhone();
+ // for mobile case, we use a copy of the original document and give it a temporary name before editing
+ // Therefore, the sheet name becomes ugly, long and nonsensical.
+ if (!bIsMobile)
+ // The same resulting name has to be handled in
+ // ScExternalRefCache::initializeDoc() and related, hence
+ // pass 'true' for RenameTab()'s bExternalDocument for a
+ // composed name so ValidTabName() will not be checked,
+ // which could veto the rename in case it contained
+ // characters that Excel does not handle. If we wanted to
+ // change that then it needed to be handled in all
+ // corresponding places of the external references
+ // manager/cache. Likely then we'd also need a method to
+ // compose a name excluding such characters.
+ m_aDocument.RenameTab( 0, INetURLObject( rMedium.GetName()).GetBase(), true/*bExternalDocument*/);
bOverflowRow = aImpEx.IsOverflowRow();
bOverflowCol = aImpEx.IsOverflowCol();