Commits

Anonymous committed a777f22

#i105244# handling of extensions while saving pictures fixed

Comments (0)

Files changed (3)

svx/inc/svx/xoutbmp.hxx

 #define XOUTBMP_CONTOUR_HORZ			0x00000001L
 #define XOUTBMP_CONTOUR_VERT			0x00000002L
 #define XOUTBMP_CONTOUR_EDGEDETECT		0x00000004L
+#define XOUTBMP_DONT_ADD_EXTENSION      0x00000008L
 
 #define XOUTBMP_DONT_EXPAND_FILENAME	0x10000000L
 #define XOUTBMP_USE_GIF_IF_POSSIBLE		0x20000000L

svx/source/xoutdev/_xoutbmp.cxx

 
 			if( aExt.Len() )
 			{
-				aURL.setExtension( aExt );
+                if( 0 == (nFlags & XOUTBMP_DONT_ADD_EXTENSION))
+                    aURL.setExtension( aExt );
 				rFileName = aURL.GetMainURL( INetURLObject::NO_DECODE );
 
 				SfxMedium	aMedium( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_SHARE_DENYNONE | STREAM_TRUNC, sal_True );
 
 				if( ( GRFILTER_FORMAT_NOTFOUND != nFilter ) && ( aGraphic.GetType() != GRAPHIC_NONE ) )
 				{
-					aURL.setExtension( aExt );
+                    if( 0 == (nFlags & XOUTBMP_DONT_ADD_EXTENSION))
+                        aURL.setExtension( aExt );
 					rFileName = aURL.GetMainURL( INetURLObject::NO_DECODE );
 					nErr = ExportGraphic( aGraphic, aURL, *pFilter, nFilter, NULL );
 				}

sw/source/ui/docvw/romenu.cxx

 	SvtPathOptions aPathOpt;
 	String sGrfPath( aPathOpt.GetGraphicPath() );
 
-    FileDialogHelper aDlgHelper( TemplateDescription::FILESAVE_SIMPLE, 0 );
+    FileDialogHelper aDlgHelper( TemplateDescription::FILESAVE_AUTOEXTENSION, 0 );
     Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker();
 
 //    aExpDlg.SetHelpId(HID_FILEDLG_ROMENU);
 				nFilter = GRFILTER_FORMAT_DONTKNOW;
 			String aFilter( rGF.GetExportFormatShortName( nFilter ) );
 			XOutBitmap::WriteGraphic( rGraphic, sPath, aFilter,
-										XOUTBMP_DONT_EXPAND_FILENAME );
+                                        XOUTBMP_DONT_EXPAND_FILENAME|XOUTBMP_DONT_ADD_EXTENSION );
 			return sPath;
 		}
 	}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.