summaryrefslogtreecommitdiff
path: root/include/oox/ole
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-08-17 21:47:22 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2017-08-17 23:11:15 +0200
commitc0cc02e2934aeb12dda44818955e5964496c186a (patch)
tree16f450bbe38e14d336bdbac3220b642b9a302a87 /include/oox/ole
parent8c0cc5cd7befffc6e8e6361ba67807a799cc997f (diff)
tdf#50097: DOCX: export form controls as MSO ActiveX controls
* Use the same structure for export what MSO uses ** Position and size information are exported as VML shape properties ** Different handling of inline and floating controls (pict or object) ** Do some changes on VML shape export to match how MSO exports these controls ** Write out activeX.xml and activeX.bin to store control properties ** Use persistStorage storage type defined in activeX.xml * Drop grabbaging of activex.XML and activeX.bin * Cleanup control related test code Change-Id: I38bb2b2ffd2676c5459b61ec2549c31348bab41c Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/41256 Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'include/oox/ole')
-rw-r--r--include/oox/ole/olehelper.hxx35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/oox/ole/olehelper.hxx b/include/oox/ole/olehelper.hxx
index 19b871ad27de..128b49796334 100644
--- a/include/oox/ole/olehelper.hxx
+++ b/include/oox/ole/olehelper.hxx
@@ -29,6 +29,7 @@
#include <rtl/ustring.hxx>
#include <sal/types.h>
#include <tools/ref.hxx>
+#include <memory>
namespace com { namespace sun { namespace star {
namespace awt { class XControlModel; }
@@ -52,6 +53,8 @@ namespace oox {
namespace ole {
+ class ControlModelBase;
+ class EmbeddedControl;
#define OLE_GUID_STDFONT "{0BE35203-8F91-11CE-9DE3-00AA004BB851}"
@@ -131,6 +134,38 @@ namespace OleHelper
bool bWithGuid );
}
+class OOX_DLLPUBLIC OleFormCtrlExportHelper final
+{
+ std::unique_ptr<::oox::ole::EmbeddedControl> mpControl;
+ ::oox::ole::ControlModelBase* mpModel;
+ ::oox::GraphicHelper maGrfHelper;
+ css::uno::Reference< css::frame::XModel > mxDocModel;
+ css::uno::Reference< css::awt::XControlModel > mxControlModel;
+
+ OUString maName;
+ OUString maTypeName;
+ OUString maFullName;
+ OUString maGUID;
+public:
+ OleFormCtrlExportHelper( const css::uno::Reference< css::uno::XComponentContext >& rxCtx, const css::uno::Reference< css::frame::XModel >& xDocModel, const css::uno::Reference< css::awt::XControlModel >& xModel );
+ ~OleFormCtrlExportHelper();
+
+ OUString getGUID()
+ {
+ OUString sResult;
+ if ( maGUID.getLength() > 2 )
+ sResult = maGUID.copy(1, maGUID.getLength() - 2 );
+ return sResult;
+ }
+ const OUString& getFullName() { return maFullName; }
+ const OUString& getTypeName() { return maTypeName; }
+ const OUString& getName() { return maName; }
+ bool isValid() { return mpModel != nullptr; }
+ void exportName( const css::uno::Reference< css::io::XOutputStream >& rxOut );
+ void exportCompObj( const css::uno::Reference< css::io::XOutputStream >& rxOut );
+ void exportControl( const css::uno::Reference< css::io::XOutputStream >& rxOut, const css::awt::Size& rSize, bool bAutoClose = false );
+};
+
// ideally it would be great to get rid of SvxMSConvertOCXControls
// however msfilter/source/msfilter/svdfppt.cxx still uses
// SvxMSConvertOCXControls as a base class, unfortunately oox depends on