summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-03-24 16:45:43 +0100
committerDavid Tardon <dtardon@redhat.com>2016-03-24 16:51:23 +0100
commit18cce14dd6389bd67e6c8311ebac8a6d7241a1ee (patch)
tree836915845debf0e1825bd841ba1b2c5f67b9c45b
parent9970a6d41a34e7d062758ac7142db0a2796553ac (diff)
disable export notes pages when printing selection
Change-Id: I71d348ed3b6ed5d6bcd24f7932591bafc1ef569f
-rw-r--r--filter/source/pdf/impdialog.cxx23
-rw-r--r--filter/source/pdf/impdialog.hxx3
-rw-r--r--filter/source/pdf/pdfexport.cxx2
3 files changed, 26 insertions, 2 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index ebde3726cf32..73b93cdeec21 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -606,9 +606,12 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem( ImpPDFTabDialog* paParent )
mpRbRange->SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, TogglePagesHdl ) );
mpRbAll->Check();
+ mpRbAll->SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleAllHdl ) );
TogglePagesHdl();
mpRbSelection->Enable( paParent->mbSelectionPresent );
+ if ( paParent->mbSelectionPresent )
+ mpRbSelection->SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleSelectionHdl ) );
mbIsPresentation = paParent->mbIsPresentation;
mbIsWriter = paParent->mbIsWriter;
@@ -674,7 +677,6 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem( ImpPDFTabDialog* paParent )
mpCbExportNotesPages->SetToggleHdl( LINK(this, ImpPDFTabGeneralPage, ToggleExportNotesPagesHdl ) );
mpCbExportOnlyNotesPages->Show();
mpCbExportOnlyNotesPages->Check(paParent->mbExportOnlyNotesPages);
- mpCbExportOnlyNotesPages->Enable(paParent->mbExportNotesPages);
mpCbExportHiddenSlides->Show();
mpCbExportHiddenSlides->Check(paParent->mbExportHiddenSlides);
}
@@ -761,9 +763,20 @@ VclPtr<SfxTabPage> ImpPDFTabGeneralPage::Create( vcl::Window* pParent,
}
+IMPL_LINK_NOARG_TYPED(ImpPDFTabGeneralPage, ToggleAllHdl, RadioButton&, void)
+{
+ EnableExportNotesPages();
+}
+
IMPL_LINK_NOARG_TYPED(ImpPDFTabGeneralPage, TogglePagesHdl, RadioButton&, void)
{
TogglePagesHdl();
+ EnableExportNotesPages();
+}
+
+IMPL_LINK_NOARG_TYPED(ImpPDFTabGeneralPage, ToggleSelectionHdl, RadioButton&, void)
+{
+ EnableExportNotesPages();
}
void ImpPDFTabGeneralPage::TogglePagesHdl()
@@ -773,6 +786,14 @@ void ImpPDFTabGeneralPage::TogglePagesHdl()
mpEdPages->GrabFocus();
}
+void ImpPDFTabGeneralPage::EnableExportNotesPages()
+{
+ if ( mbIsPresentation )
+ {
+ mpCbExportNotesPages->Enable( !mpRbSelection->IsChecked() );
+ mpCbExportOnlyNotesPages->Enable( !mpRbSelection->IsChecked() && mpCbExportNotesPages->IsChecked() );
+ }
+}
IMPL_LINK_NOARG_TYPED(ImpPDFTabGeneralPage, ToggleExportFormFieldsHdl, CheckBox&, void)
{
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 3a1de72d86bd..930772c91f0b 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -234,7 +234,9 @@ class ImpPDFTabGeneralPage : public SfxTabPage
VclPtr<ImpPDFTabDialog> mpaParent;
+ DECL_LINK_TYPED( ToggleAllHdl, RadioButton&, void );
DECL_LINK_TYPED( TogglePagesHdl, RadioButton&, void );
+ DECL_LINK_TYPED( ToggleSelectionHdl, RadioButton&, void );
DECL_LINK_TYPED( ToggleCompressionHdl, RadioButton&, void );
DECL_LINK_TYPED( ToggleReduceImageResolutionHdl, CheckBox&, void );
DECL_LINK_TYPED( ToggleWatermarkHdl, CheckBox&, void );
@@ -243,6 +245,7 @@ class ImpPDFTabGeneralPage : public SfxTabPage
DECL_LINK_TYPED( ToggleExportNotesPagesHdl, CheckBox&, void );
void TogglePagesHdl();
+ void EnableExportNotesPages();
public:
DECL_LINK_TYPED( ToggleExportPDFAHdl, CheckBox&, void );
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index b26441e443c9..892f1468b3d1 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -880,7 +880,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
if ( mbExportNotesPages && aCreator == "Impress" )
{
uno::Reference< drawing::XShapes > xShapes; // do not allow to export notes when exporting a selection
- if ( ! ( aSelection >>= xShapes ) ) // TODO: in the dialog the export notes checkbox needs to be disabled
+ if ( ! ( aSelection >>= xShapes ) )
bExportNotesPages = true;
}
const bool bExportPages = bExportNotesPages ? !mbExportOnlyNotesPages : true;