29#include <osl/file.hxx>
33#include <com/sun/star/text/XTextDocument.hpp>
34#include <com/sun/star/util/thePathSettings.hpp>
35#include <ooo/vba/word/XBookmarks.hpp>
36#include <ooo/vba/word/XDocuments.hpp>
54 ->setMainDocumentType(_mailmergemaindocumenttype);
65 uno::Reference<word::XDocuments> rDocuments;
67 if (aDocuments >>= rDocuments)
68 rDocuments->Open(
Name, ConfirmConversions,
ReadOnly, AddToMru, PasswordDoc, PasswordDot,
80 const css::uno::Any& Name,
const css::uno::Any& Format,
const css::uno::Any& ,
81 const css::uno::Any& ,
const css::uno::Any& ,
82 const css::uno::Any& ,
const css::uno::Any& ,
83 const css::uno::Any& ,
const css::uno::Any& ,
84 const css::uno::Any& ,
const css::uno::Any& )
86 SAL_INFO(
"sw.vba",
"WordBasic.FileSaveAs(Name:=" <<
Name <<
",Format:=" <<
Format <<
")");
96 osl::FileBase::getFileURLFromSystemPath(sFileName, sURL);
110 uno::Reference<util::XPathSettings> xPathSettings
113 xPathSettings->getPropertyValue(
"Work") >>= sPathUrl;
117 sal_Int32
nIndex = sPathUrl.lastIndexOf(
';');
120 sPathUrl = sPathUrl.copy(
nIndex + 1);
123 aURL.SetURL(sPathUrl);
128 aURL.Append(sFileName);
132 sal_Int32 nFileFormat = word::WdSaveFormat::wdFormatDocument;
138 setFilterPropsFromFormat(nFileFormat, aProps);
148 if (Save.hasValue() && (Save >>= nSave) && (nSave == 0 || nSave == 1))
162 const css::uno::Any& DraftFont,
const css::uno::Any& WrapToWindow,
163 const css::uno::Any& PicturePlaceHolders,
const css::uno::Any& FieldCodes,
164 const css::uno::Any& BookMarks,
const css::uno::Any& FieldShading,
165 const css::uno::Any&
StatusBar,
const css::uno::Any& HScroll,
const css::uno::Any& VScroll,
166 const css::uno::Any& StyleAreaWidth,
const css::uno::Any& Tabs,
const css::uno::Any& Spaces,
167 const css::uno::Any& Paras,
const css::uno::Any& Hyphens,
const css::uno::Any&
Hidden,
168 const css::uno::Any& ShowAll,
const css::uno::Any& Drawings,
const css::uno::Any& Anchors,
169 const css::uno::Any& TextBoundaries,
const css::uno::Any& VRuler,
170 const css::uno::Any& Highlight)
172 SAL_INFO(
"sw.vba",
"WordBasic.ToolsOptionsView("
174 << DraftFont <<
", WrapToWindow:=" << WrapToWindow
175 <<
", PicturePlaceHolders:=" << PicturePlaceHolders
176 <<
", FieldCodes:=" << FieldCodes <<
", BookMarks:=" << BookMarks
177 <<
", FieldShading:=" << FieldShading <<
", StatusBar:=" <<
StatusBar
178 <<
", HScroll:=" << HScroll <<
", VScroll:=" << VScroll
179 <<
", StyleAreaWidth:=" << StyleAreaWidth <<
", Tabs:=" << Tabs
180 <<
", Spaces:=" << Spaces <<
", Paras:=" << Paras
181 <<
", Hyphens:=" << Hyphens <<
", Hidden:=" <<
Hidden
182 <<
", ShowAll:=" << ShowAll <<
", Drawings:=" << Drawings
183 <<
", Anchors:=" << Anchors <<
", TextBoundaries:=" << TextBoundaries
196 return css::uno::Any(xBookmarks.is() && xBookmarks->Exists(
Name));
200 const OUString& Name,
const css::uno::Any& Format,
const css::uno::Any& ConfirmConversions,
201 const css::uno::Any& ReadOnly,
const css::uno::Any& LinkToSource,
202 const css::uno::Any& AddToRecentFiles,
const css::uno::Any& PasswordDocument,
203 const css::uno::Any& PasswordTemplate,
const css::uno::Any& Revert,
204 const css::uno::Any& WritePasswordDocument,
const css::uno::Any& WritePasswordTemplate,
205 const css::uno::Any& Connection,
const css::uno::Any& SQLStatement,
206 const css::uno::Any& SQLStatement1,
const css::uno::Any& OpenExclusive,
207 const css::uno::Any& SubType)
211 PasswordDocument, PasswordTemplate, Revert, WritePasswordDocument, WritePasswordTemplate,
212 Connection, SQLStatement, SQLStatement1, OpenExclusive, SubType);
216 const css::uno::Any&
State)
221 return css::uno::Any(sal_Int32(0));
226 SAL_INFO(
"sw.vba",
"WordBasic.DocMaximize(State:=" <<
State <<
")");
229 return css::uno::Any(sal_Int32(0));
241 SAL_INFO(
"sw.vba",
"WordBasic.AppCount()");
244 return css::uno::Any(sal_Int32(2));
255 SAL_WARN(
"sw.vba",
"failed to execute runtime library function MsgBox (" << sPrompt <<
")");
262 mpApp->setScreenUpdating(nOn != 0);
bool PutString(const OUString &)
virtual css::uno::Any SAL_CALL Documents(const css::uno::Any &aIndex) override
css::uno::Reference< css::uno::XComponentContext > const & getContext() const
rtl::Reference< SwVbaWindow > getActiveSwVbaWindow()
virtual css::uno::Reference< css::frame::XModel > getCurrentDocument() override
virtual css::uno::Reference< ov::word::XDocument > SAL_CALL getActiveDocument() override
static rtl::Reference< SwVbaMailMerge > const & get(const css::uno::Reference< ooo::vba::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext)
virtual void SAL_CALL MailMergeOpenDataSource(const OUString &Name, const css::uno::Any &Format, const css::uno::Any &ConfirmConversions, const css::uno::Any &ReadOnly, const css::uno::Any &LinkToSource, const css::uno::Any &AddToRecentFiles, const css::uno::Any &PasswordDocument, const css::uno::Any &PasswordTemplate, const css::uno::Any &Revert, const css::uno::Any &WritePasswordDocument, const css::uno::Any &WritePasswordTemplate, const css::uno::Any &Connection, const css::uno::Any &SQLStatement, const css::uno::Any &SQLStatement1, const css::uno::Any &OpenExclusive, const css::uno::Any &SubType) override
virtual void SAL_CALL ScreenUpdating(const css::uno::Any &On) override
virtual void SAL_CALL ToolsOptionsView(const css::uno::Any &DraftFont, const css::uno::Any &WrapToWindow, const css::uno::Any &PicturePlaceHolders, const css::uno::Any &FieldCodes, const css::uno::Any &BookMarks, const css::uno::Any &FieldShading, const css::uno::Any &StatusBar, const css::uno::Any &HScroll, const css::uno::Any &VScroll, const css::uno::Any &StyleAreaWidth, const css::uno::Any &Tabs, const css::uno::Any &Spaces, const css::uno::Any &Paras, const css::uno::Any &Hyphens, const css::uno::Any &Hidden, const css::uno::Any &ShowAll, const css::uno::Any &Drawings, const css::uno::Any &Anchors, const css::uno::Any &TextBoundaries, const css::uno::Any &VRuler, const css::uno::Any &Highlight) override
virtual sal_Int32 SAL_CALL getMailMergeMainDocumentType() override
virtual css::uno::Any SAL_CALL AppCount() override
virtual void SAL_CALL MsgBox(const OUString &sPrompt) override
virtual css::uno::Any SAL_CALL DocMaximize(const css::uno::Any &State) override
virtual void SAL_CALL FileSaveAs(const css::uno::Any &Name, const css::uno::Any &Format, const css::uno::Any &LockAnnot, const css::uno::Any &Password, const css::uno::Any &AddToMru, const css::uno::Any &WritePassword, const css::uno::Any &RecommendReadOnly, const css::uno::Any &EmbedFonts, const css::uno::Any &NativePictureFormat, const css::uno::Any &FormsData, const css::uno::Any &SaveAsAOCELetter) override
virtual css::uno::Any SAL_CALL AppMaximize(const css::uno::Any &WindowName, const css::uno::Any &State) override
virtual void SAL_CALL setMailMergeMainDocumentType(sal_Int32 _mailmergemaindocumenttype) override
virtual void SAL_CALL FileClose(const css::uno::Any &Save) override
virtual void SAL_CALL AppShow(const css::uno::Any &WindowName) override
virtual void SAL_CALL FileOpen(const OUString &Name, const css::uno::Any &ConfirmConversions, const css::uno::Any &ReadOnly, const css::uno::Any &AddToMru, const css::uno::Any &PasswordDoc, const css::uno::Any &PasswordDot, const css::uno::Any &Revert, const css::uno::Any &WritePasswordDoc, const css::uno::Any &WritePasswordDot) override
virtual css::uno::Any SAL_CALL WindowName(const css::uno::Any &Number) override
virtual css::uno::Any SAL_CALL ExistingBookmark(const OUString &Name) override
virtual void SAL_CALL FileSave() override
SwWordBasic(SwVbaApplication *pApp)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
Reference< XComponentContext > getProcessComponentContext()
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
VBAHELPER_DLLPUBLIC void dispatchRequests(const css::uno::Reference< css::frame::XModel > &xModel, const OUString &aUrl)
bool executeRunTimeLibrary(const std::u16string_view &rSbRtl_command, SbxArray *pParameters)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Reference< XModel > xModel