merge the formfield patch from ooo-build
[ooovba.git] / goodies / source / filter.vcl / epbm / dlgepbm.cxx
blob2bc67f29b5ea9a3831302667a7532d7849a9c547
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dlgepbm.cxx,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_goodies.hxx"
33 #ifndef GCC
34 #endif
36 #include <tools/ref.hxx>
37 #include <svtools/FilterConfigItem.hxx>
38 #include <vcl/msgbox.hxx>
39 #include "dlgepbm.hxx"
40 #include "dlgepbm.hrc"
41 #include "strings.hrc"
43 /*************************************************************************
45 |* Ctor
47 \************************************************************************/
49 DlgExportEPBM::DlgExportEPBM( FltCallDialogParameter& rPara ) :
50 ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPBM, *rPara.pResMgr ) ),
51 rFltCallPara ( rPara ),
52 aGrpFormat ( this, ResId( GRP_FORMAT, *rPara.pResMgr ) ),
53 aRBRaw ( this, ResId( RB_RAW, *rPara.pResMgr ) ),
54 aRBASCII ( this, ResId( RB_ASCII, *rPara.pResMgr ) ),
55 aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ),
56 aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ),
57 aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ),
58 pMgr ( rPara.pResMgr )
60 FreeResource();
62 // Config-Parameter lesen
64 String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PBM" ) );
65 pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData );
66 sal_Int32 nFormat = pConfigItem->ReadInt32( String( ResId( KEY_FORMAT, *pMgr ) ), 1 );
68 BOOL bCheck = FALSE;
69 if ( !nFormat )
70 bCheck ^= TRUE;
72 aRBRaw.Check( bCheck );
73 bCheck ^= TRUE;
74 aRBASCII.Check( bCheck );
76 aBtnOK.SetClickHdl( LINK( this, DlgExportEPBM, OK ) );
79 DlgExportEPBM::~DlgExportEPBM()
81 delete pConfigItem;
84 /*************************************************************************
86 |* Speichert eingestellte Werte in ini-Datei
88 \************************************************************************/
90 IMPL_LINK( DlgExportEPBM, OK, void *, EMPTYARG )
93 // Config-Parameter schreiben
94 sal_Int32 nFormat = 0;
95 if ( aRBASCII.IsChecked() )
96 nFormat++;
97 pConfigItem->WriteInt32( String( ResId( KEY_FORMAT, *pMgr ) ), nFormat );
98 rFltCallPara.aFilterData = pConfigItem->GetFilterData();
99 EndDialog( RET_OK );
101 return 0;