[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - oovbaapi/ooo sw/source
Tor Lillqvist (via logerrit)
logerrit at kemper.freedesktop.org
Fri Sep 20 12:10:26 UTC 2019
oovbaapi/ooo/vba/word/XDocument.idl | 3 ++-
sw/source/ui/vba/vbadocument.cxx | 16 ++++++++++++++++
sw/source/ui/vba/vbadocument.hxx | 1 +
3 files changed, 19 insertions(+), 1 deletion(-)
New commits:
commit 5f14947e09b3986e6ed56b58efcb196eb76a984c
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed May 22 19:30:37 2019 +0300
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Fri Sep 20 14:09:23 2019 +0200
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 at collabora.com>
Tested-by: Tor Lillqvist <tml at collabora.com>
diff --git a/oovbaapi/ooo/vba/word/XDocument.idl b/oovbaapi/ooo/vba/word/XDocument.idl
index 888287b34e1b..63e4535e9075 100644
--- a/oovbaapi/ooo/vba/word/XDocument.idl
+++ b/oovbaapi/ooo/vba/word/XDocument.idl
@@ -63,7 +63,8 @@ interface XDocument
any Frames( [in] any index );
void SaveAs2000( [in] any FileName, [in] any FileFormat, [in] any LockComments, [in] any Password, [in] any AddToRecentFiles, [in] any WritePassword, [in] any ReadOnlyRecommended, [in] any EmbedTrueTypeFonts, [in] any SaveNativePictureFormat, [in] any SaveFormsData, [in] any SaveAsAOCELetter );
void SaveAs( [in] any FileName, [in] any FileFormat, [in] any LockComments, [in] any Password, [in] any AddToRecentFiles, [in] any WritePassword, [in] any ReadOnlyRecommended, [in] any EmbedTrueTypeFonts, [in] any SaveNativePictureFormat, [in] any SaveFormsData, [in] any SaveAsAOCELetter, [in] any Encoding, [in] any InsertLineBreaks, [in] any AllowSubstitutions, [in] any LineEnding, [in] any AddBiDiMarks );
-
+ // This is a COLEAT-specific addition
+ void SavePreviewPngAs( [in] any FileName );
};
}; }; };
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;
More information about the Libreoffice-commits
mailing list