Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
7d275e3a
Kaydet (Commit)
7d275e3a
authored
May 02, 2018
tarafından
Tor Lillqvist
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Implement NewWorkbook and WorkbookOpen Automation callbacks in Calc
Change-Id: I1ff31d692100695a706bf128c18c4e3ae8b55ce3
üst
ad57e6d3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
1 deletion
+41
-1
XApplicationOutgoing.idl
oovbaapi/ooo/vba/excel/XApplicationOutgoing.idl
+1
-0
docsh.cxx
sc/source/ui/docshell/docsh.cxx
+32
-0
docsh.hxx
sc/source/ui/inc/docsh.hxx
+5
-1
vbaworkbook.cxx
sc/source/ui/vba/vbaworkbook.cxx
+3
-0
No files found.
oovbaapi/ooo/vba/excel/XApplicationOutgoing.idl
Dosyayı görüntüle @
7d275e3a
...
...
@@ -25,6 +25,7 @@ module ooo { module vba { module excel {
interface XApplicationOutgoing : XInterfaceWithIID
{
void NewWorkbook([in] any Wb);
void WorkbookOpen([in] any Wb);
void WorkbookBeforeClose([in] any Wb, [out] any Cancel);
};
...
...
sc/source/ui/docshell/docsh.cxx
Dosyayı görüntüle @
7d275e3a
...
...
@@ -1080,6 +1080,33 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
pClipDoc
->
ClosingClipboardSource
();
}
}
if
(
const
SfxEventHint
*
pSfxEventHint
=
dynamic_cast
<
const
SfxEventHint
*>
(
&
rHint
)
)
{
switch
(
pSfxEventHint
->
GetEventId
()
)
{
case
SfxEventHintId
:
:
CreateDoc
:
{
uno
::
Any
aWorkbook
;
aWorkbook
<<=
mxAutomationWorkbookObject
;
uno
::
Sequence
<
uno
::
Any
>
aArgs
(
1
);
aArgs
[
0
]
=
aWorkbook
;
SC_MOD
()
->
CallAutomationApplicationEventSinks
(
"NewWorkbook"
,
aArgs
);
}
break
;
case
SfxEventHintId
:
:
OpenDoc
:
{
uno
::
Any
aWorkbook
;
aWorkbook
<<=
mxAutomationWorkbookObject
;
uno
::
Sequence
<
uno
::
Any
>
aArgs
(
1
);
aArgs
[
0
]
=
aWorkbook
;
SC_MOD
()
->
CallAutomationApplicationEventSinks
(
"WorkbookOpen"
,
aArgs
);
}
break
;
default
:
break
;
}
}
}
// Load contents for organizer
...
...
@@ -3340,6 +3367,11 @@ void ScDocShell::SetIsInUcalc()
mbUcalcTest
=
true
;
}
void
ScDocShell
::
RegisterAutomationWorkbookObject
(
css
::
uno
::
Reference
<
ooo
::
vba
::
excel
::
XWorkbook
>
const
&
xWorkbook
)
{
mxAutomationWorkbookObject
=
xWorkbook
;
}
extern
"C"
SAL_DLLPUBLIC_EXPORT
bool
TestImportSLK
(
SvStream
&
rStream
)
{
ScDLL
::
Init
();
...
...
sc/source/ui/inc/docsh.hxx
Dosyayı görüntüle @
7d275e3a
...
...
@@ -20,8 +20,8 @@
#ifndef INCLUDED_SC_SOURCE_UI_INC_DOCSH_HXX
#define INCLUDED_SC_SOURCE_UI_INC_DOCSH_HXX
#include <ooo/vba/excel/XWorkbook.hpp>
#include <sfx2/objsh.hxx>
#include <sfx2/docfac.hxx>
#include <sfx2/sfxmodelfactory.hxx>
#include <sfx2/viewsh.hxx>
...
...
@@ -114,6 +114,8 @@ class SC_DLLPUBLIC ScDocShell final: public SfxObjectShell, public SfxListener
ScDocShellModificator
*
pModificator
;
// #109979#; is used to load XML (created in BeforeXMLLoading and destroyed in AfterXMLLoading)
css
::
uno
::
Reference
<
ooo
::
vba
::
excel
::
XWorkbook
>
mxAutomationWorkbookObject
;
// Only used by Vba helper functions
css
::
uno
::
Reference
<
css
::
script
::
vba
::
XVBAScriptListener
>
m_xVBAListener
;
css
::
uno
::
Reference
<
css
::
datatransfer
::
XTransferable2
>
m_xClipData
;
...
...
@@ -427,6 +429,8 @@ public:
void
SnapVisArea
(
tools
::
Rectangle
&
rRect
)
const
;
void
SetIsInUcalc
();
void
RegisterAutomationWorkbookObject
(
css
::
uno
::
Reference
<
ooo
::
vba
::
excel
::
XWorkbook
>
const
&
xWorkbook
);
};
void
UpdateAcceptChangesDialog
();
...
...
sc/source/ui/vba/vbaworkbook.cxx
Dosyayı görüntüle @
7d275e3a
...
...
@@ -201,6 +201,9 @@ ScVbaWorkbook::init()
{
if
(
!
ColorData
.
getLength
()
)
ResetColors
();
uno
::
Reference
<
frame
::
XModel
>
xModel
(
getModel
(),
uno
::
UNO_QUERY
);
if
(
xModel
.
is
()
)
excel
::
getDocShell
(
xModel
)
->
RegisterAutomationWorkbookObject
(
this
);
}
ScVbaWorkbook
::
ScVbaWorkbook
(
const
css
::
uno
::
Reference
<
ov
::
XHelperInterface
>&
xParent
,
const
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>&
xContext
,
css
::
uno
::
Reference
<
css
::
frame
::
XModel
>
const
&
xModel
)
:
ScVbaWorkbook_BASE
(
xParent
,
xContext
,
xModel
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment