[Libreoffice-commits] core.git: filter/source
David Tardon
dtardon at redhat.com
Thu Mar 24 15:51:56 UTC 2016
filter/source/pdf/impdialog.cxx | 23 ++++++++++++++++++++++-
filter/source/pdf/impdialog.hxx | 3 +++
filter/source/pdf/pdfexport.cxx | 2 +-
3 files changed, 26 insertions(+), 2 deletions(-)
New commits:
commit 18cce14dd6389bd67e6c8311ebac8a6d7241a1ee
Author: David Tardon <dtardon at redhat.com>
Date: Thu Mar 24 16:45:43 2016 +0100
disable export notes pages when printing selection
Change-Id: I71d348ed3b6ed5d6bcd24f7932591bafc1ef569f
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index ebde372..73b93cd 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 3a1de72..930772c 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 b26441e..892f146 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;
More information about the Libreoffice-commits
mailing list