Lines 36-41
Link Here
|
36 |
#include "impdialog.hxx" |
36 |
#include "impdialog.hxx" |
37 |
#include "impdialog.hrc" |
37 |
#include "impdialog.hrc" |
38 |
|
38 |
|
|
|
39 |
#ifndef _SV_SVAPP_HXX |
40 |
#include <vcl/svapp.hxx> |
41 |
#endif |
42 |
|
43 |
#ifndef _SV_MSGBOX_HXX |
44 |
#include <vcl/msgbox.hxx> |
45 |
#endif |
46 |
|
39 |
#ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_ |
47 |
#ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_ |
40 |
#include <com/sun/star/uno/Sequence.h> |
48 |
#include <com/sun/star/uno/Sequence.h> |
41 |
#endif |
49 |
#endif |
Lines 61-237
Link Here
|
61 |
|
69 |
|
62 |
using namespace ::com::sun::star; |
70 |
using namespace ::com::sun::star; |
63 |
|
71 |
|
64 |
ImpPDFDialog::ImpPDFDialog( Window* pParent, ResMgr& rResMgr, Sequence< PropertyValue >& rFilterData, const Reference< XComponent >& rxDoc ) : |
72 |
////////////////////////////////////////////////////////////////////////////////////////////////////// |
65 |
ModalDialog( pParent, ResId( RID_PDF_EXPORT_DLG, &rResMgr ) ), |
73 |
// tabbed PDF dialog implementation |
66 |
maBtnOK( this, ResId( BT_OK ) ), |
74 |
// ----------------------------------------------------------------------------- |
67 |
maBtnCancel( this, ResId( BT_CANCEL ) ), |
75 |
ImpPDFTabDialog::ImpPDFTabDialog( Window* pParent, |
68 |
maBtnHelp( this, ResId( BT_HELP ) ), |
76 |
ResMgr& rResMgr, |
69 |
maFlPages( this, ResId( FL_PAGES ) ), |
77 |
Sequence< PropertyValue >& rFilterData, |
70 |
maRbAll( this, ResId( RB_ALL ) ), |
78 |
const Reference< XComponent >& rxDoc ) : |
71 |
maRbRange( this, ResId( RB_RANGE ) ), |
79 |
SfxTabDialog( pParent, ResId( RID_PDF_EXPORT_DLG, &rResMgr ), 0, FALSE, 0 ), |
72 |
maRbSelection( this, ResId( RB_SELECTION ) ), |
80 |
|
73 |
maEdPages( this, ResId( ED_PAGES ) ), |
81 |
maFlPages( this, ResId( 1 ) ), |
74 |
maFlCompression( this, ResId( FL_IMAGES ) ), |
82 |
|
75 |
maRbLosslessCompression( this, ResId( RB_LOSSLESSCOMPRESSION ) ), |
|
|
76 |
maRbJPEGCompression( this, ResId( RB_JPEGCOMPRESSION ) ), |
77 |
maFtQuality( this, ResId( FT_QUALITY ) ), |
78 |
maNfQuality( this, ResId( NF_QUALITY ) ), |
79 |
maCbReduceImageResolution( this, ResId( CB_REDUCEIMAGERESOLUTION ) ), |
80 |
maCoReduceImageResolution( this, ResId( CO_REDUCEIMAGERESOLUTION ) ), |
81 |
maFlGeneral( this, ResId( FL_GENERAL ) ), |
82 |
maCbTaggedPDF( this, ResId( CB_TAGGEDPDF ) ), |
83 |
maCbExportNotes( this, ResId( CB_EXPORTNOTES ) ), |
84 |
maCbTransitionEffects( this, ResId( CB_TRANSITIONEFFECTS ) ), |
85 |
maFtFormsFormat( this, ResId( FT_FORMSFORMAT ) ), |
86 |
maLbFormsFormat( this, ResId( LB_FORMSFORMAT ) ), |
87 |
maCbExportEmptyPages( this, ResId( CB_EXPORTEMPTYPAGES ) ), |
88 |
maConfigItem( String( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/PDF/Export/" ) ), &rFilterData ), |
83 |
maConfigItem( String( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/PDF/Export/" ) ), &rFilterData ), |
89 |
mbIsPresentation( sal_False ), |
84 |
mbIsPresentation( sal_False ), |
90 |
mbIsWriter( sal_False ) |
85 |
mbIsWriter( sal_False ), |
91 |
{ |
|
|
92 |
FreeResource(); |
93 |
maRbRange.SetToggleHdl( LINK( this, ImpPDFDialog, TogglePagesHdl ) ); |
94 |
|
86 |
|
95 |
maRbAll.Check(); |
87 |
mbSelectionPresent( sal_False ), |
96 |
TogglePagesHdl( NULL ); |
88 |
mbUseLosslessCompression( sal_True ), |
|
|
89 |
mnQuality( 90 ), |
90 |
mbReduceImageResolution( sal_False ), |
91 |
mnMaxImageResolution( 300 ), |
92 |
mbUseTaggedPDF( sal_False ), |
93 |
mbExportNotesBoth( sal_True ), |
94 |
mbUseTransitionEffects( sal_False ), |
95 |
mbIsSkipEmptyPages( sal_False ), |
96 |
mnFormsType( 0 ), |
97 |
|
98 |
mbHideViewerToolbar( sal_False ), |
99 |
mbHideViewerMenubar( sal_False ), |
100 |
mbHideViewerWindowControls( sal_False ), |
101 |
mbResizeWinToInit( sal_False ), |
102 |
mbCenterWindow( sal_False ), |
103 |
mbOpenInFullScreenMode( sal_False ), |
104 |
mbDisplayPDFDocumentTitle( sal_False ), |
105 |
mbDirectionR2L( sal_False ), |
106 |
mnMagnification( 0 ), |
107 |
mnInitialView( 0 ), |
108 |
mnPageLayout( 0 ), |
97 |
|
109 |
|
98 |
maNfQuality.SetUnit( FUNIT_PERCENT ); |
110 |
mbIsRangeChecked( sal_False ), |
99 |
maNfQuality.SetMin( 1, FUNIT_PERCENT ); |
111 |
msPageRange( ' ' ), |
100 |
maNfQuality.SetMax( 100, FUNIT_PERCENT ); |
|
|
101 |
|
112 |
|
102 |
// check for selection |
113 |
mbSelectionIsChecked( sal_False ) |
|
|
114 |
{ |
115 |
FreeResource(); |
116 |
mprResMgr = &rResMgr; |
117 |
// check for selection |
103 |
try |
118 |
try |
104 |
{ |
119 |
{ |
105 |
Reference< frame::XController > xController( Reference< frame::XModel >( rxDoc, UNO_QUERY )->getCurrentController() ); |
120 |
Reference< frame::XController > xController( Reference< frame::XModel >( rxDoc, UNO_QUERY )->getCurrentController() ); |
106 |
if( xController.is() ) |
121 |
if( xController.is() ) |
107 |
{ |
122 |
{ |
108 |
Reference< view::XSelectionSupplier > xView( xController, UNO_QUERY ); |
123 |
Reference< view::XSelectionSupplier > xView( xController, UNO_QUERY ); |
109 |
if( xView.is() ) |
124 |
if( xView.is() ) |
110 |
xView->getSelection() >>= maSelection; |
125 |
xView->getSelection() >>= maSelection; |
111 |
} |
126 |
} |
112 |
} |
127 |
} |
113 |
catch( RuntimeException ) |
128 |
catch( RuntimeException ) |
114 |
{ |
129 |
{ |
115 |
} |
130 |
} |
116 |
sal_Bool bHasSelection = maSelection.hasValue(); |
131 |
mbSelectionPresent = maSelection.hasValue(); |
117 |
if ( bHasSelection ) |
132 |
if ( mbSelectionPresent ) |
118 |
{ |
133 |
{ |
119 |
Reference< drawing::XShapes > xShapes; |
134 |
Reference< drawing::XShapes > xShapes; |
120 |
if ( ( maSelection >>= xShapes ) == sal_False ) // XShapes is always a selection |
135 |
if ( ( maSelection >>= xShapes ) == sal_False ) // XShapes is always a selection |
121 |
{ |
136 |
{ |
122 |
// even if nothing is selected in writer the selection is not empty |
137 |
// even if nothing is selected in writer the selection is not empty |
123 |
Reference< container::XIndexAccess > xIndexAccess; |
138 |
Reference< container::XIndexAccess > xIndexAccess; |
124 |
if ( maSelection >>= xIndexAccess ) |
139 |
if ( maSelection >>= xIndexAccess ) |
125 |
{ |
140 |
{ |
126 |
sal_Int32 nLen = xIndexAccess->getCount(); |
141 |
sal_Int32 nLen = xIndexAccess->getCount(); |
127 |
if ( !nLen ) |
142 |
if ( !nLen ) |
128 |
bHasSelection = sal_False; |
143 |
mbSelectionPresent = sal_False; |
129 |
else if ( nLen == 1 ) |
144 |
else if ( nLen == 1 ) |
130 |
{ |
145 |
{ |
131 |
Reference< text::XTextRange > xTextRange( xIndexAccess->getByIndex( 0 ), UNO_QUERY ); |
146 |
Reference< text::XTextRange > xTextRange( xIndexAccess->getByIndex( 0 ), UNO_QUERY ); |
132 |
if ( xTextRange.is() && ( xTextRange->getString().getLength() == 0 ) ) |
147 |
if ( xTextRange.is() && ( xTextRange->getString().getLength() == 0 ) ) |
133 |
bHasSelection = sal_False; |
148 |
mbSelectionPresent = sal_False; |
134 |
} |
149 |
} |
135 |
} |
150 |
} |
136 |
} |
151 |
} |
137 |
} |
152 |
} |
138 |
maRbSelection.Enable( bHasSelection ); |
153 |
|
139 |
|
154 |
// check if source document is a presentation |
140 |
|
155 |
try |
141 |
// check if source document is a presentation |
156 |
{ |
142 |
try |
157 |
Reference< XServiceInfo > xInfo( rxDoc, UNO_QUERY ); |
143 |
{ |
158 |
if ( xInfo.is() ) |
144 |
Reference< XServiceInfo > xInfo( rxDoc, UNO_QUERY ); |
159 |
{ |
145 |
if ( xInfo.is() ) |
160 |
if ( xInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) ) ) |
146 |
{ |
161 |
mbIsPresentation = sal_True; |
147 |
if ( xInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) ) ) |
|
|
148 |
mbIsPresentation = sal_True; |
149 |
if ( xInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ) ) ) |
162 |
if ( xInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) ) ) ) |
150 |
mbIsWriter = sal_True; |
163 |
mbIsWriter = sal_True; |
151 |
} |
164 |
} |
152 |
} |
165 |
} |
153 |
catch( RuntimeException ) |
166 |
catch( RuntimeException ) |
154 |
{ |
167 |
{ |
155 |
} |
168 |
} |
156 |
maCbTransitionEffects.Enable( mbIsPresentation ); |
|
|
157 |
maCbExportEmptyPages.Enable( mbIsWriter ); |
158 |
|
159 |
// SJ: Dont know if there are Notes available also for writer. |
160 |
// maCbExportNotes.Enable( bIsPresentation ); |
161 |
|
162 |
|
163 |
maRbLosslessCompression.SetToggleHdl( LINK( this, ImpPDFDialog, ToggleCompressionHdl ) ); |
164 |
const sal_Bool bUseLosslessCompression = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), sal_False ); |
165 |
if ( bUseLosslessCompression ) |
166 |
maRbLosslessCompression.Check(); |
167 |
else |
168 |
maRbJPEGCompression.Check(); |
169 |
maNfQuality.SetValue( maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), 90 ), FUNIT_PERCENT ); |
170 |
maNfQuality.Enable( bUseLosslessCompression == sal_False ); |
171 |
|
172 |
maCbReduceImageResolution.SetToggleHdl( LINK( this, ImpPDFDialog, ToggleReduceImageResolutionHdl ) ); |
173 |
const sal_Bool bReduceImageResolution = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), sal_False ); |
174 |
maCbReduceImageResolution.Check( bReduceImageResolution ); |
175 |
String aStrRes( String::CreateFromInt32( maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), 300 ) ) ); |
176 |
aStrRes.Append( String( RTL_CONSTASCII_USTRINGPARAM( " DPI" ) ) ); |
177 |
maCoReduceImageResolution.SetText( aStrRes ); |
178 |
maCoReduceImageResolution.Enable( bReduceImageResolution ); |
179 |
|
180 |
maCbTaggedPDF.Check( maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), sal_False ) ); |
181 |
|
182 |
if ( mbIsPresentation ) |
183 |
maCbExportNotes.Check( maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), sal_False ) ); |
184 |
else |
185 |
maCbExportNotes.Check( maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), sal_True ) ); |
186 |
|
187 |
maCbTransitionEffects.Check( maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), sal_True ) ); |
188 |
maCbExportEmptyPages.Check( !maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), sal_False ) ); |
189 |
|
169 |
|
190 |
sal_Int32 nFormsType = maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), 0 ); |
170 |
mbUseLosslessCompression = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), sal_False ); |
191 |
if ( ( nFormsType < 0 ) || ( nFormsType > 3 ) ) |
171 |
mnQuality = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), 90 ); |
192 |
nFormsType = 0; |
172 |
mbReduceImageResolution = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), sal_False ); |
193 |
maLbFormsFormat.SelectEntryPos( (sal_uInt16)nFormsType ); |
173 |
mnMaxImageResolution = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), 300 ); |
|
|
174 |
|
175 |
mbUseTaggedPDF = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), sal_False ); |
176 |
if ( mbIsPresentation ) |
177 |
mbExportNotesBoth = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), sal_False ); |
178 |
else |
179 |
mbExportNotesBoth = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), sal_True ); |
180 |
|
181 |
mbUseTransitionEffects = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), sal_True ); |
182 |
mbIsSkipEmptyPages = maConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), sal_False ); |
183 |
|
184 |
mnFormsType = maConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), 0 ); |
185 |
if ( ( mnFormsType < 0 ) || ( mnFormsType > 3 ) ) |
186 |
mnFormsType = 0; |
187 |
|
188 |
//prepare values for the Viewer tab page |
189 |
mbHideViewerToolbar = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerToolbar" ) ), sal_False ); |
190 |
mbHideViewerMenubar = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerMenubar" ) ), sal_False ); |
191 |
mbHideViewerWindowControls = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerWindowControls" ) ), sal_False ); |
192 |
mbResizeWinToInit = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ResizeWindowToInitialPage" ) ), sal_False ); //********* |
193 |
mbCenterWindow = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "CenterWindow" ) ), sal_False ); |
194 |
mbOpenInFullScreenMode = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenInFullScreenMode" ) ), sal_False ); |
195 |
mbDisplayPDFDocumentTitle = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayPDFDocumentTitle" ) ), sal_False ); |
196 |
mbDirectionR2L = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DirectionR2L" ) ), sal_False ); |
197 |
|
198 |
mnInitialView = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "InitialView" ) ), 0 ); //********* |
199 |
mnMagnification = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Magnification" ) ), 0 ); //********* |
200 |
mnPageLayout = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "PageLayout" ) ), 0 ); //********* |
201 |
|
202 |
//queue the tab pages for later creation (created when first shown) |
203 |
AddTabPage( RID_PDF_TAB_VPREFER, ImpPDFTabViewerPage::Create, 0 ); |
204 |
AddTabPage( RID_PDF_TAB_OPNFTR, ImpPDFTabOpnFtrPage::Create, 0 ); |
205 |
|
206 |
//last queued is the first to be displayed (or so it seems..) |
207 |
AddTabPage( RID_PDF_TAB_GENER, ImpPDFTabGeneralPage::Create, 0 ); |
208 |
|
209 |
//change test on the Ok button: get the relevant string from resources, update it on the button |
210 |
GetOKButton().SetText( OUString( String( ResId( STR_PDF_EXPORT, &rResMgr ) ) ) ); |
211 |
|
212 |
//FIXME |
213 |
//very, very ugly hack: I don't know how to have the tab pages displayed correctly without this... |
214 |
maFlPages.Hide(); |
215 |
///////////////// |
194 |
} |
216 |
} |
195 |
|
217 |
|
196 |
// ----------------------------------------------------------------------------- |
218 |
// ----------------------------------------------------------------------------- |
|
|
219 |
ImpPDFTabDialog::~ImpPDFTabDialog() |
220 |
{ |
221 |
//delete the pages, needed because otherwise the child tab pages |
222 |
//don't get destroyed |
223 |
RemoveTabPage( RID_PDF_TAB_GENER ); |
224 |
RemoveTabPage( RID_PDF_TAB_VPREFER ); |
225 |
RemoveTabPage( RID_PDF_TAB_OPNFTR ); |
226 |
} |
197 |
|
227 |
|
198 |
ImpPDFDialog::~ImpPDFDialog() |
228 |
// ----------------------------------------------------------------------------- |
|
|
229 |
void ImpPDFTabDialog::PageCreated( USHORT _nId, |
230 |
SfxTabPage& _rPage ) |
199 |
{ |
231 |
{ |
|
|
232 |
switch( _nId ) |
233 |
{ |
234 |
case RID_PDF_TAB_GENER: |
235 |
( ( ImpPDFTabGeneralPage* )&_rPage )->SetFilterConfigItem( this ); |
236 |
break; |
237 |
case RID_PDF_TAB_VPREFER: |
238 |
( ( ImpPDFTabViewerPage* )&_rPage )->SetFilterConfigItem( this ); |
239 |
break; |
240 |
case RID_PDF_TAB_OPNFTR: |
241 |
( ( ImpPDFTabOpnFtrPage* )&_rPage )->SetFilterConfigItem( this ); |
242 |
break; |
243 |
} |
200 |
} |
244 |
} |
201 |
|
245 |
|
202 |
// ----------------------------------------------------------------------------- |
246 |
// ----------------------------------------------------------------------------- |
|
|
247 |
short ImpPDFTabDialog::Ok( ) |
248 |
{ |
249 |
//here the whole mechanism of the base class is not used |
250 |
//when Ok is hit, the user means 'convert to PDF', so simply close with ok |
251 |
return RET_OK; |
252 |
} |
203 |
|
253 |
|
204 |
Sequence< PropertyValue > ImpPDFDialog::GetFilterData() |
254 |
// ----------------------------------------------------------------------------- |
|
|
255 |
Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() |
205 |
{ |
256 |
{ |
206 |
// updating the FilterData sequence and storing FilterData to configuration |
257 |
// updating the FilterData sequence and storing FilterData to configuration |
207 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), maRbLosslessCompression.IsChecked() ); |
258 |
if( GetTabPage( RID_PDF_TAB_GENER ) ) |
208 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), maNfQuality.GetValue() ); |
259 |
( ( ImpPDFTabGeneralPage* )GetTabPage( RID_PDF_TAB_GENER ) )->GetFilterConfigItem( this ); |
209 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), maCbReduceImageResolution.IsChecked() ); |
260 |
|
210 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), maCoReduceImageResolution.GetText().ToInt32() ); |
261 |
//prepare the items to be returned |
211 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), maCbTaggedPDF.IsChecked() ); |
262 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), mbUseLosslessCompression ); |
212 |
if ( mbIsPresentation ) |
263 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), mnQuality ); |
213 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), maCbExportNotes.IsChecked() ); |
264 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), mbReduceImageResolution ); |
214 |
else |
265 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), mnMaxImageResolution ); |
215 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), maCbExportNotes.IsChecked() ); |
266 |
|
216 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), maCbTransitionEffects.IsChecked() ); |
267 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), mbUseTaggedPDF ); |
217 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), !maCbExportEmptyPages.IsChecked() ); |
268 |
if ( mbIsPresentation ) |
|
|
269 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), mbExportNotesBoth ); |
270 |
else |
271 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), mbExportNotesBoth ); |
272 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), mbUseTransitionEffects ); |
273 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), mbIsSkipEmptyPages ); |
218 |
|
274 |
|
219 |
/* |
275 |
/* |
220 |
* FIXME: the entries are only implicitly defined by the resource file. Should there |
276 |
* FIXME: the entries are only implicitly defined by the resource file. Should there |
221 |
* ever be an additional form submit format this could get invalid. |
277 |
* ever be an additional form submit format this could get invalid. |
222 |
*/ |
278 |
*/ |
223 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), maLbFormsFormat.GetSelectEntryPos() ); |
279 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), mnFormsType ); |
|
|
280 |
|
281 |
if( GetTabPage( RID_PDF_TAB_VPREFER ) ) |
282 |
( ( ImpPDFTabViewerPage* )GetTabPage( RID_PDF_TAB_VPREFER ) )->GetFilterConfigItem( this ); |
283 |
|
284 |
if( GetTabPage( RID_PDF_TAB_OPNFTR ) ) |
285 |
( ( ImpPDFTabOpnFtrPage* )GetTabPage( RID_PDF_TAB_OPNFTR ) )->GetFilterConfigItem( this ); |
286 |
|
287 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerToolbar" ) ), mbHideViewerToolbar ); |
288 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerMenubar" ) ), mbHideViewerMenubar ); |
289 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerWindowControls" ) ), mbHideViewerWindowControls ); |
290 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ResizeWindowToInitialPage" ) ), mbResizeWinToInit ); //********* |
291 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "CenterWindow" ) ), mbCenterWindow ); |
292 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayPDFDocumentTitle" ) ), mbDisplayPDFDocumentTitle ); |
293 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DirectionR2L" ) ), mbDirectionR2L ); |
294 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenInFullScreenMode" ) ), mbOpenInFullScreenMode ); |
295 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "InitialView" ) ), mnInitialView ); //********* |
296 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Magnification" ) ), mnMagnification); //********* |
297 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "PageLayout" ) ), mnPageLayout ); //********* |
224 |
|
298 |
|
225 |
Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() ); |
299 |
Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() ); |
226 |
|
300 |
|
227 |
aRet.realloc( aRet.getLength() + 1 ); |
301 |
aRet.realloc( aRet.getLength() + 1 ); |
228 |
|
302 |
|
229 |
if( maRbRange.IsChecked() ) |
303 |
if( mbIsRangeChecked ) |
230 |
{ |
304 |
{ |
231 |
aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ); |
305 |
aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ); |
232 |
aRet[ aRet.getLength() - 1 ].Value <<= OUString( maEdPages.GetText() ); |
306 |
aRet[ aRet.getLength() - 1 ].Value <<= OUString( msPageRange ); |
233 |
} |
307 |
} |
234 |
else if( maRbSelection.IsChecked() ) |
308 |
else if( mbSelectionIsChecked ) |
235 |
{ |
309 |
{ |
236 |
aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Selection" ) ); |
310 |
aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Selection" ) ); |
237 |
aRet[ aRet.getLength() - 1 ].Value <<= maSelection; |
311 |
aRet[ aRet.getLength() - 1 ].Value <<= maSelection; |
Lines 240-266
Sequence< PropertyValue > ImpPDFDialog::
Link Here
|
240 |
} |
314 |
} |
241 |
|
315 |
|
242 |
// ----------------------------------------------------------------------------- |
316 |
// ----------------------------------------------------------------------------- |
|
|
317 |
ImpPDFTabGeneralPage::ImpPDFTabGeneralPage( Window* pParent, |
318 |
const SfxItemSet& rCoreSet, |
319 |
ResMgr* paResMgr ) : |
320 |
SfxTabPage( pParent, ResId( RID_PDF_TAB_GENER, paResMgr ), rCoreSet ), |
321 |
|
322 |
maFlPages( this, ResId( FL_PAGES, paResMgr ) ), |
323 |
maRbAll( this, ResId( RB_ALL, paResMgr) ), |
324 |
maRbRange( this, ResId( RB_RANGE, paResMgr ) ), |
325 |
maRbSelection( this, ResId( RB_SELECTION, paResMgr ) ), |
326 |
maEdPages( this, ResId( ED_PAGES, paResMgr ) ), |
327 |
|
328 |
maFlCompression( this, ResId( FL_IMAGES, paResMgr ) ), |
329 |
maRbLosslessCompression( this, ResId( RB_LOSSLESSCOMPRESSION, paResMgr ) ), |
330 |
maRbJPEGCompression( this, ResId( RB_JPEGCOMPRESSION, paResMgr ) ), |
331 |
maFtQuality( this, ResId( FT_QUALITY, paResMgr ) ), |
332 |
maNfQuality( this, ResId( NF_QUALITY, paResMgr ) ), |
333 |
maCbReduceImageResolution( this, ResId( CB_REDUCEIMAGERESOLUTION, paResMgr ) ), |
334 |
maCoReduceImageResolution( this, ResId( CO_REDUCEIMAGERESOLUTION, paResMgr ) ), |
335 |
|
336 |
maFlGeneral( this, ResId( FL_GENERAL, paResMgr ) ), |
337 |
maCbTaggedPDF( this, ResId( CB_TAGGEDPDF, paResMgr ) ), |
338 |
maCbExportNotes( this, ResId( CB_EXPORTNOTES, paResMgr ) ), |
339 |
maCbTransitionEffects( this, ResId( CB_TRANSITIONEFFECTS, paResMgr ) ), |
340 |
|
341 |
maFtFormsFormat( this, ResId( FT_FORMSFORMAT, paResMgr ) ), |
342 |
maLbFormsFormat( this, ResId( LB_FORMSFORMAT, paResMgr ) ), |
343 |
maCbExportEmptyPages( this, ResId( CB_EXPORTEMPTYPAGES, paResMgr ) ), |
344 |
mbIsPresentation( sal_False ), |
345 |
|
346 |
mbResetAlreadyCalled( sal_False ) |
347 |
{ |
348 |
mpaResMgr = paResMgr; |
349 |
FreeResource(); |
350 |
} |
351 |
|
352 |
// ----------------------------------------------------------------------------- |
353 |
ImpPDFTabGeneralPage::~ImpPDFTabGeneralPage() |
354 |
{ |
355 |
delete mpaResMgr; |
356 |
} |
357 |
|
358 |
// ----------------------------------------------------------------------------- |
359 |
void ImpPDFTabGeneralPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent ) |
360 |
{ |
361 |
//init this class data |
362 |
maRbRange.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, TogglePagesHdl ) ); |
363 |
|
364 |
maRbAll.Check(); |
365 |
TogglePagesHdl( NULL ); |
366 |
|
367 |
maNfQuality.SetUnit( FUNIT_PERCENT ); |
368 |
maNfQuality.SetMin( 1, FUNIT_PERCENT ); |
369 |
maNfQuality.SetMax( 100, FUNIT_PERCENT ); |
370 |
|
371 |
maRbSelection.Enable( paParent->mbSelectionPresent ); |
372 |
mbIsPresentation = paParent->mbIsPresentation; |
373 |
mbIsWriter = paParent->mbIsWriter; |
374 |
|
375 |
maCbTransitionEffects.Enable( mbIsPresentation ); |
376 |
maCbExportEmptyPages.Enable( mbIsWriter ); |
377 |
|
378 |
// SJ: Dont know if there are Notes available also for writer. |
379 |
// maCbExportNotes.Enable( paParent->mbIsPresentation ); |
380 |
|
381 |
maRbLosslessCompression.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleCompressionHdl ) ); |
382 |
const sal_Bool bUseLosslessCompression = paParent->mbUseLosslessCompression; |
383 |
if ( bUseLosslessCompression ) |
384 |
maRbLosslessCompression.Check(); |
385 |
else |
386 |
maRbJPEGCompression.Check(); |
387 |
|
388 |
maNfQuality.SetValue( paParent->mnQuality, FUNIT_PERCENT ); |
389 |
maNfQuality.Enable( bUseLosslessCompression == sal_False ); |
390 |
|
391 |
maCbReduceImageResolution.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleReduceImageResolutionHdl ) ); |
392 |
const sal_Bool bReduceImageResolution = paParent->mbReduceImageResolution; |
393 |
maCbReduceImageResolution.Check( bReduceImageResolution ); |
394 |
String aStrRes( String::CreateFromInt32( paParent->mnMaxImageResolution ) ); |
395 |
aStrRes.Append( String( RTL_CONSTASCII_USTRINGPARAM( " DPI" ) ) ); |
396 |
maCoReduceImageResolution.SetText( aStrRes ); |
397 |
maCoReduceImageResolution.Enable( bReduceImageResolution ); |
398 |
|
399 |
maCbTaggedPDF.Check( paParent->mbUseTaggedPDF ); |
400 |
|
401 |
if ( mbIsPresentation ) |
402 |
maCbExportNotes.Check( paParent->mbExportNotesBoth ); |
403 |
else |
404 |
maCbExportNotes.Check( paParent->mbExportNotesBoth ); |
405 |
|
406 |
maCbTransitionEffects.Check( paParent->mbUseTransitionEffects ); |
407 |
maCbExportEmptyPages.Check( !paParent->mbIsSkipEmptyPages ); |
408 |
|
409 |
maLbFormsFormat.SelectEntryPos( (sal_uInt16)paParent->mnFormsType ); |
410 |
} |
411 |
|
412 |
// ----------------------------------------------------------------------------- |
413 |
void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) |
414 |
{ |
415 |
// updating the FilterData sequence and storing FilterData to configuration |
416 |
paParent->mbUseLosslessCompression = maRbLosslessCompression.IsChecked(); |
417 |
paParent->mnQuality = maNfQuality.GetValue(); |
418 |
paParent->mbReduceImageResolution = maCbReduceImageResolution.IsChecked(); |
419 |
paParent->mnMaxImageResolution = maCoReduceImageResolution.GetText().ToInt32(); |
420 |
paParent->mbUseTaggedPDF = maCbTaggedPDF.IsChecked(); |
421 |
paParent->mbExportNotesBoth = maCbExportNotes.IsChecked(); |
422 |
|
423 |
paParent->mbUseTransitionEffects = maCbTransitionEffects.IsChecked(); |
424 |
paParent->mbIsSkipEmptyPages = !maCbExportEmptyPages.IsChecked(); |
425 |
|
426 |
paParent->mbIsRangeChecked = sal_False; |
427 |
if( maRbRange.IsChecked() ) |
428 |
{ |
429 |
paParent->mbIsRangeChecked = sal_True; |
430 |
paParent->msPageRange = String( maEdPages.GetText() ); //FIXME all right on other languages ? |
431 |
} |
432 |
else if( maRbSelection.IsChecked() ) |
433 |
{ |
434 |
paParent->mbSelectionIsChecked = maRbSelection.IsChecked(); |
435 |
} |
436 |
/* |
437 |
* FIXME: the entries are only implicitly defined by the resource file. Should there |
438 |
* ever be an additional form submit format this could get invalid. |
439 |
*/ |
440 |
paParent->mnFormsType = (sal_Int32) maLbFormsFormat.GetSelectEntryPos(); |
441 |
} |
442 |
|
443 |
// ----------------------------------------------------------------------------- |
444 |
SfxTabPage* ImpPDFTabGeneralPage::Create( Window* pParent, |
445 |
const SfxItemSet& rAttrSet) |
446 |
{ |
447 |
ByteString aResMgrName( "pdffilter" ); |
448 |
aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) ); |
449 |
ResMgr* paResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); |
450 |
return ( new ImpPDFTabGeneralPage( pParent, rAttrSet, paResMgr ) ); |
451 |
} |
243 |
|
452 |
|
244 |
IMPL_LINK( ImpPDFDialog, TogglePagesHdl, void*, p ) |
453 |
// ----------------------------------------------------------------------------- |
|
|
454 |
void ImpPDFTabGeneralPage::Reset( const SfxItemSet& ignored) |
455 |
{ |
456 |
//set the controls to default values |
457 |
//since this is called just after the data are set from the parent tab dialog |
458 |
//a bool is needed to enable reset only the second time (while user presses it) |
459 |
if( mbResetAlreadyCalled ) |
460 |
{ |
461 |
maCbTransitionEffects.Enable( mbIsPresentation ); |
462 |
maCbExportEmptyPages.Enable( mbIsWriter ); |
463 |
maRbAll.Check(); |
464 |
TogglePagesHdl( NULL ); |
465 |
maRbLosslessCompression.Check( FALSE ); |
466 |
maRbJPEGCompression.Check(); |
467 |
maNfQuality.SetValue( 90 , FUNIT_PERCENT ); |
468 |
maNfQuality.Enable(); |
469 |
maCbReduceImageResolution.Check( FALSE ); |
470 |
maCbTaggedPDF.Check( FALSE ); |
471 |
if ( mbIsPresentation ) |
472 |
maCbExportNotes.Check( FALSE ); |
473 |
else |
474 |
maCbExportNotes.Check(); |
475 |
maCbTransitionEffects.Check(); |
476 |
maCbExportEmptyPages.Check(); |
477 |
|
478 |
maLbFormsFormat.SelectEntryPos( 0 ); |
479 |
} |
480 |
mbResetAlreadyCalled = sal_True; |
481 |
} |
482 |
|
483 |
// ----------------------------------------------------------------------------- |
484 |
IMPL_LINK( ImpPDFTabGeneralPage, TogglePagesHdl, void*, p ) |
245 |
{ |
485 |
{ |
246 |
maEdPages.Enable( maRbRange.IsChecked() ); |
486 |
maEdPages.Enable( maRbRange.IsChecked() ); |
247 |
maEdPages.SetReadOnly( !maRbRange.IsChecked() ); |
487 |
maEdPages.SetReadOnly( !maRbRange.IsChecked() ); |
248 |
|
|
|
249 |
return 0; |
488 |
return 0; |
250 |
} |
489 |
} |
251 |
|
490 |
|
252 |
// ----------------------------------------------------------------------------- |
491 |
// ----------------------------------------------------------------------------- |
253 |
|
492 |
IMPL_LINK( ImpPDFTabGeneralPage, ToggleCompressionHdl, void*, p ) |
254 |
IMPL_LINK( ImpPDFDialog, ToggleCompressionHdl, void*, p ) |
|
|
255 |
{ |
493 |
{ |
256 |
maNfQuality.Enable( maRbJPEGCompression.IsChecked() ); |
494 |
maNfQuality.Enable( maRbJPEGCompression.IsChecked() ); |
257 |
return 0; |
495 |
return 0; |
258 |
} |
496 |
} |
259 |
|
497 |
|
260 |
// ----------------------------------------------------------------------------- |
498 |
// ----------------------------------------------------------------------------- |
261 |
|
499 |
IMPL_LINK( ImpPDFTabGeneralPage, ToggleReduceImageResolutionHdl, void*, p ) |
262 |
IMPL_LINK( ImpPDFDialog, ToggleReduceImageResolutionHdl, void*, p ) |
|
|
263 |
{ |
500 |
{ |
264 |
maCoReduceImageResolution.Enable( maCbReduceImageResolution.IsChecked() ); |
501 |
maCoReduceImageResolution.Enable( maCbReduceImageResolution.IsChecked() ); |
265 |
return 0; |
502 |
return 0; |
266 |
} |
503 |
} |
|
|
504 |
|
505 |
///////////////////////////////////////////////////////////////// |
506 |
// the option features tab page |
507 |
// ----------------------------------------------------------------------------- |
508 |
ImpPDFTabOpnFtrPage::ImpPDFTabOpnFtrPage( Window* pParent, |
509 |
const SfxItemSet& rCoreSet, |
510 |
ResMgr* paResMgr ) : |
511 |
SfxTabPage( pParent, ResId( RID_PDF_TAB_OPNFTR, paResMgr ), rCoreSet ), |
512 |
|
513 |
maFlInitialView( this, ResId( FL_INITVIEW, paResMgr ) ), |
514 |
maRbOpnPageOnly( this, ResId( RB_OPNMODE_PAGEONLY, paResMgr ) ), |
515 |
maRbOpnOutline( this, ResId( RB_OPNMODE_OUTLINE, paResMgr ) ), |
516 |
maRbOpnThumbs( this, ResId( RB_OPNMODE_THUMBS, paResMgr ) ), |
517 |
|
518 |
maFlMagnification( this, ResId( FL_MAGNIFICATION, paResMgr ) ), |
519 |
maRbMagnDefault( this, ResId( RB_MAGNF_DEFAULT, paResMgr ) ), |
520 |
maRbMagnFitWin( this, ResId( RB_MAGNF_WIND, paResMgr ) ), |
521 |
maRbMagnFitWidth( this, ResId( RB_MAGNF_WIDTH, paResMgr ) ), |
522 |
maRbMagnFitVisible( this, ResId( RB_MAGNF_VISIBLE, paResMgr ) ), |
523 |
|
524 |
maFlPageLayout( this, ResId( FL_PAGE_LAYOUT, paResMgr ) ), |
525 |
maRbPgLyDefault( this, ResId( RB_PGLY_DEFAULT, paResMgr ) ), |
526 |
maRbPgLySinglePage( this, ResId( RB_PGLY_SINGPG, paResMgr ) ), |
527 |
maRbPgLyContinue( this, ResId( RB_PGLY_CONT, paResMgr ) ), |
528 |
maRbPgLyContinueFacing( this, ResId( RB_PGLY_CONTFAC, paResMgr ) ), |
529 |
|
530 |
mbResetAlreadyCalled( sal_False ) |
531 |
{ |
532 |
mpaResMgr = paResMgr; |
533 |
FreeResource(); |
534 |
} |
535 |
|
536 |
// ----------------------------------------------------------------------------- |
537 |
ImpPDFTabOpnFtrPage::~ImpPDFTabOpnFtrPage() |
538 |
{ |
539 |
delete mpaResMgr; |
540 |
} |
541 |
|
542 |
// ----------------------------------------------------------------------------- |
543 |
SfxTabPage* ImpPDFTabOpnFtrPage::Create( Window* pParent, |
544 |
const SfxItemSet& rAttrSet) |
545 |
{ |
546 |
ByteString aResMgrName( "pdffilter" ); |
547 |
aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) ); |
548 |
ResMgr* paResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); |
549 |
return ( new ImpPDFTabOpnFtrPage( pParent, rAttrSet, paResMgr ) ); |
550 |
} |
551 |
|
552 |
// ----------------------------------------------------------------------------- |
553 |
void ImpPDFTabOpnFtrPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) |
554 |
{ |
555 |
paParent->mnInitialView = 0; |
556 |
if( maRbOpnOutline.IsChecked() ) |
557 |
paParent->mnInitialView = 1; |
558 |
else if( maRbOpnThumbs.IsChecked() ) |
559 |
paParent->mnInitialView = 2; |
560 |
|
561 |
paParent->mnMagnification = 0; |
562 |
if( maRbMagnFitWin.IsChecked() ) |
563 |
paParent->mnMagnification = 1; |
564 |
else if( maRbMagnFitWidth.IsChecked() ) |
565 |
paParent->mnMagnification = 2; |
566 |
else if( maRbMagnFitVisible.IsChecked() ) |
567 |
paParent->mnMagnification = 3; |
568 |
|
569 |
paParent->mnPageLayout = 0; |
570 |
if( maRbPgLySinglePage.IsChecked() ) |
571 |
paParent->mnPageLayout = 1; |
572 |
else if( maRbPgLyContinue.IsChecked() ) |
573 |
paParent->mnPageLayout = 2; |
574 |
else if( maRbPgLyContinueFacing.IsChecked() ) |
575 |
paParent->mnPageLayout = 3; |
576 |
|
577 |
} |
578 |
|
579 |
// ----------------------------------------------------------------------------- |
580 |
void ImpPDFTabOpnFtrPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent ) |
581 |
{ |
582 |
switch( paParent->mnPageLayout ) |
583 |
{ |
584 |
default: |
585 |
case 0: |
586 |
maRbPgLyDefault.Check(); |
587 |
break; |
588 |
case 1: |
589 |
maRbPgLySinglePage.Check(); |
590 |
break; |
591 |
case 2: |
592 |
maRbPgLyContinue.Check(); |
593 |
break; |
594 |
case 3: |
595 |
maRbPgLyContinueFacing.Check(); |
596 |
break; |
597 |
}; |
598 |
|
599 |
switch( paParent->mnInitialView ) |
600 |
{ |
601 |
default: |
602 |
case 0: |
603 |
maRbOpnPageOnly.Check(); |
604 |
break; |
605 |
case 1: |
606 |
maRbOpnOutline.Check(); |
607 |
break; |
608 |
case 2: |
609 |
maRbOpnThumbs.Check(); |
610 |
break; |
611 |
}; |
612 |
|
613 |
switch( paParent->mnMagnification ) |
614 |
{ |
615 |
default: |
616 |
case 0: |
617 |
maRbMagnDefault.Check(); |
618 |
break; |
619 |
case 1: |
620 |
maRbMagnFitWin.Check(); |
621 |
break; |
622 |
case 2: |
623 |
maRbMagnFitWidth.Check(); |
624 |
break; |
625 |
case 3: |
626 |
maRbMagnFitVisible.Check(); |
627 |
break; |
628 |
}; |
629 |
} |
630 |
|
631 |
// ----------------------------------------------------------------------------- |
632 |
void ImpPDFTabOpnFtrPage::Reset( const SfxItemSet& ignored) |
633 |
{ |
634 |
//set the controls to default values |
635 |
//since this is called just after the data are set from the parent tab dialog |
636 |
//a bool is needed to enable reset only the second time (user pressing it) |
637 |
if( mbResetAlreadyCalled ) |
638 |
{ |
639 |
maRbOpnPageOnly.Check(); |
640 |
maRbOpnOutline.Check(FALSE); |
641 |
maRbOpnThumbs.Check(FALSE); |
642 |
|
643 |
maRbMagnDefault.Check(); |
644 |
maRbMagnFitWin.Check(FALSE); |
645 |
maRbMagnFitWidth.Check(FALSE); |
646 |
maRbMagnFitVisible.Check(FALSE); |
647 |
|
648 |
maRbPgLyDefault.Check(); |
649 |
maRbPgLySinglePage.Check( FALSE ); |
650 |
maRbPgLyContinue.Check( FALSE ); |
651 |
maRbPgLyContinueFacing.Check( FALSE ); |
652 |
} |
653 |
mbResetAlreadyCalled = sal_True; |
654 |
} |
655 |
|
656 |
//////////////////////////////////////////////////////// |
657 |
// The Viewer preferences tab page |
658 |
// ----------------------------------------------------------------------------- |
659 |
ImpPDFTabViewerPage::ImpPDFTabViewerPage( Window* pParent, |
660 |
const SfxItemSet& rCoreSet, |
661 |
ResMgr* paResMgr ) : |
662 |
SfxTabPage( pParent, ResId( RID_PDF_TAB_VPREFER, paResMgr ), rCoreSet ), |
663 |
|
664 |
maFlWindowOptions( this, ResId( FL_WINOPT, paResMgr ) ), |
665 |
maCbResWinInit( this, ResId( CB_WNDOPT_RESINIT, paResMgr ) ), |
666 |
maCbCenterWindow( this, ResId( CB_WNDOPT_CNTRWIN, paResMgr ) ), |
667 |
maCbOpenFullScreen( this, ResId( CB_WNDOPT_OPNFULL, paResMgr ) ), |
668 |
maCbDispDocTitle( this, ResId( CB_DISPDOCTITLE, paResMgr ) ), |
669 |
|
670 |
maFlUIOptions( this, ResId( FL_USRIFOPT, paResMgr ) ), |
671 |
maCbHideViewerMenubar( this, ResId( CB_UOP_HIDEVMENUBAR, paResMgr ) ), |
672 |
maCbHideViewerToolbar( this, ResId( CB_UOP_HIDEVTOOLBAR, paResMgr ) ), |
673 |
maCbHideViewerWindowControls( this, ResId( CB_UOP_HIDEVWINCTRL, paResMgr ) ), |
674 |
|
675 |
maFlDirContrl( this, ResId( FL_DIRCONTR, paResMgr ) ), |
676 |
maRbL2R( this, ResId( RB_LEFTRIGHT, paResMgr ) ), |
677 |
maRbR2L( this, ResId( RB_RIGHTLEFT, paResMgr ) ), |
678 |
|
679 |
mbResetAlreadyCalled( sal_False ) |
680 |
{ |
681 |
mpaResMgr = paResMgr; |
682 |
FreeResource(); |
683 |
} |
684 |
|
685 |
// ----------------------------------------------------------------------------- |
686 |
ImpPDFTabViewerPage::~ImpPDFTabViewerPage() |
687 |
{ |
688 |
delete mpaResMgr; |
689 |
} |
690 |
|
691 |
// ----------------------------------------------------------------------------- |
692 |
SfxTabPage* ImpPDFTabViewerPage::Create( Window* pParent, |
693 |
const SfxItemSet& rAttrSet) |
694 |
{ |
695 |
ByteString aResMgrName( "pdffilter" ); |
696 |
aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) ); |
697 |
ResMgr* paResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); |
698 |
return ( new ImpPDFTabViewerPage( pParent, rAttrSet, paResMgr ) ); |
699 |
} |
700 |
|
701 |
// ----------------------------------------------------------------------------- |
702 |
void ImpPDFTabViewerPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) |
703 |
{ |
704 |
paParent->mbHideViewerMenubar = maCbHideViewerMenubar.IsChecked(); |
705 |
paParent->mbHideViewerToolbar = maCbHideViewerToolbar.IsChecked( ); |
706 |
paParent->mbHideViewerWindowControls = maCbHideViewerWindowControls.IsChecked(); |
707 |
paParent->mbResizeWinToInit = maCbResWinInit.IsChecked(); |
708 |
paParent->mbOpenInFullScreenMode = maCbOpenFullScreen.IsChecked(); |
709 |
paParent->mbCenterWindow = maCbCenterWindow.IsChecked(); |
710 |
paParent->mbDisplayPDFDocumentTitle = maCbDispDocTitle.IsChecked(); |
711 |
paParent->mbDirectionR2L = maRbR2L.IsChecked(); |
712 |
} |
713 |
|
714 |
// ----------------------------------------------------------------------------- |
715 |
void ImpPDFTabViewerPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent ) |
716 |
{ |
717 |
maCbHideViewerMenubar.Check( paParent->mbHideViewerMenubar ); |
718 |
maCbHideViewerToolbar.Check( paParent->mbHideViewerToolbar ); |
719 |
maCbHideViewerWindowControls.Check( paParent->mbHideViewerWindowControls ); |
720 |
|
721 |
maCbResWinInit.Check( paParent->mbResizeWinToInit ); |
722 |
maCbOpenFullScreen.Check( paParent->mbOpenInFullScreenMode ); |
723 |
maCbCenterWindow.Check( paParent->mbCenterWindow ); |
724 |
maCbDispDocTitle.Check( paParent->mbDisplayPDFDocumentTitle ); |
725 |
|
726 |
maRbR2L.Check( paParent->mbDirectionR2L ); |
727 |
maRbL2R.Check( !paParent->mbDirectionR2L ); |
728 |
} |
729 |
|
730 |
// ----------------------------------------------------------------------------- |
731 |
void ImpPDFTabViewerPage::Reset( const SfxItemSet& ignored ) |
732 |
{ |
733 |
//set the controls to default values |
734 |
// since this is called just after the data are set from the parent tab dialog |
735 |
// a bool is needed to enable reset only the second time (user pressing it) |
736 |
if( mbResetAlreadyCalled ) |
737 |
{ |
738 |
maRbL2R.Check(); |
739 |
maRbR2L.Check(FALSE); |
740 |
|
741 |
maCbHideViewerMenubar.Check( FALSE ); |
742 |
maCbHideViewerToolbar.Check( FALSE ); |
743 |
maCbHideViewerWindowControls.Check( FALSE ); |
744 |
maCbResWinInit.Check( FALSE ); |
745 |
maCbOpenFullScreen.Check( FALSE ); |
746 |
maCbCenterWindow.Check( FALSE ); |
747 |
maCbDispDocTitle.Check(); |
748 |
} |
749 |
mbResetAlreadyCalled = sal_True; |
750 |
} |