summaryrefslogtreecommitdiff
path: root/toolkit/source/helper/formpdfexport.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/source/helper/formpdfexport.cxx')
-rw-r--r--toolkit/source/helper/formpdfexport.cxx58
1 files changed, 23 insertions, 35 deletions
diff --git a/toolkit/source/helper/formpdfexport.cxx b/toolkit/source/helper/formpdfexport.cxx
index bff2d6008d10..1bde6f66a3c0 100644
--- a/toolkit/source/helper/formpdfexport.cxx
+++ b/toolkit/source/helper/formpdfexport.cxx
@@ -28,58 +28,27 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_toolkit.hxx"
-#ifndef _TOOLKIT_HELPER_FORM_FORMPDFEXPORT_HXX
#include <toolkit/helper/formpdfexport.hxx>
-#endif
/** === begin UNO includes === **/
-#ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_
#include <com/sun/star/container/XIndexAccess.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
#include <com/sun/star/container/XNameAccess.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
#include <com/sun/star/container/XNameContainer.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FORM_XFORM_HPP_
#include <com/sun/star/form/XForm.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_
#include <com/sun/star/container/XChild.hpp>
-#endif
-#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
#include <com/sun/star/lang/XServiceInfo.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
#include <com/sun/star/beans/XPropertySet.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FORM_FORMCOMPONENTTYPE_HPP_
#include <com/sun/star/form/FormComponentType.hpp>
-#endif
-#ifndef _COM_SUN_STAR_AWT_TEXTALIGN_HPP_
#include <com/sun/star/awt/TextAlign.hpp>
-#endif
-#ifndef _COM_SUN_STAR_STYLE_VERTICALALIGNMENT_HPP_
#include <com/sun/star/style/VerticalAlignment.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FORM_FORMBUTTONTYPE_HPP_
#include <com/sun/star/form/FormButtonType.hpp>
-#endif
-#ifndef _COM_SUN_STAR_FORM_SUBMITMETHOD_HPP_
#include <com/sun/star/form/FormSubmitMethod.hpp>
-#endif
/** === end UNO includes === **/
-#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
#include <toolkit/helper/vclunohelper.hxx>
-#endif
-#ifndef _VCL_PDFEXTOUTDEVDATA_HXX
+#include <tools/diagnose_ex.h>
#include <vcl/pdfextoutdevdata.hxx>
-#endif
-#ifndef _SV_OUTDEV_HXX
#include <vcl/outdev.hxx>
-#endif
#include <functional>
#include <algorithm>
@@ -315,7 +284,8 @@ namespace toolkitform
//--------------------------------------------------------------------
/** creates a PDF compatible control descriptor for the given control
*/
- void TOOLKIT_DLLPUBLIC describePDFControl( const Reference< XControl >& _rxControl, ::std::auto_ptr< ::vcl::PDFWriter::AnyWidget >& _rpDescriptor ) SAL_THROW(())
+ void TOOLKIT_DLLPUBLIC describePDFControl( const Reference< XControl >& _rxControl,
+ ::std::auto_ptr< ::vcl::PDFWriter::AnyWidget >& _rpDescriptor, ::vcl::PDFExtOutDevData& i_pdfExportData ) SAL_THROW(())
{
_rpDescriptor.reset( NULL );
OSL_ENSURE( _rxControl.is(), "describePDFControl: invalid (NULL) control!" );
@@ -529,7 +499,25 @@ namespace toolkitform
}
else if ( eButtonType == FormButtonType_URL )
{
- OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_TARGET_URL ) >>= pButtonWidget->URL);
+ ::rtl::OUString sURL;
+ OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_TARGET_URL ) >>= sURL );
+ const bool bDocumentLocalTarget = ( sURL.getLength() > 0 ) && ( sURL.getStr()[0] == '#' );
+ if ( bDocumentLocalTarget )
+ {
+ const ::rtl::OUString sDestinationName( sURL.copy(1) );
+ // Register the destination for for future handling ...
+ pButtonWidget->Dest = i_pdfExportData.RegisterDest();
+
+ // and put it into the bookmarks, to ensure the future handling really happens
+ ::std::vector< ::vcl::PDFExtOutDevBookmarkEntry >& rBookmarks( i_pdfExportData.GetBookmarks() );
+ ::vcl::PDFExtOutDevBookmarkEntry aBookmark;
+ aBookmark.nDestId = pButtonWidget->Dest;
+ aBookmark.aBookmark = sURL;
+ rBookmarks.push_back( aBookmark );
+ }
+ else
+ pButtonWidget->URL = sURL;
+
pButtonWidget->Submit = false;
}
@@ -630,7 +618,7 @@ namespace toolkitform
}
catch( const Exception& )
{
- OSL_ENSURE( sal_False, "describePDFControl: caught an exception!" );
+ DBG_UNHANDLED_EXCEPTION();
}
}