summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-04-20 14:29:27 +0200
committerAndras Timar <andras.timar@collabora.com>2014-04-22 09:54:38 +0200
commit2708f679a74c0a3278aabc83a8d6d0d774afd81f (patch)
tree4cf681853728baf7ff16a2dd63ebcb212e8ea21b /sfx2
parent793aeb20972686c9e283650598afd6b296716410 (diff)
adjust output file extension when exporting (bnc#870581)
If foo.odt is open, 'foo.odt' is the file name passed to the file dialog for File->Export to PDF (simply because it's the document name). If automatic file extension is enabled, the file dialog will fix this to the PDF file type, but if disabled, the default filename will remain foo.odt, possibly overwriting the source file if the user confirms without checking. (cherry picked from commit cadf6cc31ffa000d1fe8e42cc3e6cd427e0104bd) Signed-off-by: Andras Timar <andras.timar@collabora.com> Change-Id: I46504630b5f4e489d5a0cedf0b2b358305763722
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/guisaveas.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 9a8d84ba04b5..446d9d596117 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -991,6 +991,9 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
OUString("UIName"),
OUString() );
pFileDlg->SetCurrentFilter( aFilterUIName );
+ aAdjustToType = aPreselectedFilterPropsHM.getUnpackedValueOrDefault(
+ OUString("Type"),
+ OUString() );
}
// it is no export, bSetStandardName == true means that user agreed to store document in the default (default default ;-)) format
else if ( bSetStandardName || GetStorable()->hasLocation() )