[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - oovbaapi/ooo sw/source

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Wed May 22 19:07:52 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 41f996044ad752faa19ed6cde4b659d38e74ea07
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed May 22 19:30:37 2019 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Wed May 22 19:36:45 2019 +0300

    Add ooo.vba.word.XDocument.SavePreviewPngAs() and implement
    
    This is for COLEAT's internal use.
    
    Change-Id: If1ac2a5b251129e4431d3c0bde82529d6bdc7ccc

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 f6a77a1ddaf3..d9aec575b6c4 100644
--- a/sw/source/ui/vba/vbadocument.cxx
+++ b/sw/source/ui/vba/vbadocument.cxx
@@ -517,6 +517,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 c5a4e0d9d8b0..02d411cf65bf 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