summaryrefslogtreecommitdiff
path: root/android/source
diff options
context:
space:
mode:
Diffstat (limited to 'android/source')
-rw-r--r--android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java4
-rw-r--r--android/source/src/java/org/libreoffice/ui/FileUtilities.java5
2 files changed, 9 insertions, 0 deletions
diff --git a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
index b21ad02383d7..ba371bfd9c8a 100644
--- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -350,7 +350,11 @@ public class LibreOfficeMainActivity extends AppCompatActivity implements Settin
Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType(FileUtilities.MIMETYPE_PDF);
+ // suggest directory and file name based on the doc
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, mDocumentUri);
+ final String displayName = toolbarTop.getTitle().toString();
+ final String suggestedFileName = FileUtilities.stripExtensionFromFileName(displayName) + ".pdf";
+ intent.putExtra(Intent.EXTRA_TITLE, suggestedFileName);
startActivityForResult(intent, REQUEST_CODE_EXPORT_TO_PDF);
}
diff --git a/android/source/src/java/org/libreoffice/ui/FileUtilities.java b/android/source/src/java/org/libreoffice/ui/FileUtilities.java
index 902b30ed7794..7fc8c3c84eb1 100644
--- a/android/source/src/java/org/libreoffice/ui/FileUtilities.java
+++ b/android/source/src/java/org/libreoffice/ui/FileUtilities.java
@@ -124,6 +124,11 @@ public class FileUtilities {
return mimeType != null && mimeType.endsWith("template");
}
+ public static String stripExtensionFromFileName(final String fileName)
+ {
+ return fileName.split("\\.[A-Za-z0-9]*$")[0];
+ }
+
/**
* Tries to retrieve the display (which should be the document name)
* for the given URI using the given resolver.
e='2016-06-09 09:47:11 +0000'>2016-06-09tdf#94698 cleanup Makefiles. Get rid of udkapi and offapiGleb Mishchenko 2016-01-19Missing dependencyStephan Bergmann 2015-10-12tdf#77014 create a test for this bugTomaž Vajngerl 2015-07-24sw: partial build needs another dependency from uiwriter to mswordMichael Stahl 2015-02-27gbuild: CppunitTest: always use unittest configurationMichael Stahl 2014-12-18CppunitTest_sw_uiwriter: use gb_CppunitTest_use_rdbMiklos Vajna 2014-11-28Unittest for autocorrect in writerDaniel Sikeler 2014-11-07Fixup headless buildRiccardo Magliocchetti 2014-06-24try to fix linker error on Windows caused by last commitLuboš Luňák 2014-06-24fix broken redlines after undoing column count change (cp#1000071)Luboš Luňák 2014-06-23SwDrawView::DeleteMarked: delete textbox of shape as wellMiklos Vajna 2014-06-04DeInitVCL at end of testsStephan Bergmann 2014-05-27sw: move sw/source/core/uibase to sw/source/uibaseMichael Stahl 2014-05-01Simplify type detectorsMaxim Monastirsky 2014-03-09this dir doesn't exist anymoreCaolán McNamara 2014-03-09fdo#70422 Moved the linked files from sw/source/ui to a new core/uibase dirroopak12345 2014-01-16sw: CppunitTest_uiwriter has grown a dep on msword libraryMichael Stahl 2014-01-16CppunitTest_sw_uiwriter: add testcase for ImportRTF()Miklos Vajna 2013-11-19CppunitTest_sw_ooxmlexport: speed this up a bitMiklos Vajna 2013-10-18fdo#60698: Move fileaccess module to ucbMarcos Paulo de Souza 2013-10-13Introduce unit test in replace functionnality in WriterArnaud Versini