summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2019-05-22 19:30:37 +0300
committerTor Lillqvist <tml@collabora.com>2019-09-20 14:09:23 +0200
commit5f14947e09b3986e6ed56b58efcb196eb76a984c (patch)
treed54169f41f15fe66c04e22ee7ab8fb65831f8447 /sw/source
parent1725eda0be7546702007c8627e907a95924a50e4 (diff)
Add ooo.vba.word.XDocument.SavePreviewPngAs() and implement
This is for COLEAT's internal use. Change-Id: If1ac2a5b251129e4431d3c0bde82529d6bdc7ccc (cherry picked from commit 41f996044ad752faa19ed6cde4b659d38e74ea07) Reviewed-on: https://gerrit.libreoffice.org/79215 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/ui/vba/vbadocument.cxx16
-rw-r--r--sw/source/ui/vba/vbadocument.hxx1
2 files changed, 17 insertions, 0 deletions
diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx
index ba0bfc27189b..ff5d3b4ffdc7 100644
--- a/sw/source/ui/vba/vbadocument.cxx
+++ b/sw/source/ui/vba/vbadocument.cxx
@@ -518,6 +518,22 @@ SwVbaDocument::SaveAs( const uno::Any& FileName, const uno::Any& FileFormat, con
return SaveAs2000( FileName, FileFormat, LockComments, Password, AddToRecentFiles, WritePassword, ReadOnlyRecommended, EmbedTrueTypeFonts, SaveNativePictureFormat, SaveFormsData, SaveAsAOCELetter );
}
+void SAL_CALL
+SwVbaDocument::SavePreviewPngAs( const uno::Any& FileName )
+{
+ OUString sFileName;
+ FileName >>= sFileName;
+ OUString sURL;
+ osl::FileBase::getFileURLFromSystemPath( sFileName, sURL );
+
+ uno::Sequence< beans::PropertyValue > storeProps(1);
+ storeProps[0].Name = "FilterName" ;
+ storeProps[0].Value <<= OUString("writer_png_Export");
+
+ uno::Reference< frame::XStorable > xStor( getModel(), uno::UNO_QUERY_THROW );
+ xStor->storeToURL( sURL, storeProps );
+}
+
uno::Any
SwVbaDocument::getControlShape( const OUString& sName )
{
diff --git a/sw/source/ui/vba/vbadocument.hxx b/sw/source/ui/vba/vbadocument.hxx
index 1acb42e9232f..af4c93f32f95 100644
--- a/sw/source/ui/vba/vbadocument.hxx
+++ b/sw/source/ui/vba/vbadocument.hxx
@@ -90,6 +90,7 @@ public:
virtual css::uno::Any SAL_CALL Frames( const css::uno::Any& aIndex ) override;
virtual void SAL_CALL SaveAs2000( const css::uno::Any& FileName, const css::uno::Any& FileFormat, const css::uno::Any& LockComments, const css::uno::Any& Password, const css::uno::Any& AddToRecentFiles, const css::uno::Any& WritePassword, const css::uno::Any& ReadOnlyRecommended, const css::uno::Any& EmbedTrueTypeFonts, const css::uno::Any& SaveNativePictureFormat, const css::uno::Any& SaveFormsData, const css::uno::Any& SaveAsAOCELetter ) override;
virtual void SAL_CALL SaveAs( const css::uno::Any& FileName, const css::uno::Any& FileFormat, const css::uno::Any& LockComments, const css::uno::Any& Password, const css::uno::Any& AddToRecentFiles, const css::uno::Any& WritePassword, const css::uno::Any& ReadOnlyRecommended, const css::uno::Any& EmbedTrueTypeFonts, const css::uno::Any& SaveNativePictureFormat, const css::uno::Any& SaveFormsData, const css::uno::Any& SaveAsAOCELetter, const css::uno::Any& Encoding, const css::uno::Any& InsertLineBreaks, const css::uno::Any& AllowSubstitutions, const css::uno::Any& LineEnding, const css::uno::Any& AddBiDiMarks ) override;
+ virtual void SAL_CALL SavePreviewPngAs( const css::uno::Any& FileName ) override;
// XInvocation
virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection( ) override;