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 |
//remove the reset button, not needed in this tabbed dialog |
212 |
RemoveResetButton(); |
213 |
//FIXME |
214 |
//very, very ugly hack: I don't know how to have the tab pages displayed correctly without this... |
215 |
maFlPages.Hide(); |
216 |
///////////////// |
194 |
} |
217 |
} |
195 |
|
218 |
|
196 |
// ----------------------------------------------------------------------------- |
219 |
// ----------------------------------------------------------------------------- |
|
|
220 |
ImpPDFTabDialog::~ImpPDFTabDialog() |
221 |
{ |
222 |
//delete the pages, needed because otherwise the child tab pages |
223 |
//don't get destroyed |
224 |
RemoveTabPage( RID_PDF_TAB_GENER ); |
225 |
RemoveTabPage( RID_PDF_TAB_VPREFER ); |
226 |
RemoveTabPage( RID_PDF_TAB_OPNFTR ); |
227 |
} |
197 |
|
228 |
|
198 |
ImpPDFDialog::~ImpPDFDialog() |
229 |
// ----------------------------------------------------------------------------- |
|
|
230 |
void ImpPDFTabDialog::PageCreated( USHORT _nId, |
231 |
SfxTabPage& _rPage ) |
199 |
{ |
232 |
{ |
|
|
233 |
switch( _nId ) |
234 |
{ |
235 |
case RID_PDF_TAB_GENER: |
236 |
( ( ImpPDFTabGeneralPage* )&_rPage )->SetFilterConfigItem( this ); |
237 |
break; |
238 |
case RID_PDF_TAB_VPREFER: |
239 |
( ( ImpPDFTabViewerPage* )&_rPage )->SetFilterConfigItem( this ); |
240 |
break; |
241 |
case RID_PDF_TAB_OPNFTR: |
242 |
( ( ImpPDFTabOpnFtrPage* )&_rPage )->SetFilterConfigItem( this ); |
243 |
break; |
244 |
} |
200 |
} |
245 |
} |
201 |
|
246 |
|
202 |
// ----------------------------------------------------------------------------- |
247 |
// ----------------------------------------------------------------------------- |
|
|
248 |
short ImpPDFTabDialog::Ok( ) |
249 |
{ |
250 |
//here the whole mechanism of the base class is not used |
251 |
//when Ok is hit, the user means 'convert to PDF', so simply close with ok |
252 |
return RET_OK; |
253 |
} |
203 |
|
254 |
|
204 |
Sequence< PropertyValue > ImpPDFDialog::GetFilterData() |
255 |
// ----------------------------------------------------------------------------- |
|
|
256 |
Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() |
205 |
{ |
257 |
{ |
206 |
// updating the FilterData sequence and storing FilterData to configuration |
258 |
// updating the FilterData sequence and storing FilterData to configuration |
207 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), maRbLosslessCompression.IsChecked() ); |
259 |
if( GetTabPage( RID_PDF_TAB_GENER ) ) |
208 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), maNfQuality.GetValue() ); |
260 |
( ( ImpPDFTabGeneralPage* )GetTabPage( RID_PDF_TAB_GENER ) )->GetFilterConfigItem( this ); |
209 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), maCbReduceImageResolution.IsChecked() ); |
261 |
|
210 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), maCoReduceImageResolution.GetText().ToInt32() ); |
262 |
//prepare the items to be returned |
211 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), maCbTaggedPDF.IsChecked() ); |
263 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), mbUseLosslessCompression ); |
212 |
if ( mbIsPresentation ) |
264 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), mnQuality ); |
213 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), maCbExportNotes.IsChecked() ); |
265 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReduceImageResolution" ) ), mbReduceImageResolution ); |
214 |
else |
266 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), mnMaxImageResolution ); |
215 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), maCbExportNotes.IsChecked() ); |
267 |
|
216 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), maCbTransitionEffects.IsChecked() ); |
268 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), mbUseTaggedPDF ); |
217 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), !maCbExportEmptyPages.IsChecked() ); |
269 |
if ( mbIsPresentation ) |
|
|
270 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), mbExportNotesBoth ); |
271 |
else |
272 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), mbExportNotesBoth ); |
273 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), mbUseTransitionEffects ); |
274 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), mbIsSkipEmptyPages ); |
218 |
|
275 |
|
219 |
/* |
276 |
/* |
220 |
* FIXME: the entries are only implicitly defined by the resource file. Should there |
277 |
* 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. |
278 |
* ever be an additional form submit format this could get invalid. |
222 |
*/ |
279 |
*/ |
223 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), maLbFormsFormat.GetSelectEntryPos() ); |
280 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), mnFormsType ); |
|
|
281 |
|
282 |
if( GetTabPage( RID_PDF_TAB_VPREFER ) ) |
283 |
( ( ImpPDFTabViewerPage* )GetTabPage( RID_PDF_TAB_VPREFER ) )->GetFilterConfigItem( this ); |
284 |
|
285 |
if( GetTabPage( RID_PDF_TAB_OPNFTR ) ) |
286 |
( ( ImpPDFTabOpnFtrPage* )GetTabPage( RID_PDF_TAB_OPNFTR ) )->GetFilterConfigItem( this ); |
287 |
|
288 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerToolbar" ) ), mbHideViewerToolbar ); |
289 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerMenubar" ) ), mbHideViewerMenubar ); |
290 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerWindowControls" ) ), mbHideViewerWindowControls ); |
291 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ResizeWindowToInitialPage" ) ), mbResizeWinToInit ); |
292 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "CenterWindow" ) ), mbCenterWindow ); |
293 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DisplayPDFDocumentTitle" ) ), mbDisplayPDFDocumentTitle ); |
294 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "DirectionR2L" ) ), mbDirectionR2L ); |
295 |
maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenInFullScreenMode" ) ), mbOpenInFullScreenMode ); |
296 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "InitialView" ) ), mnInitialView ); |
297 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Magnification" ) ), mnMagnification); |
298 |
maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "PageLayout" ) ), mnPageLayout ); |
224 |
|
299 |
|
225 |
Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() ); |
300 |
Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() ); |
226 |
|
301 |
|
227 |
aRet.realloc( aRet.getLength() + 1 ); |
302 |
aRet.realloc( aRet.getLength() + 1 ); |
228 |
|
303 |
|
229 |
if( maRbRange.IsChecked() ) |
304 |
if( mbIsRangeChecked ) |
230 |
{ |
305 |
{ |
231 |
aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ); |
306 |
aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ); |
232 |
aRet[ aRet.getLength() - 1 ].Value <<= OUString( maEdPages.GetText() ); |
307 |
aRet[ aRet.getLength() - 1 ].Value <<= OUString( msPageRange ); |
233 |
} |
308 |
} |
234 |
else if( maRbSelection.IsChecked() ) |
309 |
else if( mbSelectionIsChecked ) |
235 |
{ |
310 |
{ |
236 |
aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Selection" ) ); |
311 |
aRet[ aRet.getLength() - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Selection" ) ); |
237 |
aRet[ aRet.getLength() - 1 ].Value <<= maSelection; |
312 |
aRet[ aRet.getLength() - 1 ].Value <<= maSelection; |
Lines 240-266
Sequence< PropertyValue > ImpPDFDialog::
Link Here
|
240 |
} |
315 |
} |
241 |
|
316 |
|
242 |
// ----------------------------------------------------------------------------- |
317 |
// ----------------------------------------------------------------------------- |
|
|
318 |
ImpPDFTabGeneralPage::ImpPDFTabGeneralPage( Window* pParent, |
319 |
const SfxItemSet& rCoreSet, |
320 |
ResMgr* paResMgr ) : |
321 |
SfxTabPage( pParent, ResId( RID_PDF_TAB_GENER, paResMgr ), rCoreSet ), |
322 |
|
323 |
maFlPages( this, ResId( FL_PAGES, paResMgr ) ), |
324 |
maRbAll( this, ResId( RB_ALL, paResMgr) ), |
325 |
maRbRange( this, ResId( RB_RANGE, paResMgr ) ), |
326 |
maRbSelection( this, ResId( RB_SELECTION, paResMgr ) ), |
327 |
maEdPages( this, ResId( ED_PAGES, paResMgr ) ), |
328 |
|
329 |
maFlCompression( this, ResId( FL_IMAGES, paResMgr ) ), |
330 |
maRbLosslessCompression( this, ResId( RB_LOSSLESSCOMPRESSION, paResMgr ) ), |
331 |
maRbJPEGCompression( this, ResId( RB_JPEGCOMPRESSION, paResMgr ) ), |
332 |
maFtQuality( this, ResId( FT_QUALITY, paResMgr ) ), |
333 |
maNfQuality( this, ResId( NF_QUALITY, paResMgr ) ), |
334 |
maCbReduceImageResolution( this, ResId( CB_REDUCEIMAGERESOLUTION, paResMgr ) ), |
335 |
maCoReduceImageResolution( this, ResId( CO_REDUCEIMAGERESOLUTION, paResMgr ) ), |
336 |
|
337 |
maFlGeneral( this, ResId( FL_GENERAL, paResMgr ) ), |
338 |
maCbTaggedPDF( this, ResId( CB_TAGGEDPDF, paResMgr ) ), |
339 |
maCbExportNotes( this, ResId( CB_EXPORTNOTES, paResMgr ) ), |
340 |
maCbTransitionEffects( this, ResId( CB_TRANSITIONEFFECTS, paResMgr ) ), |
341 |
|
342 |
maFtFormsFormat( this, ResId( FT_FORMSFORMAT, paResMgr ) ), |
343 |
maLbFormsFormat( this, ResId( LB_FORMSFORMAT, paResMgr ) ), |
344 |
maCbExportEmptyPages( this, ResId( CB_EXPORTEMPTYPAGES, paResMgr ) ), |
345 |
mbIsPresentation( sal_False ), |
346 |
|
347 |
mbResetAlreadyCalled( sal_False ) |
348 |
{ |
349 |
mpaResMgr = paResMgr; |
350 |
FreeResource(); |
351 |
} |
352 |
|
353 |
// ----------------------------------------------------------------------------- |
354 |
ImpPDFTabGeneralPage::~ImpPDFTabGeneralPage() |
355 |
{ |
356 |
delete mpaResMgr; |
357 |
} |
358 |
|
359 |
// ----------------------------------------------------------------------------- |
360 |
void ImpPDFTabGeneralPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent ) |
361 |
{ |
362 |
//init this class data |
363 |
maRbRange.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, TogglePagesHdl ) ); |
364 |
|
365 |
maRbAll.Check(); |
366 |
TogglePagesHdl( NULL ); |
367 |
|
368 |
maNfQuality.SetUnit( FUNIT_PERCENT ); |
369 |
maNfQuality.SetMin( 1, FUNIT_PERCENT ); |
370 |
maNfQuality.SetMax( 100, FUNIT_PERCENT ); |
371 |
|
372 |
maRbSelection.Enable( paParent->mbSelectionPresent ); |
373 |
mbIsPresentation = paParent->mbIsPresentation; |
374 |
mbIsWriter = paParent->mbIsWriter; |
375 |
|
376 |
maCbTransitionEffects.Enable( mbIsPresentation ); |
377 |
maCbExportEmptyPages.Enable( mbIsWriter ); |
378 |
|
379 |
// SJ: Dont know if there are Notes available also for writer. |
380 |
// maCbExportNotes.Enable( paParent->mbIsPresentation ); |
381 |
|
382 |
maRbLosslessCompression.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleCompressionHdl ) ); |
383 |
const sal_Bool bUseLosslessCompression = paParent->mbUseLosslessCompression; |
384 |
if ( bUseLosslessCompression ) |
385 |
maRbLosslessCompression.Check(); |
386 |
else |
387 |
maRbJPEGCompression.Check(); |
388 |
|
389 |
maNfQuality.SetValue( paParent->mnQuality, FUNIT_PERCENT ); |
390 |
maNfQuality.Enable( bUseLosslessCompression == sal_False ); |
391 |
|
392 |
maCbReduceImageResolution.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleReduceImageResolutionHdl ) ); |
393 |
const sal_Bool bReduceImageResolution = paParent->mbReduceImageResolution; |
394 |
maCbReduceImageResolution.Check( bReduceImageResolution ); |
395 |
String aStrRes( String::CreateFromInt32( paParent->mnMaxImageResolution ) ); |
396 |
aStrRes.Append( String( RTL_CONSTASCII_USTRINGPARAM( " DPI" ) ) ); |
397 |
maCoReduceImageResolution.SetText( aStrRes ); |
398 |
maCoReduceImageResolution.Enable( bReduceImageResolution ); |
399 |
|
400 |
maCbTaggedPDF.Check( paParent->mbUseTaggedPDF ); |
401 |
|
402 |
if ( mbIsPresentation ) |
403 |
maCbExportNotes.Check( paParent->mbExportNotesBoth ); |
404 |
else |
405 |
maCbExportNotes.Check( paParent->mbExportNotesBoth ); |
406 |
|
407 |
maCbTransitionEffects.Check( paParent->mbUseTransitionEffects ); |
408 |
maCbExportEmptyPages.Check( !paParent->mbIsSkipEmptyPages ); |
409 |
|
410 |
maLbFormsFormat.SelectEntryPos( (sal_uInt16)paParent->mnFormsType ); |
411 |
} |
412 |
|
413 |
// ----------------------------------------------------------------------------- |
414 |
void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) |
415 |
{ |
416 |
// updating the FilterData sequence and storing FilterData to configuration |
417 |
paParent->mbUseLosslessCompression = maRbLosslessCompression.IsChecked(); |
418 |
paParent->mnQuality = maNfQuality.GetValue(); |
419 |
paParent->mbReduceImageResolution = maCbReduceImageResolution.IsChecked(); |
420 |
paParent->mnMaxImageResolution = maCoReduceImageResolution.GetText().ToInt32(); |
421 |
paParent->mbUseTaggedPDF = maCbTaggedPDF.IsChecked(); |
422 |
paParent->mbExportNotesBoth = maCbExportNotes.IsChecked(); |
423 |
|
424 |
paParent->mbUseTransitionEffects = maCbTransitionEffects.IsChecked(); |
425 |
paParent->mbIsSkipEmptyPages = !maCbExportEmptyPages.IsChecked(); |
426 |
|
427 |
paParent->mbIsRangeChecked = sal_False; |
428 |
if( maRbRange.IsChecked() ) |
429 |
{ |
430 |
paParent->mbIsRangeChecked = sal_True; |
431 |
paParent->msPageRange = String( maEdPages.GetText() ); //FIXME all right on other languages ? |
432 |
} |
433 |
else if( maRbSelection.IsChecked() ) |
434 |
{ |
435 |
paParent->mbSelectionIsChecked = maRbSelection.IsChecked(); |
436 |
} |
437 |
/* |
438 |
* FIXME: the entries are only implicitly defined by the resource file. Should there |
439 |
* ever be an additional form submit format this could get invalid. |
440 |
*/ |
441 |
paParent->mnFormsType = (sal_Int32) maLbFormsFormat.GetSelectEntryPos(); |
442 |
} |
443 |
|
444 |
// ----------------------------------------------------------------------------- |
445 |
SfxTabPage* ImpPDFTabGeneralPage::Create( Window* pParent, |
446 |
const SfxItemSet& rAttrSet) |
447 |
{ |
448 |
ByteString aResMgrName( "pdffilter" ); |
449 |
aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) ); |
450 |
ResMgr* paResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); |
451 |
return ( new ImpPDFTabGeneralPage( pParent, rAttrSet, paResMgr ) ); |
452 |
} |
243 |
|
453 |
|
244 |
IMPL_LINK( ImpPDFDialog, TogglePagesHdl, void*, p ) |
454 |
// ----------------------------------------------------------------------------- |
|
|
455 |
IMPL_LINK( ImpPDFTabGeneralPage, TogglePagesHdl, void*, p ) |
245 |
{ |
456 |
{ |
246 |
maEdPages.Enable( maRbRange.IsChecked() ); |
457 |
maEdPages.Enable( maRbRange.IsChecked() ); |
247 |
maEdPages.SetReadOnly( !maRbRange.IsChecked() ); |
458 |
maEdPages.SetReadOnly( !maRbRange.IsChecked() ); |
248 |
|
|
|
249 |
return 0; |
459 |
return 0; |
250 |
} |
460 |
} |
251 |
|
461 |
|
252 |
// ----------------------------------------------------------------------------- |
462 |
// ----------------------------------------------------------------------------- |
253 |
|
463 |
IMPL_LINK( ImpPDFTabGeneralPage, ToggleCompressionHdl, void*, p ) |
254 |
IMPL_LINK( ImpPDFDialog, ToggleCompressionHdl, void*, p ) |
|
|
255 |
{ |
464 |
{ |
256 |
maNfQuality.Enable( maRbJPEGCompression.IsChecked() ); |
465 |
maNfQuality.Enable( maRbJPEGCompression.IsChecked() ); |
257 |
return 0; |
466 |
return 0; |
258 |
} |
467 |
} |
259 |
|
468 |
|
260 |
// ----------------------------------------------------------------------------- |
469 |
// ----------------------------------------------------------------------------- |
261 |
|
470 |
IMPL_LINK( ImpPDFTabGeneralPage, ToggleReduceImageResolutionHdl, void*, p ) |
262 |
IMPL_LINK( ImpPDFDialog, ToggleReduceImageResolutionHdl, void*, p ) |
|
|
263 |
{ |
471 |
{ |
264 |
maCoReduceImageResolution.Enable( maCbReduceImageResolution.IsChecked() ); |
472 |
maCoReduceImageResolution.Enable( maCbReduceImageResolution.IsChecked() ); |
265 |
return 0; |
473 |
return 0; |
266 |
} |
474 |
} |
|
|
475 |
|
476 |
///////////////////////////////////////////////////////////////// |
477 |
// the option features tab page |
478 |
// ----------------------------------------------------------------------------- |
479 |
ImpPDFTabOpnFtrPage::ImpPDFTabOpnFtrPage( Window* pParent, |
480 |
const SfxItemSet& rCoreSet, |
481 |
ResMgr* paResMgr ) : |
482 |
SfxTabPage( pParent, ResId( RID_PDF_TAB_OPNFTR, paResMgr ), rCoreSet ), |
483 |
|
484 |
maFlInitialView( this, ResId( FL_INITVIEW, paResMgr ) ), |
485 |
maRbOpnPageOnly( this, ResId( RB_OPNMODE_PAGEONLY, paResMgr ) ), |
486 |
maRbOpnOutline( this, ResId( RB_OPNMODE_OUTLINE, paResMgr ) ), |
487 |
maRbOpnThumbs( this, ResId( RB_OPNMODE_THUMBS, paResMgr ) ), |
488 |
|
489 |
maFlMagnification( this, ResId( FL_MAGNIFICATION, paResMgr ) ), |
490 |
maRbMagnDefault( this, ResId( RB_MAGNF_DEFAULT, paResMgr ) ), |
491 |
maRbMagnFitWin( this, ResId( RB_MAGNF_WIND, paResMgr ) ), |
492 |
maRbMagnFitWidth( this, ResId( RB_MAGNF_WIDTH, paResMgr ) ), |
493 |
maRbMagnFitVisible( this, ResId( RB_MAGNF_VISIBLE, paResMgr ) ), |
494 |
|
495 |
maFlPageLayout( this, ResId( FL_PAGE_LAYOUT, paResMgr ) ), |
496 |
maRbPgLyDefault( this, ResId( RB_PGLY_DEFAULT, paResMgr ) ), |
497 |
maRbPgLySinglePage( this, ResId( RB_PGLY_SINGPG, paResMgr ) ), |
498 |
maRbPgLyContinue( this, ResId( RB_PGLY_CONT, paResMgr ) ), |
499 |
maRbPgLyContinueFacing( this, ResId( RB_PGLY_CONTFAC, paResMgr ) ), |
500 |
|
501 |
mbResetAlreadyCalled( sal_False ) |
502 |
{ |
503 |
mpaResMgr = paResMgr; |
504 |
FreeResource(); |
505 |
} |
506 |
|
507 |
// ----------------------------------------------------------------------------- |
508 |
ImpPDFTabOpnFtrPage::~ImpPDFTabOpnFtrPage() |
509 |
{ |
510 |
delete mpaResMgr; |
511 |
} |
512 |
|
513 |
// ----------------------------------------------------------------------------- |
514 |
SfxTabPage* ImpPDFTabOpnFtrPage::Create( Window* pParent, |
515 |
const SfxItemSet& rAttrSet) |
516 |
{ |
517 |
ByteString aResMgrName( "pdffilter" ); |
518 |
aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) ); |
519 |
ResMgr* paResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); |
520 |
return ( new ImpPDFTabOpnFtrPage( pParent, rAttrSet, paResMgr ) ); |
521 |
} |
522 |
|
523 |
// ----------------------------------------------------------------------------- |
524 |
void ImpPDFTabOpnFtrPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) |
525 |
{ |
526 |
paParent->mnInitialView = 0; |
527 |
if( maRbOpnOutline.IsChecked() ) |
528 |
paParent->mnInitialView = 1; |
529 |
else if( maRbOpnThumbs.IsChecked() ) |
530 |
paParent->mnInitialView = 2; |
531 |
|
532 |
paParent->mnMagnification = 0; |
533 |
if( maRbMagnFitWin.IsChecked() ) |
534 |
paParent->mnMagnification = 1; |
535 |
else if( maRbMagnFitWidth.IsChecked() ) |
536 |
paParent->mnMagnification = 2; |
537 |
else if( maRbMagnFitVisible.IsChecked() ) |
538 |
paParent->mnMagnification = 3; |
539 |
|
540 |
paParent->mnPageLayout = 0; |
541 |
if( maRbPgLySinglePage.IsChecked() ) |
542 |
paParent->mnPageLayout = 1; |
543 |
else if( maRbPgLyContinue.IsChecked() ) |
544 |
paParent->mnPageLayout = 2; |
545 |
else if( maRbPgLyContinueFacing.IsChecked() ) |
546 |
paParent->mnPageLayout = 3; |
547 |
|
548 |
} |
549 |
|
550 |
// ----------------------------------------------------------------------------- |
551 |
void ImpPDFTabOpnFtrPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent ) |
552 |
{ |
553 |
switch( paParent->mnPageLayout ) |
554 |
{ |
555 |
default: |
556 |
case 0: |
557 |
maRbPgLyDefault.Check(); |
558 |
break; |
559 |
case 1: |
560 |
maRbPgLySinglePage.Check(); |
561 |
break; |
562 |
case 2: |
563 |
maRbPgLyContinue.Check(); |
564 |
break; |
565 |
case 3: |
566 |
maRbPgLyContinueFacing.Check(); |
567 |
break; |
568 |
}; |
569 |
|
570 |
switch( paParent->mnInitialView ) |
571 |
{ |
572 |
default: |
573 |
case 0: |
574 |
maRbOpnPageOnly.Check(); |
575 |
break; |
576 |
case 1: |
577 |
maRbOpnOutline.Check(); |
578 |
break; |
579 |
case 2: |
580 |
maRbOpnThumbs.Check(); |
581 |
break; |
582 |
}; |
583 |
|
584 |
switch( paParent->mnMagnification ) |
585 |
{ |
586 |
default: |
587 |
case 0: |
588 |
maRbMagnDefault.Check(); |
589 |
break; |
590 |
case 1: |
591 |
maRbMagnFitWin.Check(); |
592 |
break; |
593 |
case 2: |
594 |
maRbMagnFitWidth.Check(); |
595 |
break; |
596 |
case 3: |
597 |
maRbMagnFitVisible.Check(); |
598 |
break; |
599 |
}; |
600 |
} |
601 |
|
602 |
//////////////////////////////////////////////////////// |
603 |
// The Viewer preferences tab page |
604 |
// ----------------------------------------------------------------------------- |
605 |
ImpPDFTabViewerPage::ImpPDFTabViewerPage( Window* pParent, |
606 |
const SfxItemSet& rCoreSet, |
607 |
ResMgr* paResMgr ) : |
608 |
SfxTabPage( pParent, ResId( RID_PDF_TAB_VPREFER, paResMgr ), rCoreSet ), |
609 |
|
610 |
maFlWindowOptions( this, ResId( FL_WINOPT, paResMgr ) ), |
611 |
maCbResWinInit( this, ResId( CB_WNDOPT_RESINIT, paResMgr ) ), |
612 |
maCbCenterWindow( this, ResId( CB_WNDOPT_CNTRWIN, paResMgr ) ), |
613 |
maCbOpenFullScreen( this, ResId( CB_WNDOPT_OPNFULL, paResMgr ) ), |
614 |
maCbDispDocTitle( this, ResId( CB_DISPDOCTITLE, paResMgr ) ), |
615 |
|
616 |
maFlUIOptions( this, ResId( FL_USRIFOPT, paResMgr ) ), |
617 |
maCbHideViewerMenubar( this, ResId( CB_UOP_HIDEVMENUBAR, paResMgr ) ), |
618 |
maCbHideViewerToolbar( this, ResId( CB_UOP_HIDEVTOOLBAR, paResMgr ) ), |
619 |
maCbHideViewerWindowControls( this, ResId( CB_UOP_HIDEVWINCTRL, paResMgr ) ), |
620 |
|
621 |
maFlDirContrl( this, ResId( FL_DIRCONTR, paResMgr ) ), |
622 |
maRbL2R( this, ResId( RB_LEFTRIGHT, paResMgr ) ), |
623 |
maRbR2L( this, ResId( RB_RIGHTLEFT, paResMgr ) ), |
624 |
|
625 |
mbResetAlreadyCalled( sal_False ) |
626 |
{ |
627 |
mpaResMgr = paResMgr; |
628 |
FreeResource(); |
629 |
} |
630 |
|
631 |
// ----------------------------------------------------------------------------- |
632 |
ImpPDFTabViewerPage::~ImpPDFTabViewerPage() |
633 |
{ |
634 |
delete mpaResMgr; |
635 |
} |
636 |
|
637 |
// ----------------------------------------------------------------------------- |
638 |
SfxTabPage* ImpPDFTabViewerPage::Create( Window* pParent, |
639 |
const SfxItemSet& rAttrSet) |
640 |
{ |
641 |
ByteString aResMgrName( "pdffilter" ); |
642 |
aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) ); |
643 |
ResMgr* paResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); |
644 |
return ( new ImpPDFTabViewerPage( pParent, rAttrSet, paResMgr ) ); |
645 |
} |
646 |
|
647 |
// ----------------------------------------------------------------------------- |
648 |
void ImpPDFTabViewerPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) |
649 |
{ |
650 |
paParent->mbHideViewerMenubar = maCbHideViewerMenubar.IsChecked(); |
651 |
paParent->mbHideViewerToolbar = maCbHideViewerToolbar.IsChecked( ); |
652 |
paParent->mbHideViewerWindowControls = maCbHideViewerWindowControls.IsChecked(); |
653 |
paParent->mbResizeWinToInit = maCbResWinInit.IsChecked(); |
654 |
paParent->mbOpenInFullScreenMode = maCbOpenFullScreen.IsChecked(); |
655 |
paParent->mbCenterWindow = maCbCenterWindow.IsChecked(); |
656 |
paParent->mbDisplayPDFDocumentTitle = maCbDispDocTitle.IsChecked(); |
657 |
paParent->mbDirectionR2L = maRbR2L.IsChecked(); |
658 |
} |
659 |
|
660 |
// ----------------------------------------------------------------------------- |
661 |
void ImpPDFTabViewerPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent ) |
662 |
{ |
663 |
maCbHideViewerMenubar.Check( paParent->mbHideViewerMenubar ); |
664 |
maCbHideViewerToolbar.Check( paParent->mbHideViewerToolbar ); |
665 |
maCbHideViewerWindowControls.Check( paParent->mbHideViewerWindowControls ); |
666 |
|
667 |
maCbResWinInit.Check( paParent->mbResizeWinToInit ); |
668 |
maCbOpenFullScreen.Check( paParent->mbOpenInFullScreenMode ); |
669 |
maCbCenterWindow.Check( paParent->mbCenterWindow ); |
670 |
maCbDispDocTitle.Check( paParent->mbDisplayPDFDocumentTitle ); |
671 |
|
672 |
maRbR2L.Check( paParent->mbDirectionR2L ); |
673 |
maRbL2R.Check( !paParent->mbDirectionR2L ); |
674 |
} |