summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/oox/ole/vbamodule.hxx11
-rw-r--r--oox/source/ole/vbamodule.cxx2
-rw-r--r--sc/source/ui/vba/vbaapplication.cxx7
3 files changed, 16 insertions, 4 deletions
diff --git a/include/oox/ole/vbamodule.hxx b/include/oox/ole/vbamodule.hxx
index 3028136375bc..4cbb4a41c948 100644
--- a/include/oox/ole/vbamodule.hxx
+++ b/include/oox/ole/vbamodule.hxx
@@ -40,9 +40,14 @@ namespace oox {
namespace oox::ole {
-struct VbaKeyBinding
+/** Stores, which key shortcut maps to which VBA macro method. */
+struct VbaMacroKeyAndMethodBinding
{
+ // This describes a key combinaton in "raw" VBA Macro form, that
+ // still needs translated to a key event that can be used in
+ // LibreOffice.
OUString msApiKey;
+ // The name of the macro method
OUString msMethodName;
};
@@ -105,7 +110,9 @@ private:
bool mbReadOnly;
bool mbPrivate;
bool mbExecutable;
- std::vector<VbaKeyBinding> maKeyBindings;
+
+ /** Keys and VBA macro method bindings */
+ std::vector<VbaMacroKeyAndMethodBinding> maKeyBindings;
};
diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx
index 0fc9609653f3..d53e525989e6 100644
--- a/oox/source/ole/vbamodule.cxx
+++ b/oox/source/ole/vbamodule.cxx
@@ -136,7 +136,7 @@ void VbaModule::createAndImportModule( StorageBase& rVbaStrg,
void VbaModule::registerShortcutKeys()
{
- for (VbaKeyBinding const& rKeyBinding : maKeyBindings)
+ for (VbaMacroKeyAndMethodBinding const& rKeyBinding : maKeyBindings)
{
try
{
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index f11ee6f21bbe..7b68047d0b80 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -358,7 +358,7 @@ uno::Any SAL_CALL
ScVbaApplication::GetOpenFilename(const uno::Any& /*aFileFilter*/, const uno::Any& /*aFilterIndex*/, const uno::Any& aTitle, const uno::Any& /*aButtonText*/, const uno::Any& aMultiSelect)
{
// TODO - take all parameters into account
- auto xDialog = uno::Reference<excel::XFileDialog> (new ScVbaFileDialog( this, mxContext, office::MsoFileDialogType::msoFileDialogFilePicker));
+ uno::Reference<excel::XFileDialog> xDialog(new ScVbaFileDialog(this, mxContext, office::MsoFileDialogType::msoFileDialogFilePicker));
xDialog->setTitle(aTitle);
xDialog->setAllowMultiSelect(aMultiSelect);
@@ -373,6 +373,11 @@ ScVbaApplication::GetOpenFilename(const uno::Any& /*aFileFilter*/, const uno::An
uno::Reference<excel::XFileDialogSelectedItems> xItems = xDialog->getSelectedItems();
auto* pItems = dynamic_cast<ScVbaFileDialogSelectedItems*>(xItems.get());
+
+ // Check, if the implementation of XFileDialogSelectedItems is what we expect
+ if (!pItems)
+ throw uno::RuntimeException("Unexpected XFileDialogSelectedItems implementation");
+
auto const & rItemVector = pItems->getItems();
if (!bMultiSelect) // only 1 selection allowed - return path