Kaydet (Commit) b15b372c authored tarafından Markus Mohrhard's avatar Markus Mohrhard

structure for vba export

Change-Id: I8094b64185ef8730355841e9b6f9d4ba412568dc
üst 86aebe9e
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef __INCLUDED_INCLUDE_OOX_OLE_VBAEXPORT_HXX__
#define __INCLUDED_INCLUDE_OOX_OLE_VBAEXPORT_HXX__
#include <com/sun/star/uno/XInterface.hpp>
#include <oox/dllapi.h>
namespace com { namespace sun { namespace star {
namespace container { class XNameContainer; }
namespace frame { class XModel; }
} } }
class OOX_DLLPUBLIC VbaExport
{
public:
VbaExport(css::uno::Reference<css::frame::XModel> xModel);
void exportVBA();
private:
css::uno::Reference<css::container::XNameContainer>
getBasicLibrary();
css::uno::Reference<css::frame::XModel> mxModel;
OUString maProjectName;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -236,6 +236,7 @@ $(eval $(call gb_Library_add_exception_objects,oox,\
oox/source/ole/oleobjecthelper \
oox/source/ole/olestorage \
oox/source/ole/vbacontrol \
oox/source/ole/vbaexport \
oox/source/ole/vbahelper \
oox/source/ole/vbainputstream \
oox/source/ole/vbamodule \
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <oox/ole/vbaexport.hxx>
#include <com/sun/star/script/XLibraryContainer.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include "oox/helper/propertyset.hxx"
#include "oox/token/properties.hxx"
VbaExport::VbaExport(css::uno::Reference<css::frame::XModel> xModel):
mxModel(xModel)
{
maProjectName = "How to get the correct project name?";
}
void VbaExport::exportVBA()
{
// start here with the VBA export
}
css::uno::Reference<css::container::XNameContainer> VbaExport::getBasicLibrary()
{
css::uno::Reference<css::container::XNameContainer> xLibrary;
try
{
oox::PropertySet aDocProp(mxModel);
css::uno::Reference<css::script::XLibraryContainer> xLibContainer(aDocProp.getAnyProperty(oox::PROP_BasicLibraries), css::uno::UNO_QUERY_THROW);
xLibrary.set( xLibContainer->getByName(maProjectName), css::uno::UNO_QUERY_THROW );
}
catch(...)
{
}
return xLibrary;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment